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


Author Topic: Assign fighting moves to keyboard.  (Read 5034 times)

0 Members and 2 Guests are viewing this topic.

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Assign fighting moves to keyboard.
« on: May 07, 2013, 08:57:42 PM »
I would like to assign some moves onto the keyboard for LUA and I dont know where to start. I wanted to assign Grapples to my keyboard. Reason why I dont use Walters is because i have my own code that i want on my script. If there is a way to add it to his script that would be nice. Thanks

deadpoolXYZ

  • Guest
Re: Assign fighting moves to keyboard.
« Reply #1 on: May 08, 2013, 02:29:48 PM »
This is the code:

Code: [Select]
if IsButtonPressed(0, 0) then
PedSetActionNode(gPlayer, "/Global/Actions/Grapples/Front/Grapples/GrappleMoves/PowerBomb", "Globals/BOSS_Russell.act")
end

You can change the first number in (0, 0) if you want to use a different button.

Code: [Select]
(0, 0) = left arrow
(1, 0) = right arrow
(14, 0) = X
(15, 0) = C

This is the powerbomb animation:
Code: [Select]
"/Global/Actions/Grapples/Front/Grapples/GrappleMoves/PowerBomb", "Globals/BOSS_Russell.act"
You can look for animations in act.img if you want to change it.

if you want 2 animations in 2 different buttons then do this:

Code: [Select]
if IsButtonPressed(0, 0) then
PedSetActionNode(gPlayer, "/Global/Actions/Grapples/Front/Grapples/GrappleMoves/PowerBomb", "Globals/BOSS_Russell.act")
elseif IsButtonPressed(1, 0) then
PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
end

You may also add this to your code:
Code: [Select]
LoadAnimationGroup("Russell") 
If you don't add that, then Jimmy will open his arms because the animation is missing.
« Last Edit: May 09, 2013, 08:25:26 PM by |XF|-MadmaN[AR] »

Offline DreamEvo

  • Paragon
  • Full Member
  • ***
  • Posts: 247
  • Gender: Male
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #2 on: May 08, 2013, 08:07:19 PM »
Thanks a lot! And where do I add the line to load the animation group and do I have to do the same with Johnny?

deadpoolXYZ

  • Guest
Re: Assign fighting moves to keyboard.
« Reply #3 on: May 09, 2013, 08:16:49 AM »
Thanks a lot! And where do I add the line to load the animation group and do I have to do the same with Johnny?

It should be under
Code: [Select]
F_MissionSetup = function().

Here are all the animations I added to my code.

 
Code: [Select]
LoadAnimationGroup("Russell") 
  LoadAnimationGroup("B_Striker")
  LoadAnimationGroup("P_Striker")
  LoadAnimationGroup("Boxing")
  LoadAnimationGroup("Straf_Prep")
  LoadAnimationGroup("F_Preps")
  LoadAnimationGroup("G_Johnny")
  LoadAnimationGroup("F_Greas")
  LoadAnimationGroup("G_Grappler")
  LoadAnimationGroup("G_Striker")
  LoadAnimationGroup("Straf_Wrest")
  LoadAnimationGroup("DO_Striker")
  LoadAnimationGroup("DO_StrikeCombo")
  LoadAnimationGroup("F_Douts")
  LoadAnimationGroup("IDLE_JOCK_A")
  LoadAnimationGroup("F_JOCKS")
  LoadAnimationGroup("NPC_Mascot")
  LoadAnimationGroup("J_Mascot")
  LoadAnimationGroup("J_Grappler")
  LoadAnimationGroup("C_Wrestling")
  LoadAnimationGroup("Earnest")
  LoadAnimationGroup("SNERD_I")
  LoadAnimationGroup("SNERD_S")
  LoadAnimationGroup("N_Striker_B")
  LoadAnimationGroup("F_Nerds")
  LoadAnimationGroup("Nemesis")
  LoadAnimationGroup("Halloween")
  LoadAnimationGroup("TE_FEMALE") 
  LoadAnimationGroup("F_Girls")
  LoadAnimationGroup("NPC_Adult")
  LoadAnimationGroup("F_Adult")
  LoadAnimationGroup("LE_ORDERLY")
  LoadAnimationGroup("F_CRAZY")
  LoadAnimationGroup("NPC_Principal")
  LoadAnimationGroup("Authority")
  LoadAnimationGroup("POI_SMOKING")
  LoadAnimationGroup("Sitting_Boys")
  LoadAnimationGroup("Hang_Talking")
  LoadAnimationGroup("NPC_AggroTaunt")
  LoadAnimationGroup("BOSS_Darby")
  LoadAnimationGroup("J_Damon")
  LoadAnimationGroup("J_Ted")
  LoadAnimationGroup("1_07_SaveBucky")
  LoadAnimationGroup("1_03The Setup")
  LoadAnimationGroup("TSGate")
  LoadAnimationGroup("Hang_Jock")
  LoadAnimationGroup("Hang_Talking")
  LoadAnimationGroup("1_07_Sk8Board")
  LoadAnimationGroup("GEN_Social")
  LoadAnimationGroup("MINIDunk")
  LoadAnimationGroup("MINI_React")
  LoadAnimationGroup("6B_PARA")
  LoadAnimationGroup("Px_Rail")
  LoadAnimationGroup("1_02_MeetWithGary")
  LoadAnimationGroup("NIS_1_02B")
  LoadAnimationGroup("NIS_1_02")
  LoadAnimationGroup("Hang_Talking")
  LoadAnimationGroup("Area_School")
  LoadAnimationGroup("SBULL_A")
  LoadAnimationGroup("NPC_Adult")
  LoadAnimationGroup("HUMIL_6-5VPLY")
  LoadAnimationGroup("HUMIL_6-5VPLY")
  LoadAnimationGroup("HUMIL_6-5VPLY")
  LoadAnimationGroup("NPC_AggroTaunt")
