Bully-Board

Bully Modding Section => Bully Modding => TUTORIALS => Topic started by: Unknownsoldier on June 30, 2015, 11:48:50 PM

Title: Using Action Nodes(FOR NEWBIES)
Post by: Unknownsoldier on June 30, 2015, 11:48:50 PM
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:
Code: [Select]
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   Crouch


I will pick 3 the zoom out button. Here we go.
In the TL_Buttons function, type: if IsButtonBeingPressed(button_id_here, 0) then

Now that you have your first "if" statement in, you will need to add a second "end" (http://i.gyazo.com/d8a8f038b7e11bed34ac589738614691.png)

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:
(http://i.gyazo.com/7c22d01269bb856c988d9bb38e274423.png)

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.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: DaBOSS54320 on July 01, 2015, 01:59:00 AM
This seems like a really informational post and it seems mostly accurate.

A problem I noticed though is you forgot the Z coordinate in the call to AreaTransitionXYZ, (you probably meant to have 6 for outside the boy's dorm). Also the health is more than the default max health, and it also will only work assuming the player is using the default pedstats.dat, but since this is centered around action nodes and health isn't very relevant, this seems like a great tutorial, good job.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: SWEGTA on July 01, 2015, 07:03:17 AM
This is a very good tutorial.
I can easily see the newbies learning a thing or two from this. Nice work.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: DaBOSS54320 on July 01, 2015, 10:47:02 AM
I figured out how to use Action nodes myself. It is pretty simple to actually.

That's awesome! You're the most amazing modder I've ever seen in my life.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: deadpoolXYZ on July 01, 2015, 11:00:06 AM
It's nice that you included the actions ID's and explained the difference between PedSetActionNode and ExecuteActionNode.

Dat win xp theme btw.  :cool:

That's awesome! You're the most amazing modder I've ever seen in my life.

Plz no bullying. (http://slangit.com/images/shortcuts/twitch/admins/biblethump.png)
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: Unknownsoldier on July 01, 2015, 07:27:04 PM
This seems like a really informational post and it seems mostly accurate.

A problem I noticed though is you forgot the Z coordinate in the call to AreaTransitionXYZ, (you probably meant to have 6 for outside the boy's dorm). Also the health is more than the default max health, and it also will only work assuming the player is using the default pedstats.dat, but since this is centered around action nodes and health isn't very relevant, this seems like a great tutorial, good job.
Fixed the z. nd thx.



This is a very good tutorial.
I can easily see the newbies learning a thing or two from this. Nice work.
Thank you!  8)



I figured out how to use Action nodes myself. It is pretty simple to actually.
dude nice.



Dat win xp theme btw.  :cool:
winxp4life.tk fgt.
(http://i.gyazo.com/b174b43045d7103b908dc9fbee117173.png)
u know how we do. lol yes windows xp luna theme for windows 7. (thx nathan)
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: Shrimp on July 21, 2015, 10:35:04 PM
yes amingo is very mad!
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: denizthebest on July 22, 2015, 08:54:39 AM
Nice,would be great for newbie's who want to learn some lua
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: AlphaTech on July 24, 2015, 09:00:17 AM
Okay so back to topic, I have a question. If I wanted to add a style to a normal ped but of course a custom one how do I add it? I know action nodes can be used with buttons but how would I add them to a ped instead of a player and make it so the style is not random.

Like a custom style for a ped instead of the player their are a lot of mods for the player but none for the ped.

@Daboss I know GetTimer is a method but how do I make it so the style is not random.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: MadmaN on July 24, 2015, 07:07:02 PM
Topic all cleaned up now. Please keep it civil.  8)
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: DaBOSS54320 on July 24, 2015, 07:53:37 PM
Civil? Naw! *throws chair* (https://youtu.be/XMt55fi7ZQQ)

Well all you do when you give the player a custom style is set action nodes on him with PedSetActionNode, so it's really as simple as setting nodes on a ped instead. Just be careful when you do it. I suggest making sure the ped is playing /Global/(their style)/Default_KEY first because that means they are idle and not already attacking or anything.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: AlphaTech on July 24, 2015, 08:40:27 PM
Civil War!!!!!   ;D ;D ;D ;D Am don wit ur shit Boss, Prepare to getz no skope bye am thank PinkPie. 

Heh anyway thank's for the help, I hope to see a bright Civil Future.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: Mick3Mouse on July 24, 2015, 08:55:43 PM
Unknown, where the fuck are you.
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: Shrimp on July 24, 2015, 09:02:31 PM
he's in my bed, fuck off you prick!!!!!

#adminplscolonbracket
Title: Re: Using Action Nodes(FOR NEWBIES)
Post by: AlphaTech on July 24, 2015, 09:39:31 PM
@MvpMick U little shit he's tied up in my basement. Lol anyway back to topic guys.