- Joined
- Nov 3, 2013
- Messages
- 989
Makeing a spell where caster target enemy and other units in front of caster get pushed back while caster charge forward to target.
When I got to the point where I made it so that it should affect units in a cone PBAoE instead of circle PBAoE it seems like it's smaller and slightly tilted, somehow the entire cone is shifted more to the left of the caster.
I don't get how [Snippet below] fails.
When I got to the point where I made it so that it should affect units in a cone PBAoE instead of circle PBAoE it seems like it's smaller and slightly tilted, somehow the entire cone is shifted more to the left of the caster.
I don't get how [Snippet below] fails.
-
-------- Check if target is within min and max angle --------
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- (Angle from Point_Caster to TempPoint_Target[1]) Greater than or equal to (Real_CasterFaceing - 90.00)
- (Angle from Point_Caster to TempPoint_Target[1]) Less than or equal to (Real_CasterFaceing + 90.00)
-
Conditions
-
And - All (Conditions) are true
-
If - Conditions
-
Ability Set Constants
-
Events
- Map initialization
- Conditions
-
Actions
- -------- How Often Tirgger will execute --------
- Set Real_PushFrequency = 0.05
- -------- Maximum push distance --------
- Set Real_PushMaxValue = 375.00
- -------- Push distance per trigger execution --------
- Set Real_PushDistancePerInterval = (Real_PushMaxValue x Real_PushFrequency)
- -------- Make loop use variable in event --------
- Trigger - Add to Ability Loop <gen> the event (Time - Every Real_PushFrequency seconds of game time)
-
Events
-
Ability
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to dsf
-
Actions
- -------- Caster Variables --------
- Set Unit_Caster = (Triggering unit)
- Set Point_Caster = (Position of Unit_Caster)
- Animation - Change Unit_Caster's animation speed to 200.00% of its original speed
- -------- Target Variables --------
- Set Unit_Target = (Target unit of ability being cast)
- Set TempPoint_Target[1] = (Position of Unit_Target)
- -------- Angle Between Caster & Target --------
- Set Real_CasterFaceing = (Angle from Point_Caster to TempPoint_Target[1])
- Custom script: call RemoveLocation(udg_TempPoint_Target[1])
- Trigger - Turn on Ability Loop <gen>
-
Events
-
Ability Loop
- Events
- Conditions
-
Actions
- -------- Set targets --------
- Set UnitGroup_Targets = (Units within (Real_PushMaxValue - Real_PushDistancePerInterval) of Point_Caster matching (((Matching unit) Not equal to Unit_Caster) and ((Matching unit) Not equal to Unit_Target)))
- -------- Move targets away from caster --------
-
Unit Group - Pick every unit in UnitGroup_Targets and do (Actions)
-
Loop - Actions
- -------- Unit from group --------
- Set TempUnit_Target = (Picked unit)
- -------- Current X and Y --------
- Set TempPoint_Target[1] = (Position of TempUnit_Target)
- -------- Check if target is within min and max angle --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
- (Angle from Point_Caster to TempPoint_Target[1]) Greater than or equal to (Real_CasterFaceing - 90.00)
- (Angle from Point_Caster to TempPoint_Target[1]) Less than or equal to (Real_CasterFaceing + 90.00)
-
Conditions
-
And - All (Conditions) are true
-
Then - Actions
- -------- Future X and Y --------
- Set TempPoint_Target[2] = (TempPoint_Target[1] offset by Real_PushDistancePerInterval towards (Angle from Point_Caster to TempPoint_Target[1]) degrees)
- -------- Future X as real for script later --------
- Set TempX_Target = (X of TempPoint_Target[2])
- -------- Future Y as real for script later --------
- Set TempY_Target = (Y of TempPoint_Target[2])
- -------- Remove location memory leaks --------
- Custom script: call RemoveLocation(udg_TempPoint_Target[1])
- Custom script: call RemoveLocation(udg_TempPoint_Target[2])
- -------- Change unit X and Y through custom script --------
- Custom script: call SetUnitX(udg_TempUnit_Target, udg_TempX_Target)
- Custom script: call SetUnitY(udg_TempUnit_Target, udg_TempY_Target)
- Special Effect - Create a special effect attached to the origin of TempUnit_Target using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
- Special Effect - Destroy (Last created special effect)
- Else - Actions
-
If - Conditions
-
Loop - Actions
- -------- Count to determine when spell is over --------
- Set Real_Count = (Real_Count + 1.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Real_Count Equal to (2.70 / Real_PushFrequency)
-
Then - Actions
- Set Real_Count = 0.00
- Animation - Change Unit_Caster's animation speed to 100.00% of its original speed
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
Last edited: