Bully-Board

Bully Modding Section => Modding Questions/Help => Topic started by: UmaruChan223 on March 23, 2022, 01:32:38 AM

Title: Restore beta moves
Post by: UmaruChan223 on March 23, 2022, 01:32:38 AM
I want to restore some kind of beta or unused moves such as tornado kick for G_Johnny or shoulder barge for J_Melee
Pls help people
Title: Re: Restore beta moves
Post by: J_Striker_A on March 23, 2022, 12:29:43 PM
"/Global/G_Johnny/Default_KEY/RisingAttacks/HeavyAttacks/RisingAttacks", "Act/Anim/G_Johnny.act"(tornado Kick)
"/Global/J_Melee_A/Offense/Medium/Strikes/Unblockable/ShoulderButt", "act/anim/J_Melee_A.act"(shoulder Barge)
Title: Re: Restore beta moves
Post by: Altamurenza on March 23, 2022, 09:49:01 PM
You can use the code provided by J_Striker_A on this script, you may also change the code to suit your needs.
BTW.. this is only for Johnny:
Code: [Select]
X, Y, Z = PlayerGetPosXYZ()

if PedIsModel(ped, 23) then
  if PedMePlaying(ped, "Default_KEY") then
    if not PedIsPlaying(ped, "/Global/G_Johnny", true) then
      PedSetActionTree(ped, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
    end
   
    if PedIsValid(PedGetTargetPed(ped)) and PedIsInCombat(ped) then
      local PX, PY, PZ = PedGetPosXYZ(ped)
      if math.abs(X - PX) + math.abs(Y - PY) + math.abs(Z - PZ) <= 2.0 and math.random(1, 100) < 5 then
        PedSetActionNode(ped, node, file) -- replace node and file with J_Striker_A's action nodes or your own ones
      end
    end
  end
end

That is how you can trigger NPC to do a custom attack animation simply and looks naturally. The chance of doing that animation is 5% (math.random(1, 100) < 5), i personally don't recommend you to set the chance higher than 20. Otherwise, it will be his favorite moves :laugh:.

Disclaimer: I did not test the code, but it was modified according to the attached picture.
Title: Re: Restore beta moves
Post by: battlecats on April 13, 2022, 07:57:15 PM
You can also add PedMePlaying(ped,"StrafeIdle") on the "if PedIsValid(PedGetTargetPed(ped)) and PedIsInCombat(ped) then" line to make it so they only use the attack when doing their strafe idle, which is when the ai usually attacks.