Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: denizthebest on June 10, 2015, 07:36:57 AM

Title: Hello modders i need help
Post by: denizthebest on June 10, 2015, 07:36:57 AM
Hi guys i have a simple question where exactly should i put PedSetActionTree(gPlayer, .............................)
i putted in function main but it doesnt works  :confused:
Title: Re: Hello modders i need help
Post by: AfterLife on June 10, 2015, 07:49:16 AM
Please read the entire Lua tutorial by some of our fellow members before asking questions like these.
Title: Re: Hello modders i need help
Post by: Unknownsoldier on June 10, 2015, 08:33:02 AM
you need to find 2 parts to the node u want. we will use /Global/Player.(it just makes u idle)

PedSetActionNode(gPlayer, "/Global/Player", "Act/Player.act")

for example we wil use "/Global/N_Earnest/Offense/FireSpudGun", "act/anim/N_Earnest.act"

so u do PedSetActioNode(gPlayer, "/Global/N_Earnest/Offense/FireSpudGun", "act/anim/N_Earnest.act")
boom. u got urself a node. u hav to put udner isbuttonpressed so do like this:

function thing()
  if IsButtonBeingPressed(button, 0) then
       PedSetActionNode(gPlayer, "/Global/N_Earnest/Offense/FireSpudGun", "act/anim/N_Earnest.act")
  end
end

boom again. i helpt u. ;)
Title: Re: Hello modders i need help
Post by: DaBOSS54320 on June 10, 2015, 10:07:03 AM
He wanted to know where to set the tree, not a specific node.

You should set the tree in MissionSetup, or at least outside of any loops. Remember how the function works, it takes 3 arguments.

1 - The ped's id to set the action tree of (gPlayer is the player's)
2 - The action tree (An action tree is the root of all action nodes in the style. So for example "/Global/P_Striker_A")
3 - The action file, which is where the actions (tree and nodes) of the style are located. All NPC styles are in the Act/Anim directory, and are just the title of the style with the file extension ".act". You won't find an Act/Anim folder with ACT (action) files in it, but the release version of them are in cat files in Act/Act.img. Luckily we don't really need it to find where the act files are because they all follow the same pattern of being in Act/Anim and having the .act extension. With finding nodes it may of been nice to have the ACT files but I guess we weren't that fortunate. So in short, "Act/Anim/P_Striker_A.act".

A complete call to the function could look like this: PedSetActionTree(gPlayer,"/Global/P_Striker_A","Act/Anim/P_Striker_A.act" and I would suggest putting it in MissionSetup, but make sure it is after AreaTransitionXYZ, because AreaTransitionXYZ must be the first function called inside of MissionSetup.
Title: Re: Hello modders i need help
Post by: Unknownsoldier on June 10, 2015, 03:58:46 PM
He wanted to know where to set the tree, not a specific node.
That's kinda what I showed in my post..