News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Using Action Nodes(FOR NEWBIES)  (Read 9709 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Using Action Nodes(FOR NEWBIES)
« 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"

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.
« Last Edit: July 01, 2015, 07:22:44 PM by Unknownsoldier »

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #1 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.

Offline SWEGTA

  • Da Forum Luffs Me!
  • *****
  • Posts: 6,422
  • Gender: Male
  • Swee Gee Tee Ayy
    • View Profile
    • Bully & GTA videos
Re: Using Action Nodes(FOR NEWBIES)
« Reply #2 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.

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #3 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.

deadpoolXYZ

  • Guest
Re: Using Action Nodes(FOR NEWBIES)
« Reply #4 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.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #5 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.

u know how we do. lol yes windows xp luna theme for windows 7. (thx nathan)

Offline Shrimp

  • Sr. Member
  • ***
  • Posts: 514
  • Gender: Male
  • your official b-b's chav. wag wan.
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #6 on: July 21, 2015, 10:35:04 PM »
yes amingo is very mad!

Offline denizthebest

  • Jr. Member
  • **
  • Posts: 85
  • Half way there.
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #7 on: July 22, 2015, 08:54:39 AM »
Nice,would be great for newbie's who want to learn some lua

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #8 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.

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #9 on: July 24, 2015, 07:07:02 PM »
Topic all cleaned up now. Please keep it civil.  8)

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #10 on: July 24, 2015, 07:53:37 PM »
Civil? Naw! *throws chair*

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.

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #11 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.

Offline Mick3Mouse

  • Obam3mouse
  • Bullworth Junkie
  • ****
  • Posts: 4,343
  • Gender: Male
  • Major Mick3Mouse Algie Hunter
    • View Profile
    • My youtube
Re: Using Action Nodes(FOR NEWBIES)
« Reply #12 on: July 24, 2015, 08:55:43 PM »
Unknown, where the fuck are you.

Offline Shrimp

  • Sr. Member
  • ***
  • Posts: 514
  • Gender: Male
  • your official b-b's chav. wag wan.
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #13 on: July 24, 2015, 09:02:31 PM »
he's in my bed, fuck off you prick!!!!!

#adminplscolonbracket

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Using Action Nodes(FOR NEWBIES)
« Reply #14 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.