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


Author Topic: How do Action Nodes Work?  (Read 13936 times)

0 Members and 9 Guests are viewing this topic.

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
How do Action Nodes Work?
« on: March 24, 2014, 05:38:38 PM »
Im kind of scared that someone will get angry because I posted multiple topics in the run of a day but anyways.

I want to combine some of Gary's boss style, Johnny's boss style and Jimmy's default style and found out that this is done with something called "Action Nodes". I found out they are in act.img and I extracted 2 files from it. "Nemesis.cat" and "g_johnny.cat".

I now want to combine Johnny's haymaker and his badass kick where he spits on the victim with Gary's 2 strong strike punches but I have no clue how action nodes work and found no help from google.

Offline WhenLifeGivesYouLemons

  • xfire: 1emonthatsme
  • Sr. Member
  • ***
  • Posts: 971
  • Gender: Male
  • 波動バースト
    • View Profile
Re: How do Action Nodes Work?
« Reply #1 on: March 24, 2014, 06:44:53 PM »
This topic would probably explain more or less how Action Nodes work in Lua

http://www.bully-board.com/index.php?topic=20446.0

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #2 on: March 24, 2014, 08:23:08 PM »
This topic would probably explain more or less how Action Nodes work in Lua

http://www.bully-board.com/index.php?topic=20446.0

How do I find out what Johnny's haymaker is called? :ohmy:

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Re: How do Action Nodes Work?
« Reply #3 on: March 25, 2014, 02:10:53 AM »
This topic would probably explain more or less how Action Nodes work in Lua

http://www.bully-board.com/index.php?topic=20446.0

How do I find out what Johnny's haymaker is called? :ohmy:

HxD the 2 files you extracted and keep trying.
An action node usually looks like this :

Path/actionnode

Example(not a real action node) :
Anim/heavy/grapple/bearhug

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #4 on: March 25, 2014, 03:01:47 PM »
Whats wrong with this code?

And can someone tell me another freeroam script besides Stimecycle?

MissionSetup = function()
  local l_1_0 = 270
  local l_1_1 = -110
  local l_1_2 = 6.4000000953674
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(4, 13, 2)
  PedSetTypeToTypeAttitude(5, 13, 2)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
end

TL_Buttons = function()
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
    end
end

main = function()
  Load("Act/Dialog.act")
  Load("Act/Debug.act")
  F_TableInit()
  CreateThread("TL_Buttons")
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    TL_Buttons()
      Wait(0)
   end
end
   
   MissionCleanup = function()
  EnablePOI()
  gMissionRunning = false
end

I go in game then press button 15 on my controller (according to the thread above its press down on right analog) and nothing happens.
« Last Edit: March 25, 2014, 03:42:53 PM by Screenracer »

Offline c00ld0c26

  • The D0c
  • Can't Get Enough
  • *****
  • Posts: 5,137
  • Gender: Male
  • Just a dood doing dood things.
    • View Profile
    • My channel.
Re: How do Action Nodes Work?
« Reply #5 on: March 25, 2014, 06:28:01 PM »
You need to repeat the TL button function in the Main function as shown here :

main = function
repeat
FUNCTION HERE
Wait(0)
until not Alive

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #6 on: March 25, 2014, 07:53:54 PM »
You need to repeat the TL button function in the Main function as shown here :

main = function
repeat
FUNCTION HERE
Wait(0)
until not Alive


MissionSetup = function()
  local l_1_0 = 270
  local l_1_1 = -110
  local l_1_2 = 6.4000000953674
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
PedSetTypeToTypeAttitude(0, 13, 2)
PedSetTypeToTypeAttitude(1, 13, 2)
PedSetTypeToTypeAttitude(2, 13, 2)
PedSetTypeToTypeAttitude(3, 13, 2)
PedSetTypeToTypeAttitude(4, 13, 2)
PedSetTypeToTypeAttitude(5, 13, 2)
PedSetTypeToTypeAttitude(6, 13, 2)
PedSetTypeToTypeAttitude(7, 13, 2)
PedSetTypeToTypeAttitude(8, 13, 2)
PedSetTypeToTypeAttitude(9, 13, 2)
PedSetTypeToTypeAttitude(10, 13, 2)
PedSetTypeToTypeAttitude(11, 13, 2)
end

TL_Buttons = function()
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
    end
end

main = function()
  Load("Act/Dialog.act")
  Load("Act/Debug.act")
  F_TableInit()
  CreateThread("TL_Buttons")
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    TL_Buttons()
      Wait(0)
   end
end

main = function
repeat
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
Wait(0)
until not Alive
   
   MissionCleanup = function()
  EnablePOI()
  gMissionRunning = false
end

This right? When I tried compiling it I got this in CMD:

luac: fs.lua:39: '<' expected near 'repeat'

I suck at this. :unsure:

Offline WhenLifeGivesYouLemons

  • xfire: 1emonthatsme
  • Sr. Member
  • ***
  • Posts: 971
  • Gender: Male
  • 波動バースト
    • View Profile
Re: How do Action Nodes Work?
« Reply #7 on: March 26, 2014, 06:58:12 PM »
You need to repeat the TL button function in the Main function as shown here :

main = function
repeat
FUNCTION HERE
Wait(0)
until not Alive


