- Joined
- Apr 5, 2013
- Messages
- 154
I have made a script for a missile launcher. But each time I fire it, my FPS gets reduced by 2?
-
Launch Rocket
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Missile Launcher (Neutral Hostile)
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) has an item of type Missile) Equal to True
-
-
Then - Actions
-
Trigger - Turn on MovingDatMissile <gen>
-
Set AKUNIT = (Triggering unit)
-
Sound - Play TinkerMissileLaunch1 <gen>
-
Custom script: call SetUnitAnimationByIndex(udg_AKUNIT, 151)
-
Animation - Queue AKUNIT's stand animation
-
Player - Add 5 to (Owner of (Triggering unit)) Food used
-
Set MissileFiringGuy[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
-
Item - Set charges remaining in (Item carried by (Triggering unit) of type Missile) to ((Charges remaining in (Item carried by (Triggering unit) of type Missile)) - 1)
-
Unit - Create 1 Missile Dummy for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) offset by 150.00 towards (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees) facing Default building facing degrees
-
Set MISSILE[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
-
Set WarheadLocation[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
-
-
Else - Actions
-
-
-
-
MovingDatMissile
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
-
Unit - Move MISSILE[(Integer A)] instantly to ((Position of MISSILE[(Integer A)]) offset by 40.00 towards (Angle from (Position of MISSILE[(Integer A)]) to WarheadLocation[(Integer A)]) degrees), facing WarheadLocation[(Integer A)]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Distance between (Position of MISSILE[(Integer A)]) and WarheadLocation[(Integer A)]) Less than or equal to 20.00) or ((Number of units in (Units within 75.00 of (Position of MISSILE[(Integer A)]))) Greater than 1)
-
-
Then - Actions
-
Unit Group - Pick every unit in (Units within 200.00 of (Position of MISSILE[(Integer A)])) and do (Actions)
-
Loop - Actions
-
Special Effect - Create a special effect at (Position of MISSILE[(Integer A)]) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Cause MissileFiringGuy[(Integer A)] to damage (Picked unit), dealing 195.00 damage of attack type Chaos and damage type Universal
-
Unit - Remove MISSILE[(Integer A)] from the game
-
Custom script: call RemoveLocation( udg_WarheadLocation[bj_forLoopAIndex])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Missile Dummy))) Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-
-
-