- Joined
- Dec 6, 2007
- Messages
- 233
i'm attempting to create a homing missile using my projectile system. To get the missile to change direction, i'm using the function
Partial trigger for projectile movement:
I also have another strange problem, that may be linked to the one above. The spawn trigger for the homing missile is this:
-
Set Temp_Real = (Angle from Missile_Point3 to Temp_Unit_Loc)
Partial trigger for projectile movement:
-
missile launcher shell
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Missile_Shell and do (Actions)
-
Loop - Actions
-
Set Missile_Unit = (Picked unit)
-
Set Missile_Point3 = (Position of Missile_Unit)
-
Set Temp_Unit_Loc = (Position of (Load Missile_Target of (Key Missile_Unit) in Missile_Target_Hash))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Angle from Missile_Point3 to Temp_Unit_Loc) Less than or equal to 30.00
-
(Angle from Missile_Point3 to Temp_Unit_Loc) Greater than or equal to -30.00
-
-
-
-
Then - Actions
-
Set Temp_Real = (Angle from Missile_Point3 to Temp_Unit_Loc)
-
-
Else - Actions
-
Set Temp_Real = (30.00 x (Sign((Angle from Missile_Point3 to Temp_Unit_Loc))))
-
-
-
Set Missile_Point4 = (Missile_Point3 offset by 50.00 towards ((Facing of (Picked unit)) + Temp_Real) degrees)
-
Custom script: call RemoveLocation(udg_Temp_Unit_Loc)
-
Unit - Move (Picked unit) instantly to Missile_Point4
-
-
-
-
I also have another strange problem, that may be linked to the one above. The spawn trigger for the homing missile is this:
-
missile launcher
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
(Unit-type of (Attacking unit)) Equal to Missile Launcher
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Attacking unit)) Equal to Player 1 (Red)
-
-
Then - Actions
-
Set Shooter_Owner = Player 11 (Dark Green)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Attacking unit)) Equal to Player 2 (Blue)
-
-
Then - Actions
-
Set Shooter_Owner = Player 12 (Brown)
-
-
Else - Actions
-
-
-
-
Set Missile_Point1 = (Position of (Attacking unit))
-
Set Missile_Point3 = (Position of (Triggering unit))
-
Set Missile_Point2 = (Missile_Point1 offset by 0.00 towards ((Facing of (Attacking unit)) + 90.00) degrees)
-
Unit - Create 1 Dummy Missile for Shooter_Owner at Missile_Point2 facing Missile_Point3
-
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
-
Unit Group - Add (Last created unit) to Missile_Shell
-
Hashtable - Save Handle Of(Triggering unit) as Missile_Target of (Key (Last created unit)) in Missile_Target_Hash
-
Custom script: call RemoveLocation(udg_Missile_Point2)
-
Custom script: call RemoveLocation(udg_Missile_Point1)
-
Custom script: call RemoveLocation(udg_Missile_Point3)
-
Trigger - Turn on missile launcher shell <gen>
-
-