MissionSetup = function() <-----------------------------------------------------------------
  local l_1_0 = 270
  local l_1_1 = -110
  local l_1_2 = 6.4000000953674
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
PedSetTypeToTypeAttitude(0, 13, 2)
PedSetTypeToTypeAttitude(1, 13, 2)
PedSetTypeToTypeAttitude(2, 13, 2)
PedSetTypeToTypeAttitude(3, 13, 2)
PedSetTypeToTypeAttitude(4, 13, 2)
PedSetTypeToTypeAttitude(5, 13, 2)
PedSetTypeToTypeAttitude(6, 13, 2)
PedSetTypeToTypeAttitude(7, 13, 2)
PedSetTypeToTypeAttitude(8, 13, 2)
PedSetTypeToTypeAttitude(9, 13, 2)
PedSetTypeToTypeAttitude(10, 13, 2)
PedSetTypeToTypeAttitude(11, 13, 2)
end

TL_Buttons = function()  <-----------------------------------------------------------------------------------------------
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
    end
end

main = function()
  Load("Act/Dialog.act")
  Load("Act/Debug.act")
  F_TableInit()
  CreateThread("TL_Buttons")
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    TL_Buttons()
      Wait(0)
   end
end

main = function <---------------------------------------------------- Missing ()
repeat
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
Wait(0)
until not Alive
   
   MissionCleanup = function()
  EnablePOI()
  gMissionRunning = false
end

This right? When I tried compiling it I got this in CMD:

luac: fs.lua:39: '<' expected near 'repeat'

I suck at this. :unsure:

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #8 on: March 26, 2014, 07:18:58 PM »
Got this when I tried to compile.

"luac: fs.lua:54: 'end' expected <to close 'if' at line 46> near 'until'

MissionSetup = function()
  local l_1_0 = 270
  local l_1_1 = -110
  local l_1_2 = 6.4000000953674
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
PedSetTypeToTypeAttitude(0, 13, 1)
PedSetTypeToTypeAttitude(1, 13, 3)
PedSetTypeToTypeAttitude(2, 13, 2)
PedSetTypeToTypeAttitude(3, 13, 1)
PedSetTypeToTypeAttitude(4, 13, 2)
PedSetTypeToTypeAttitude(5, 13, 2)
PedSetTypeToTypeAttitude(6, 13, 2)
PedSetTypeToTypeAttitude(7, 13, 2)
PedSetTypeToTypeAttitude(8, 13, 2)
PedSetTypeToTypeAttitude(9, 13, 2)
PedSetTypeToTypeAttitude(10, 13, 2)
PedSetTypeToTypeAttitude(11, 13, 1)
end

TL_Buttons = function()
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
    end
end

main = function()
  Load("Act/Dialog.act")
  Load("Act/Debug.act")
  F_TableInit()
  CreateThread("TL_Buttons")
  gMissionRunning = true
  while gMissionRunning do
    UpdateTextQueue()
    TL_Buttons()
      Wait(0)
   end
end

main = function()
repeat
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
Wait(0)
until not Alive
   end
 
   MissionCleanup = function()
  EnablePOI()
  gMissionRunning = false
end

Offline WhenLifeGivesYouLemons

  • xfire: 1emonthatsme
  • Sr. Member
  • ***
  • Posts: 971
  • Gender: Male
  • 波動バースト
    • View Profile
Re: How do Action Nodes Work?
« Reply #9 on: March 26, 2014, 07:47:05 PM »
Lua tells you what line you fault at :P just scroll down the numbers in notepad++

main = function()
repeat
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
Wait(0)
until not Alive
   end
->end<-

Just add another "end"

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #10 on: March 26, 2014, 07:55:05 PM »
Lua tells you what line you fault at :P just scroll down the numbers in notepad++

main = function()
repeat
        if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
                 Wait(1000)
Wait(0)
until not Alive
   end
->end<-


Just add another "end"

Same error. ?.?

Offline Reath

  • Jr. Member
  • **
  • Posts: 26
  • Gender: Male
    • View Profile
Re: How do Action Nodes Work?
« Reply #11 on: March 26, 2014, 10:38:07 PM »
Did you put the "end" between those two waits? You need to end the "if" before you get to the "until".
Code: [Select]
main = function()
repeat
 if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
 Wait(1000)
end 
Wait(0)
until not Alive
 end

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #12 on: March 27, 2014, 08:32:29 AM »
Did you put the "end" between those two waits? You need to end the "if" before you get to the "until".
Code: [Select]
main = function()
repeat
 if IsButtonPressed(15, 1) and IsButtonPressed(2, 1) then
          px,py,pz = PlayerGetPosXYZ()
        TextPrintString("Player Pos: "..px..",  "..py..",  "..pz.."Area:"..AreaGetVisible(), 4, 2)
         Wait(1000)
        elseif IsButtonPressed(7, 0) and IsButtonPressed(12, 0) then
          PedSetActionNode(gPlayer, "/ThroatGrab/ThroatGrab_Gv", "Act/g_johnny")
 Wait(1000)
end 
Wait(0)
until not Alive
 end

That worked. Im now inserting it into scripts.img and waiting for it to give me another error. :L

Offline Screenracer

  • Jr. Member
  • **
  • Posts: 33
    • View Profile
Re: How do Action Nodes Work?
« Reply #13 on: March 27, 2014, 08:48:19 AM »
When I press button 15 on controller 1 (the right analog stick) Jimmy crouches and nothing happens. :S
« Last Edit: March 27, 2014, 09:08:04 AM by Screenracer »

Offline Reath

  • Jr. Member
  • **
  • Posts: 26
  • Gender: Male
    • View Profile
Re: How do Action Nodes Work?
« Reply #14 on: March 27, 2014, 10:39:00 AM »
Try " if IsButtonPressed(2, 1) then " (zoom in)
and " elseif IsButtonPressed(14, 0) then "  (look back)