The problem occur rarely with this trigger (About 1 in 40-60) Not sure what happen. The Bullet should be moved periodically but sometimes it stop moving, not damage, and appear as it isn't there at all. (Max bullet is 3 but if there is one bullet stop moving, the bullet in the map will be 4)
Thank in advance (I can't solve it myself because the problem doesn't always occur)
Trigger:
- Shot Moving
- Events
- Time - BulletTimer expires
- Conditions
- Actions
- For each (Integer ShotLoopIndex) from 1 to ShotIndex, do (Actions)
- Loop - Actions
- Set BulletPoint = (Position of Shot[ShotLoopIndex])
- Set BulletPoint_Move = (BulletPoint offset by (Real((BulletSpeed / 25))) towards 90.00 degrees)
- Unit - Move Shot[ShotLoopIndex] instantly to BulletPoint_Move, facing 90.00 degrees
- Unit Group - Pick every unit in UndeadGroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between (Position of Shot[ShotLoopIndex]) and (Position of (Picked unit))) Less than or equal to 90.00
- ((Picked unit) is alive) Equal to True
- Then - Actions
- Unit - Remove Shot[ShotLoopIndex] from the game
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (Real(BulletDamage)))
- Set Bullet = (Bullet + 1)
- Special Effect - Create a special effect at BulletPoint_Move using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Set Shot[ShotLoopIndex] = Shot[ShotIndex]
- Set ShotIndex = (ShotIndex - 1)
- Set ShotLoopIndex = (ShotLoopIndex - 1)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Spawn Region <gen> contains Shot[ShotLoopIndex]) Equal to True
- Then - Actions
- Set Bullet = (Bullet + 1)
- Unit - Remove Shot[ShotLoopIndex] from the game
- Set Shot[ShotLoopIndex] = Shot[ShotIndex]
- Set ShotIndex = (ShotIndex - 1)
- Set ShotLoopIndex = (ShotLoopIndex - 1)
- Else - Actions
- If - Conditions
- Loop - Actions
- For each (Integer ShotLoopIndex) from 1 to ShotIndex, do (Actions)
- Events
Trigger:
- Shot
- Events
- Player - Player 1 (Red) Presses the Up Arrow key
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Bullet Greater than or equal to 1
- Then - Actions
- Set Bullet = (Bullet - 1)
- Animation - Play Surviving Sniper 0000 <gen>'s attack animation
- Set PointofSniper = (Position of Surviving Sniper 0000 <gen>)
- Set ShotIndex = (ShotIndex + 1)
- Unit - Order Surviving Sniper 0000 <gen> to Stop
- Unit - Make Surviving Sniper 0000 <gen> face 90.00 over 0.10 seconds
- Unit - Create 1 Dummy for Player 1 (Red) at PointofSniper facing 90.00 degrees
- Set Shot[ShotIndex] = (Last created unit)
- If (ShotIndex Equal to 1) then do (Countdown Timer - Start BulletTimer as a Repeating timer that will expire in 0.04 seconds) else do (Do nothing)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- Sniper Initialization
- Events
- Map initialization
- Conditions
- Actions
- Set BulletSpeed = 150
- Set BulletDamage = 1
- Set Bullet = 3
- Set PointofSniper = (Position of Surviving Sniper 0000 <gen>)
- Events
Thank in advance (I can't solve it myself because the problem doesn't always occur)