- Joined
- Jan 17, 2009
- Messages
- 371
Hi,
I am making a projectile system but i cannot find out how to make my projectiles adjust to the terrain. For example, if i fire my projectile up a hill it will not run into the hill, it will simply walk over it as if were a unit... Can someone help me fix this..
I am making a projectile system but i cannot find out how to make my projectiles adjust to the terrain. For example, if i fire my projectile up a hill it will not run into the hill, it will simply walk over it as if were a unit... Can someone help me fix this..
-
Right Click
-

Events
-


Unit - A unit Is issued an order targeting a point
-


Unit - A unit Is issued an order targeting an object
-
-

Conditions
-


(Issued order) Equal to (Order(smart))
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




ProjectileNumber Equal to 600
-
-



Then - Actions
-




Set ProjectileNumber = 0
-
-



Else - Actions
-
-


Set ProjectileNumber = (ProjectileNumber + 1)
-


Set Temp_Point[ProjectileNumber] = (Position of Firing_Unit[(Player number of (Triggering player))])
-


Unit - Create 1 Unit_Type[(Player number of (Triggering player))] for (Triggering player) at Temp_Point[ProjectileNumber] facing (Facing of Firing_Unit[(Player number of (Triggering player))]) degrees
-


Set Projectiles[ProjectileNumber] = (Last created unit)
-


Custom script: call RemoveLocation(udg_Temp_Point[udg_ProjectileNumber])
-
-
-
Projectiles
-

Events
-


Time - Every 0.02 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer A) from 1 to 600, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Projectiles[(Integer A)] is alive) Equal to True
-
-





Then - Actions
-






Set Temp_Point[(Integer A)] = (Position of Projectiles[(Integer A)])
-






Set Temp_Point2[(Integer A)] = (Temp_Point[(Integer A)] offset by ProjectileSpeed[(Player number of (Owner of Projectiles[(Integer A)]))] towards (Facing of Projectiles[(Integer A)]) degrees)
-






Set ProjectileRegions[(Integer A)] = (Region centered at Temp_Point[(Integer A)] with size (96.00, 96.00))
-






Unit - Move Projectiles[(Integer A)] instantly to Temp_Point2[(Integer A)]
-






Custom script: call RemoveLocation(udg_Temp_Point[GetForLoopIndexA()])
-






Custom script: call RemoveLocation(udg_Temp_Point2[GetForLoopIndexA()])
-






Destructible - Pick every destructible in ProjectileRegions[(Integer A)] and do (Actions)
-







Loop - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(Destructible-type of (Picked destructible)) Equal to (Destructible-type of (Picked destructible))
-
-









Then - Actions
-










Unit - Kill Projectiles[(Integer A)]
-
-









Else - Actions
-
-
-
-






Set LoopCounter[(Integer A)] = (LoopCounter[(Integer A)] + 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








LoopCounter[(Integer A)] Equal to Projectile_Distance[(Player number of (Owner of Projectiles[(Integer A)]))]
-
-







Then - Actions
-








Unit - Kill Projectiles[(Integer A)]
-








Set LoopCounter[(Integer A)] = 0
-
-







Else - Actions
-
-






Set Unit_Group[(Integer A)] = (Units in ProjectileRegions[(Integer A)])
-






Unit Group - Pick every unit in (Units in ProjectileRegions[(Integer A)]) and do (Actions)
-







Loop - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










And - All (Conditions) are true
-











Conditions
-












((Picked unit) belongs to an ally of (Owner of Projectiles[(Integer A)])) Equal to False
-












(Life of (Picked unit)) Greater than or equal to 1.00
-
-
-
-









Then - Actions
-










Unit - Cause Projectiles[(Integer A)] to damage (Picked unit), dealing Projectile_Damage[(Player number of (Owner of Projectiles[(Integer A)]))] damage of attack type Normal and damage type Normal
-










Unit - Kill Projectiles[(Integer A)]
-










Set LoopCounter[(Integer A)] = 0
-
-









Else - Actions
-
-
-
-






Custom script: call RemoveRect(udg_ProjectileRegions[GetForLoopIndexA()])
-






Custom script: call DestroyGroup(udg_Unit_Group[GetForLoopIndexA()])
-
-





Else - Actions
-
-
-
-
-

