- Joined
- Oct 10, 2009
- Messages
- 439
Righto, So I'm trying to make a "Homing missile" attack, which in this case is a golden beardfist. The problem is that it just does not work.
Now then, my logic may be worse than a mules ass (Not talking about its parents). So this is where I come to ask you guys for some help.
Basically, I'm trying to simulate a homing effect on this (Non mui) missile so that it slowly turns to face what it is hitting, while it is flying. I cannot use "Make unit face X over Y" for several different reasons, and unless you could allow it to loop around the unit and hit it several times, I'm afraid it wont do...
ANYWAY, ONWARDS WITH THE TRIGGERS!
Map is attached. Requires UMSWE
Now then, my logic may be worse than a mules ass (Not talking about its parents). So this is where I come to ask you guys for some help.
Basically, I'm trying to simulate a homing effect on this (Non mui) missile so that it slowly turns to face what it is hitting, while it is flying. I cannot use "Make unit face X over Y" for several different reasons, and unless you could allow it to loop around the unit and hit it several times, I'm afraid it wont do...
ANYWAY, ONWARDS WITH THE TRIGGERS!
Map is attached. Requires UMSWE
-
Golden Beardfist
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to (==) Golden Beardfist
-
Actions
-
Do Multiple ActionsFor each (Integer A) from 0 to 12, do (Actions)
-
Loop - Actions
- Set GBFint[(Integer A)] = 0
- Set GBFtarget[(Integer A)] = No unit
-
Loop - Actions
- Set GBFtarget[0] = (Triggering unit)
- Set GBFtarget[1] = (Target unit of ability being cast)
- Set Point[0] = (Position of GBFtarget[0])
- Set Point[1] = (Position of GBFtarget[1])
- Unit - Create 1 NeckFist for (Owner of (Triggering unit)) at Point[0] facing Point[1]
- Set GBFtarget[2] = (Last created unit)
- Custom script: call RemoveLocation(udg_Point[0])
- Custom script: call RemoveLocation(udg_Point[1])
- Trigger - Turn on Golden Bearfist Loop <gen>
-
Do Multiple ActionsFor each (Integer A) from 0 to 12, do (Actions)
-
Events
-
Golden Bearfist Loop
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
Set GBFint[0] = (GBFint[0] + 1)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- DBInt[1] Equal to (==) 150
- Then - Actions
-
Else - Actions
- Set GBFint[1] = (GBFint[1] + 1)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Set Point[0] = (Position of GBFtarget[0])
- Set Point[1] = (Position of GBFtarget[1])
-
Set Point[2] = (Position of GBFtarget[2])
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GBFint[2] Equal to (==) 0
- GBFint[3] Not equal to (!=) 3
-
Then - Actions
- Set Point[3] = (Point[2] offset by ((Real(GBFint[1])) / 4.00) towards (Facing of GBFtarget[2]) degrees)
- Set TempReal[0] = ((Angle from Point[3] to Point[1]) - (Facing of GBFtarget[2]))
-
Game - Display to (All players) the text: (String(TempReal[0]))
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple ConditionsOr - Any (Conditions) are true
-
Conditions
-
TempReal[0] Greater than (>) 0.00
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
- TempReal[0] Less than (<) -360.00
- TempReal[0] Greater than (>) -720.00
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
- TempReal[0] Less than (<) -1440.00
- TempReal[0] Greater than (>) -1800.00
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
TempReal[0] Greater than (>) 0.00
-
Conditions
-
Multiple ConditionsOr - Any (Conditions) are true
-
Then - Actions
- Unit - Move GBFtarget[2] instantly to Point[3], facing ((Facing of GBFtarget[2]) + 5.00) degrees
-
Else - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempReal[0] Less than (<) 0.00
-
Then - Actions
- Unit - Move GBFtarget[2] instantly to Point[3], facing ((Facing of GBFtarget[2]) - 5.00) degrees
-
Else - Actions
- Unit - Move GBFtarget[2] instantly to Point[3], facing (Facing of GBFtarget[2]) degrees
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Unit - Create 1 Flying Fist FX 1 for (Owner of GBFtarget[1]) at Point[3] facing Point[2]
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Distance between Point[3] and Point[1]) Less than or equal to (<=) 90.00
- GBFint[4] Greater than or equal to (>=) 360
-
Then - Actions
- Game - Display to (All players) the text: Pre
- Set GBFint[2] = 1
-
Else - Actions
- Set GBFint[4] = (GBFint[4] + ((Integer(((Real(GBFint[1])) / 3.00))) + 0))
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Custom script: call RemoveLocation(udg_Point[3])
-
Else - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GBFint[2] Equal to (==) 1
-
Then - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- GBFint[3] Equal to (==) 3
-
Then - Actions
- Game - Display to (All players) the text: End
- Unit - Remove GBFtarget[2] from the game
- Trigger - Turn off (This trigger)
-
Else - Actions
- Sound - Play MetalHeavyBashStone1 <gen> at 100.00% volume, located at Point[1] with Z offset 0.00
- Game - Display to (All players) the text: HIT!
- Set GBFint[2] = 0
- Set GBFint[3] = (GBFint[3] + 1)
- Game - Display to (All players) the text: (String(GBFint[3]))
- Set GBFint[4] = 0
- Unit - Cause GBFtarget[0] to damage GBFtarget[1], dealing 80.00 damage of attack type Spells and damage type Magic
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Custom script: call RemoveLocation(udg_Point[0])
- Custom script: call RemoveLocation(udg_Point[1])
- Custom script: call RemoveLocation(udg_Point[2])
-
Set GBFint[0] = (GBFint[0] + 1)
-
Events