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


Author Topic: Modifying Hitboxes  (Read 3319 times)

0 Members and 1 Guest are viewing this topic.

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Modifying Hitboxes
« on: July 24, 2021, 12:58:23 PM »
Where/how would I edit things like the size of certain hitboxes on attacks?

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #1 on: July 28, 2021, 07:32:05 AM »
It's only can change HitTree ,for example,J_Striker_a second punch it's hard to hit PED with PLAYER Model ,then you can change the first punch so that the second punch can hit the PED
Code: [Select]

    for NPC,ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
  if PedIsPlaying(gplayer, "/Global/J_Striker_A/Offense/Short/Strikes/LightAttacks", true) and not PedIsPlaying(gplayer, "/Global/J_Striker_A/Offense/Short/Strikes/LightAttacks/JAB/Elbow/HeavyAttacks", true) and PedGetWhoHitMeLast(ped) == gPlayer then
  if PedIsPlaying(ped, "/Global/HitTree/Standing/Melee/Generic/Straight/HEADJAB", true) then
PedSetActionNode(ped, "/Global/HitTree/Standing/Melee/Unique/SACKED/Front", "act/anim/HitTree.act")
  PedSetHealth(ped, PedGetHealth(ped) + 10 * PedGetDamageGivenMultiplier(gPlayer, 2))
  Wait(0)
  SoundStopCurrentSpeechEvent(ped)
  end
  end
end
« Last Edit: July 28, 2021, 07:33:53 AM by mhdt »

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #2 on: July 29, 2021, 09:05:45 AM »
The video below demonstrates the issue i'm trying to prevent.

https://youtu.be/7cPGF6jvDYY

I wanted to make fighting the preps more about baiting and countering their dodges, but a lot of the attacks in the P_Striker_B moveset have longer range than they should according to the visuals. These issues persist without them doing the dodges prior, and at any framerate. If there is a way to prevent this it'd be really helpful. even if it's impossible to modify the size of the hitboxes directly. A way to disable the hitbox if the player is a minimum distance away or something of similar effect would work too.

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #3 on: July 29, 2021, 08:27:07 PM »
If allowed disable hitbox, you can clear the hit distance after being hit by Preppy at a certain distance so that Preppy  through you, but I don’t know the exact distance, so you have to test this number yourself.  (NUMBER)
Code: [Select]

  for NPC,ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do      
if PedIsValid(PedGetTargetPed(ped)) and (PedIsPlaying(ped"/Global/P_Striker_B/Offense/Short/Strikes/HeavyAttacks/Hook2", true) or PedIsPlaying(gplayer,"/Global/P_Striker_B/Offense/Short/Grapples/HeavyAttacks/Catch_Throw",true)) and DistanceBetweenPeds2D(PedGetTargetPed(ped), ped) >= NUMBER and PedIsHit(PedGetTargetPed(ped),true) then
      PedClearHitRecord(PedGetTargetPed(ped))

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #4 on: July 30, 2021, 05:12:10 PM »
So how/where do I put this in order to get it working? I just downloaded all the stuff for script modifying, but I have no idea where to start with something like this.

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #5 on: July 30, 2021, 06:58:40 PM »

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #6 on: July 30, 2021, 09:59:20 PM »
it's giving me
luac: luascript.lua:3: `end' expected (to close `if' at line 2) near `<eof>'
when trying to compile

edit: figured it out, but it doesn't seem to be working

    for NPC,ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do               
if PedIsValid(PedGetTargetPed(ped)) and (PedIsPlaying(ped"/Global/P_Striker_B/Offense/Short/Strikes/HeavyAttacks/Hook2", true) or PedIsPlaying(gplayer,"/Global/P_Striker_B/Offense/Short/Grapples/HeavyAttacks/Catch_Throw",true)) and DistanceBetweenPeds2D(PedGetTargetPed(ped), ped) >= 1 and PedIsHit(PedGetTargetPed(ped),true) then
            PedClearHitRecord(PedGetTargetPed(ped))
   end
end
« Last Edit: July 30, 2021, 10:34:13 PM by Velindian »

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #7 on: August 01, 2021, 06:02:03 AM »
If not, you can change the pedcleanhitrecord command to PedSetActionNode(PedGetTargetPed(ped),"/Global","Act/Globals.act")

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #8 on: August 06, 2021, 01:08:31 AM »
I decided to just try and give jimmy a dodge. However I'm not 100% certain how to make him do actions when a button is pressed.
If I could find  a Lua scripting tutorial for this kind of thing exactly it'd be helpful. all i ahve so far is somethin i pieced together from what i've read so far and reading a .lur file through HxD.

if PedGetTargetPed and BodyGuard and IsButtonPressed(7,0) then
   LoadAnimationGroup("P_Grappler") ExecuteActionNode(gPlayer, "/Global/P_Grappler_A/Defense/Evade/EvadeBack/Evade", "Act/Anim/P_Grappler_A.act")

Pretty sure I'm missing some stuff though. Essentially I want jimmy to dodge when the Sprint button is pressed if the enemy is in an aggressive state and Jimmy is locked on.

Edit: now by using
  if IsButtonPressed(10,0) and IsButtonPressed(7,0) then
    LoadAnimationGroup("P_Striker") ExecuteActionNode(gPlayer, "/Global/P_Striker_B/Defense/Evade/EvadeBack/EvadeBack", "Globals/P_Striker_B.act")

I'm able to dodge, but now i just need to figure out how to disable it when not blocking, during grapples, while in hitstun, and while knocked down.
« Last Edit: August 06, 2021, 04:30:00 AM by Velindian »

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #9 on: August 08, 2021, 04:39:50 AM »
Just add "PedMePlaying(gplayer,"Default_KEY") and not PedMePlaying(gplayer, "Block")"
ps: I don’t make sure that the Block player owns the node, I only know that this Block is genuine for Ped.

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #10 on: August 08, 2021, 05:01:25 PM »
It works now, but I want it to be doable during guard break as well. Also to only occur if the player is in combat since Jimmy now ducks every time he gives people a positive greeting.
« Last Edit: August 08, 2021, 05:21:50 PM by Velindian »

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Modifying Hitboxes
« Reply #11 on: August 09, 2021, 09:33:59 PM »
add
Code: [Select]
or (PedIsValid(PedGetTargetPed()) and (PedIsPlaying(PedGetTargetPed(), "/Global/P_Striker_B/Offense/Short/NonCombatActions/Taunts",true) or PedIsInCombat(PedGetTargetPed())))
« Last Edit: August 09, 2021, 09:37:39 PM by mhdt »

Offline Velindian

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Modifying Hitboxes
« Reply #12 on: August 10, 2021, 04:13:44 AM »
Tanks, I got it working using   

if PedMePlaying(gplayer,"Default_KEY") and not PedMePlaying(gplayer, "Block") and IsButtonPressed(10,0) and IsButtonPressed(7,0) and PedIsInCombat(PedGetTargetPed())then