• 🏆 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] About angles errors

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2015
Messages
53
Hi everyone, i made a spell (with friend's help) that does:
Call 3 Lizards run to the target point, start from your back 400 distance. Deals damages to any enemies who block the lizards

It runs ok with 180 or 360 degrees (casting position):

11660072_854879744547050_2089814395_o.jpg



But it cause errors at this angle:

11701521_854879747880383_676002579_o.jpg



Here's my triggers, im still dont know about the angle-triggers, please help me :ogre_kawaii:



Main trigger:
  • Stamping Destruction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Stamping Destruction
    • Actions
      • Set SD_Caster = (Casting unit)
      • Set SD_Loc[0] = (Position of SD_Caster)
      • Set SD_Loc[1] = (Target point of ability being cast)
      • Set SD_Angle[1] = (Angle from SD_Loc[0] to SD_Loc[1])
      • -------- Set dummies spawn location (behind caster 400 range) --------
      • Set SD_Loc[2] = (SD_Loc[0] offset by -400.00 towards (SD_Angle[1] x -1.00) degrees)
      • Set SD_Loc[3] = (SD_Loc[2] offset by 200.00 towards (SD_Angle[1] + 90.00) degrees)
      • Set SD_Loc[4] = (SD_Loc[2] offset by 200.00 towards (SD_Angle[1] - 90.00) degrees)
      • Set SD_Distance = (Distance between SD_Loc[1] and SD_Loc[2])
      • Unit - Create 1 Stamping Destruction Dummy for (Owner of SD_Caster) at SD_Loc[2] facing SD_Angle[1] degrees
      • Set SD_Dummy[1] = (Last created unit)
      • Unit - Create 1 Stamping Destruction Dummy for (Owner of SD_Caster) at SD_Loc[3] facing SD_Angle[1] degrees
      • Set SD_Dummy[2] = (Last created unit)
      • Unit - Create 1 Stamping Destruction Dummy for (Owner of SD_Caster) at SD_Loc[4] facing SD_Angle[1] degrees
      • Set SD_Dummy[3] = (Last created unit)
      • Unit - Add Crow Form to SD_Dummy[1]
      • Unit - Add Crow Form to SD_Dummy[2]
      • Unit - Add Crow Form to SD_Dummy[3]
      • Unit - Remove Crow Form from SD_Dummy[1]
      • Unit - Remove Crow Form from SD_Dummy[2]
      • Unit - Remove Crow Form from SD_Dummy[3]
      • Unit Group - Remove all units from SD_Hit
      • Trigger - Turn on Stamping Destruction Move <gen>
      • Custom script: call RemoveLocation( udg_SD_Loc[0] )
      • Custom script: call RemoveLocation( udg_SD_Loc[1] )
      • Custom script: call RemoveLocation( udg_SD_Loc[2] )
      • Custom script: call RemoveLocation( udg_SD_Loc[3] )
      • Custom script: call RemoveLocation( udg_SD_Loc[4] )
Move trigger:
  • Stamping Destruction Move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • -------- Setup locations --------
      • Set SD_Loc[1] = (Position of SD_Dummy[1])
      • Set SD_Loc[2] = (Position of SD_Dummy[2])
      • Set SD_Loc[3] = (Position of SD_Dummy[3])
      • Set SD_Angle[2] = (Facing of SD_Dummy[1])
      • Set SD_Angle[3] = (Facing of SD_Dummy[2])
      • Set SD_Angle[4] = (Facing of SD_Dummy[3])
      • -------- Set point offset --------
      • Set SD_Loc[4] = (SD_Loc[1] offset by 10.00 towards SD_Angle[2] degrees)
      • Set SD_Loc[5] = (SD_Loc[2] offset by 10.00 towards SD_Angle[3] degrees)
      • Set SD_Loc[6] = (SD_Loc[3] offset by 10.00 towards SD_Angle[4] degrees)
      • -------- Move dummies --------
      • Unit - Move SD_Dummy[1] instantly to SD_Loc[4]
      • Unit - Move SD_Dummy[2] instantly to SD_Loc[5]
      • Unit - Move SD_Dummy[3] instantly to SD_Loc[6]
      • -------- -6 distance every 0.01s --------
      • Set SD_Distance = (SD_Distance - 6.00)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • SD_Distance Less than or equal to (<=) 0.00
          • Then - Actions
            • Unit - Kill SD_Dummy[1]
            • Unit - Kill SD_Dummy[2]
            • Unit - Kill SD_Dummy[3]
            • Trigger - Turn off (This trigger)
          • Else - Actions
            • -------- Pick around dummy 1 --------
            • Set SD_Group = (Units within 200.00 of SD_Loc[1] matching ((((Matching unit) is A structure) Equal to (==) False) and ((((Matching unit) is alive) Equal to (==) True) and ((((Matching unit) belongs to an enemy of (Owner of SD_Caster)) Equal to (==) True) and (((Matching uni
            • Unit Group - Pick every unit in SD_Group and do (Actions)
              • Loop - Actions
                • Unit - Cause SD_Caster to damage (Picked unit), dealing ((0.00 + (50.00 x (Real((Level of Stamping Destruction for SD_Caster))))) + (0.75 x (Real((Intelligence of SD_Caster (Include bonuses)))))) damage of attack type Spells and damage type Magic
                • Unit Group - Add (Picked unit) to SD_Hit
                • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                • Special Effect - Destroy (Last created special effect)
            • Custom script: call DestroyGroup( udg_SD_Group )
            • -------- Pick around dummy 2 --------
            • Set SD_Group = (Units within 200.00 of SD_Loc[2] matching ((((Matching unit) is A structure) Equal to (==) False) and ((((Matching unit) is alive) Equal to (==) True) and ((((Matching unit) belongs to an enemy of (Owner of SD_Caster)) Equal to (==) True) and (((Matching uni
            • Unit Group - Pick every unit in SD_Group and do (Actions)
              • Loop - Actions
                • Unit - Cause SD_Caster to damage (Picked unit), dealing ((0.00 + (50.00 x (Real((Level of Stamping Destruction for SD_Caster))))) + (0.75 x (Real((Intelligence of SD_Caster (Include bonuses)))))) damage of attack type Spells and damage type Magic
                • Unit Group - Add (Picked unit) to SD_Hit
                • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                • Special Effect - Destroy (Last created special effect)
            • Custom script: call DestroyGroup( udg_SD_Group )
            • -------- Pick around dummy 3 --------
            • Set SD_Group = (Units within 200.00 of SD_Loc[3] matching ((((Matching unit) is A structure) Equal to (==) False) and ((((Matching unit) is alive) Equal to (==) True) and ((((Matching unit) belongs to an enemy of (Owner of SD_Caster)) Equal to (==) True) and (((Matching uni
            • Unit Group - Pick every unit in SD_Group and do (Actions)
              • Loop - Actions
                • Unit - Cause SD_Caster to damage (Picked unit), dealing ((0.00 + (50.00 x (Real((Level of Stamping Destruction for SD_Caster))))) + (0.75 x (Real((Intelligence of SD_Caster (Include bonuses)))))) damage of attack type Spells and damage type Magic
                • Unit Group - Add (Picked unit) to SD_Hit
                • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                • Special Effect - Destroy (Last created special effect)
            • Custom script: call DestroyGroup( udg_SD_Group )
      • -------- remove point leak --------
      • Custom script: call RemoveLocation( udg_SD_Loc[0] )
      • Custom script: call RemoveLocation( udg_SD_Loc[1] )
      • Custom script: call RemoveLocation( udg_SD_Loc[2] )
      • Custom script: call RemoveLocation( udg_SD_Loc[3] )
      • Custom script: call RemoveLocation( udg_SD_Loc[4] )
      • Custom script: call RemoveLocation( udg_SD_Loc[5] )
      • Custom script: call RemoveLocation( udg_SD_Loc[6] )
 
Level 12
Joined
Nov 3, 2013
Messages
989
If I understood it right then you want it to always spawn behind the caster?

Either change the "* -1" with +/- 180 (like wiet all ready mentioned) or even more simple just take the locations in the opposite order and you won't have to alter the angle afterwards.

I.E. swap location 1 and 2: Set SD_Angle[1] = (Angle from SD_Loc[1] to SD_Loc[0])
 
Level 12
Joined
Nov 3, 2013
Messages
989
offset by -400 towards (SD_Angle[1] -180) degrees

XxzNryM.png

qQeoem6.png

Yep, you've made it pretty clear with the illustrations. +1.

Though I still think it's kind of pointless to +/-180 when you could just swap the input order of the locations to invert it. :p
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
But that doesnt matter :D
You just should know what you are doing when you create something.
When you do not know what you are doing, you need someone to hold your hand.

And they have to run into direction from caster to target point and they have to spawn in an offset towards -180 from that angle.
Rather use the same value and add -180 to it than use two times the calculation time of finding the angle.
 
Status
Not open for further replies.
Top