« Last Edit: May 09, 2013, 08:26:17 PM by |XF|-MadmaN[AR] »

Offline Red Blaster

  • The BB Arab
  • More Than Halfway There
  • *****
  • Posts: 5,649
  • Gender: Male
  • Hi
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #4 on: May 09, 2013, 01:26:40 PM »
It's better to use only the ones you absolutely need.

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #5 on: May 09, 2013, 08:24:24 PM »
You may notice that when using those LUA commands...the game will have random crashes....this is due to not using the LoadAnimation codes right since you can only load a bare handful at once and after you are done using what requires those animations...you have to immediately unload them or else you will leave a bunch of garbage in the LUA interpreter active memory and then the game will crash.

There are other ways to do this. But they are a bit harder to explain since it requires advanced knowledge about creating tables which only rise and I know currently.

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #6 on: May 09, 2013, 08:27:52 PM »
BTW Faustus

I edited your post to put the lua code into the code BB code to preserve its format and make it easier to read. Please use that bbcode when posting lua code since then it will give you a much easier to read post  8)

The button for it is labled with # on the post window.

deadpoolXYZ

  • Guest
Re: Assign fighting moves to keyboard.
« Reply #7 on: May 09, 2013, 09:01:50 PM »
I will try to use the BB code more often if necessary.

My game has never crashed because loading a lot of animations.
I also forgot to remove the unecessary animation groups that I used to test animations.

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #8 on: May 09, 2013, 09:25:01 PM »
Best thing to do is load no more then 6 at a time to keep things more stable....and then at the end of the script under the mission end function you want to do the same lines for the same animations you loaded...only use

UnLoadAnimationGroup("animation")

The reason why I ask that you and everyone else that reads this to please use the bbcode for posting lua code is becasue it will make it much easier to read your post and find something without having what looks like a ton of text since it can confuse ppl sometimes.

Offline Xavier the vampire

  • Jr. Member
  • **
  • Posts: 21
  • Gender: Male
  • Vampire is dark gift you really become vampire.
    • View Profile
    • www.youtube.com
Re: Assign fighting moves to keyboard.
« Reply #9 on: October 26, 2013, 03:05:56 PM »
What full preppy fighting style with ("Straf_Prep")?

Offline Xavier the vampire

  • Jr. Member
  • **
  • Posts: 21
  • Gender: Male
  • Vampire is dark gift you really become vampire.
    • View Profile
    • www.youtube.com
Re: Assign fighting moves to keyboard.
« Reply #10 on: October 27, 2013, 12:48:22 PM »
I want to know where is Johnny axe kick for Jimmy? I want to add Full Johnny Boss Semi Fighting Style for Jimmy. I am looking for Full Hal Style with Juri Grapple wrestling control keyboards please?

Offline GaryHarrington

  • A Guy Who Likes Open World and FPS Games
  • Sr. Member
  • ***
  • Posts: 515
  • Gender: Male
  • Just Love Bully and GTA ...Nothing Interested
    • View Profile
Re: Assign fighting moves to keyboard.
« Reply #11 on: October 27, 2013, 08:12:40 PM »
Thanks a lot! And where do I add the line to load the animation group and do I have to do the same with Johnny?

It should be under
Code: [Select]
F_MissionSetup = function().

Here are all the animations I added to my code.

 
Code: [Select]

  LoadAnimationGroup("NPC_Mascot")
  LoadAnimationGroup("J_Mascot")
 

what is the different NPC_Mascot and J_Mascot