• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Trigger] A buggy/non-working dash spell

Status
Not open for further replies.
Never mind... I fixed it.

[trigger=Casting]
Charge
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Charge
Actions
Set p2 = (Target point of ability being cast)
Set Dat_C_Index = (Dat_C_Index + 1)
Set Dat_C_Caster[Dat_C_Index] = (Triggering unit)
Set p = (Position of Dat_C_Caster[Dat_C_Index])
Set Dat_C_Timer[Dat_C_Index] = 90
Set Dat_C_Angle[Dat_C_Index] = (Angle from p to p2)
Unit - Add Feet SFX Charging to Dat_C_Caster[Dat_C_Index]
Custom script: call RemoveLocation(udg_p)
Custom script: call RemoveLocation(udg_p2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Dat_C_Index Equal to 1
Then - Actions
Trigger - Turn on Charge Loop <gen>
Else - Actions
[/trigger]
[trigger=Loop]
Charge Loop
Events
Time - dattimer expires
Conditions
Actions
For each (Integer Dat_C_Loop) from 1 to Dat_C_Index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Dat_C_Timer[Dat_C_Loop] Less than or equal to 0
Then - Actions
Unit - Remove Feet SFX Charging from Dat_C_Caster[Dat_C_Loop]
Set Dat_C_Caster[Dat_C_Loop] = Dat_C_Caster[Dat_C_Index]
Set Dat_C_Caster[Dat_C_Index] = No unit
Set Dat_C_Timer[Dat_C_Loop] = Dat_C_Timer[Dat_C_Index]
Set Dat_C_Angle[Dat_C_Loop] = Dat_C_Angle[Dat_C_Index]
Set Dat_C_Index = (Dat_C_Index - 1)
Set Dat_C_Loop = (Dat_C_Loop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Dat_C_Index Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Set Dat_C_Timer[Dat_C_Loop] = (Dat_C_Timer[Dat_C_Loop] - 1)
Set Dat_C_Point_Private = (Position of Dat_C_Caster[Dat_C_Loop])
Special Effect - Create a special effect at Dat_C_Point_Private using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Dat_C_Point_Private)
Custom script: call SetUnitX(udg_Dat_C_Caster[udg_Dat_C_Loop], GetUnitX(udg_Dat_C_Caster[udg_Dat_C_Loop]) + 50 * Cos(udg_Dat_C_Angle[udg_Dat_C_Loop]) * bj_DEGTORAD)
Custom script: call SetUnitY(udg_Dat_C_Caster[udg_Dat_C_Loop], GetUnitY(udg_Dat_C_Caster[udg_Dat_C_Loop]) + 50 * Sin(udg_Dat_C_Angle[udg_Dat_C_Loop]) * bj_DEGTORAD)
[/trigger]


The timer event is also working fine and is started in another trigger so it can't be because there is no timer running. The trigger isn't turned off either.

The problem is the unit doesn't move correctly as well it doesn't move correctly to the target point. It moves too slow to some other angle.


For anyone wondering what the fix was... It was the following. Thanks for reading.

[trigger=]
Charge
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Charge
Actions
Set p2 = (Target point of ability being cast)
Set Dat_C_Index = (Dat_C_Index + 1)
Set Dat_C_Caster[Dat_C_Index] = (Triggering unit)
Set p = (Position of Dat_C_Caster[Dat_C_Index])
Set Dat_C_Timer[Dat_C_Index] = 90
Set Dat_C_Angle[Dat_C_Index] = (Angle from p to p2)
Set Dat_C_Speed[Dat_C_Index] = 35.00
Set Dat_C_X[Dat_C_Index] = (Dat_C_Speed[Dat_C_Index] x (Cos(Dat_C_Angle[Dat_C_Index])))
Set Dat_C_Y[Dat_C_Index] = (Dat_C_Speed[Dat_C_Index] x (Sin(Dat_C_Angle[Dat_C_Index])))
Unit - Add Feet SFX Charging to Dat_C_Caster[Dat_C_Index]
Custom script: call RemoveLocation(udg_p)
Custom script: call RemoveLocation(udg_p2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Dat_C_Index Equal to 1
Then - Actions
Trigger - Turn on Charge Loop <gen>
Else - Actions
[/trigger]
[trigger=]
Charge Loop
Events
Time - dattimer expires
Conditions
Actions
For each (Integer Dat_C_Loop) from 1 to Dat_C_Index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Dat_C_Timer[Dat_C_Loop] Less than or equal to 0
Dat_C_Speed[Dat_C_Loop] Less than or equal to 0.00
Then - Actions
Unit - Remove Feet SFX Charging from Dat_C_Caster[Dat_C_Loop]
Set Dat_C_Caster[Dat_C_Loop] = Dat_C_Caster[Dat_C_Index]
Set Dat_C_Caster[Dat_C_Index] = No unit
Set Dat_C_Timer[Dat_C_Loop] = Dat_C_Timer[Dat_C_Index]
Set Dat_C_Angle[Dat_C_Loop] = Dat_C_Angle[Dat_C_Index]
Set Dat_C_Index = (Dat_C_Index - 1)
Set Dat_C_Loop = (Dat_C_Loop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Dat_C_Index Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Set Dat_C_Timer[Dat_C_Loop] = (Dat_C_Timer[Dat_C_Loop] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 2) Equal to 1
Then - Actions
Set Dat_C_Point_Private = (Position of Dat_C_Caster[Dat_C_Loop])
Special Effect - Create a special effect at Dat_C_Point_Private using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Dat_C_Point_Private)
Else - Actions
Set Dat_C_Speed[Dat_C_Loop] = (Dat_C_Speed[Dat_C_Loop] - 1.00)
Set Dat_C_Angle[Dat_C_Loop] = (Atan2(Dat_C_Y[Dat_C_Loop], Dat_C_X[Dat_C_Loop]))
Set Dat_C_X[Dat_C_Loop] = (Dat_C_Speed[Dat_C_Loop] x (Cos(Dat_C_Angle[Dat_C_Loop])))
Set Dat_C_Y[Dat_C_Loop] = (Dat_C_Speed[Dat_C_Loop] x (Sin(Dat_C_Angle[Dat_C_Loop])))
Custom script: call SetUnitX(udg_Dat_C_Caster[udg_Dat_C_Loop], GetUnitX(udg_Dat_C_Caster[udg_Dat_C_Loop]) + udg_Dat_C_X[udg_Dat_C_Loop] )
Custom script: call SetUnitY(udg_Dat_C_Caster[udg_Dat_C_Loop], GetUnitY(udg_Dat_C_Caster[udg_Dat_C_Loop]) + udg_Dat_C_Y[udg_Dat_C_Loop] )
[/trigger]


Yes I know I got some indexing stuff to fix as well. Though at least the movement is resolved. =)
 
Last edited:
Status
Not open for further replies.
Top