This tutorial is for people/newbies who don't know how to use action nodes. I have received a lot of messages lately from new modders asking how to use action nodes, and where to put it. If you already know how this works, then this is stuff you all already know. This is mainly for the new modders who need help or don't know where the codes go.
There are 2 ways to set action nodes. There's
PedSetActionNode, and there is
ExecuteActionNode. For styles, I prefer ExecuteActionNode. But for ambient(etc) PedSetActionNode may be better. ExecuteActionNode can't be stopped with other action nodes. For example, if you have 1 button to EXECUTE an action node and you press it, it cannot be interrupted if you press another node button. But pedsetactionnode can. If you are just experimenting with the node or testing it, you should probably use PedSetActionNode because it won't crash the game, and it can be interrupted at any time by another binded button for a different node.
First, you need this node binding part to be repeated. It may seem like it takes longer, or is more difficult, but it is a lot easier, and in some cases decreases confusion. For new modders, keep in mind if you're modding ArcRace1(which you SHOULD if you're new because it can be a clean script), you NEED the 2 main functions. MissionCleanup is not needed. It's only needed if you want to unload animation groups, collectgarbage(), delete tables, peds, delete entities etc. If you want a clean script that's ready to be modded, just use this example:
function MissionSetup()
AreaTranisitionXYZ(0, 270, -110, 7)
PlayerSetHealth(1000)
end
function MissionCleanup()
gMissionRunning = false
collectgarbage()
end
function main()
gMissionRunning = true
while gMissionRunning do
TL_Buttons()
Wait(0)
end
end
function TL_Buttons()
end
TL_Buttons is where the button statements will be placed. You can also place them under the "while" loop, but it's easier this way.
Choose from the list of buttons below which one you want to bind for a node:
0 Show Secondary Tasks (Left)
1 Show Tasks/Objectives (Right)
2 Zoom in
3 Zoom out
4 Map Menu
5 Pause Menu
6 Melee Attack
7 Sprint
8 Jump
9 Grapple
10 Lock On
11 Previous Weapon
12 Weapon Fire
13 Next Weapon
14 Look Back
15 CrouchI will pick 3 the zoom out button. Here we go.
In the TL_Buttons function, type:
if IsButtonBeingPressed(button_id_here, 0) thenNow that you have your first "if" statement in, you will need to add a second "end"
Now the fun part. Starting the action node. Just use PedSetActionNode for now. Once you know it works you can change it however you want.
We will use the running attack most characters in-game use. To avoid confusion thus far, here is a quick explanation on what everything in the script does:
Hopefully this will resolve most confusion for newbies regarding how to use and where to put action nodes. If you do not understand something, please leave another comment. Either me or someone else will reply with an answer that could help.