• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Bugs in system

Status
Not open for further replies.
Level 9
Joined
Aug 21, 2008
Messages
533
Ive made a knockback/jump etc system but from time to ime there are some bugs like: unit isnt knockbackedwhen it is exactly in 250 range, unit jumps to a different location, unit is knockbacked false way etc.:ugly:

Thats the main trigger:
  • knockbacking
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in getroffene_group and do (Actions)
        • Loop - Actions
          • Set point[1] = (Position of (Picked unit))
          • Set point[2] = (point[1] offset by knockbackspeed[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] towards richtungknockback[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] degrees)
          • Animation - Change (Picked unit) flying height to ((Current flying height of (Picked unit)) + changeflyght[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))]) at 9999999.00
          • Unit - Move (Picked unit) instantly to point[2]
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
          • Custom script: call RemoveLocation( udg_point[1] )
          • Custom script: call RemoveLocation( udg_point[2] )
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of (Picked unit)) Greater than or equal to flyghtchangrpoint[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))]
            • Then - Actions
              • Set changeflyght[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] = (changeflyght[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] - (changeflyght[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] x 2.00))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((String((Custom value of (Picked unit)))), 5, 7)))) Equal to 1
            • Then - Actions
              • Unit Group - Remove (Picked unit) from getroffene_group
              • Animation - Change (Picked unit) flying height to 0.00 at 1000000000.00
              • Unit - Turn collision for (Picked unit) On
            • Else - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
Thats jump:
  • jump
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shokwave jump
    • Actions
      • Set MUIzhler = (MUIzhler + 1)
      • Set point[1] = (Target point of ability being cast)
      • Set point[2] = (Position of (Triggering unit))
      • Unit - Set the custom value of (Triggering unit) to (Integer(((String(MUIzhler)) + (String(((Distance between point[1] and point[2]) / 30.00))))))
      • Set richtungknockback[(Integer((Substring((String((Custom value of (Triggering unit)))), 1, 4))))] = (Angle from point[2] to point[1])
      • Set knockbackspeed[(Integer((Substring((String((Custom value of (Triggering unit)))), 1, 4))))] = 30.00
      • Set changeflyght[(Integer((Substring((String((Custom value of (Triggering unit)))), 1, 4))))] = 30.00
      • Set flyghtchangrpoint[(Integer((Substring((String((Custom value of (Triggering unit)))), 1, 4))))] = ((Real((Substring((String((Custom value of (Triggering unit)))), 5, 7)))) x 15.00)
      • Unit - Add Sturmkrähengestalt to (Triggering unit)
      • Unit - Remove Sturmkrähengestalt from (Picked unit)
      • Unit - Turn collision for (Triggering unit) Off
      • Unit Group - Add (Triggering unit) to getroffene_group
      • Custom script: call RemoveLocation( udg_point[1] )
      • Custom script: call RemoveLocation( udg_point[2] )
Thats knockback based on clap:
  • knockpack triggers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kriegsdonner
    • Actions
      • Unit Group - Add all units of (Units within 250.00 of (Position of (Triggering unit)) matching (((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))) and (((Matching unit) is alive) Equal to True))) to geradegetroffenegroup
      • Unit Group - Pick every unit in geradegetroffenegroup and do (Actions)
        • Loop - Actions
          • Set point[1] = (Position of (Triggering unit))
          • Set point[2] = (Position of (Picked unit))
          • Set MUIzhler = (MUIzhler + 1)
          • Unit - Set the custom value of (Picked unit) to (Integer(((String(MUIzhler)) + 30)))
          • Set richtungknockback[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] = (Angle from point[1] to point[2])
          • Set knockbackspeed[(Integer((Substring((String((Custom value of (Picked unit)))), 1, 4))))] = 12.00
          • Set changeflyght[(Integer((Substring((String((Custom value of (Triggering unit)))), 1, 4))))] = 0.00
          • Custom script: call RemoveLocation( udg_point[1] )
          • Custom script: call RemoveLocation( udg_point[2] )
          • Unit Group - Add (Picked unit) to getroffene_group
          • Unit Group - Remove (Picked unit) from geradegetroffenegroup
      • Custom script: call DestroyGroup( udg_geradegetroffenegroup)
and this is trow:
  • toss
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Throw enemy [z]
    • Actions
      • Set MUIzhler = (MUIzhler + 1)
      • Set point[1] = (Position of (Target unit of ability being cast))
      • Set point[2] = (Position of (Triggering unit))
      • Unit - Set the custom value of (Target unit of ability being cast) to (Integer(((String(MUIzhler)) + (String(25.00)))))
      • Set richtungknockback[(Integer((Substring((String((Custom value of (Target unit of ability being cast)))), 1, 4))))] = (Angle from point[2] to point[1])
      • Set knockbackspeed[(Integer((Substring((String((Custom value of (Target unit of ability being cast)))), 1, 4))))] = 25.00
      • Set changeflyght[(Integer((Substring((String((Custom value of (Target unit of ability being cast)))), 1, 4))))] = 25.00
      • Set flyghtchangrpoint[(Integer((Substring((String((Custom value of (Target unit of ability being cast)))), 1, 4))))] = ((Real((Substring((String((Custom value of (Target unit of ability being cast)))), 5, 7)))) x 15.00)
      • Unit - Add Sturmkrähengestalt to (Target unit of ability being cast)
      • Unit - Turn collision for (Target unit of ability being cast) Off
      • Unit Group - Add (Target unit of ability being cast) to getroffene_group
      • Custom script: call RemoveLocation( udg_point[1] )
      • Custom script: call RemoveLocation( udg_point[2] )
DO someone see the mistake?:sad:
 
Status
Not open for further replies.
Top