Delay Drop From Orbit?

Started by creeper killer, October 10, 2014, 02:32:10 AM

Previous topic - Next topic

creeper killer

I'm currently working on a script that drops allied CRPL cores from orbit after another core has done something (syncing through delay timing).
However, on mission start and before the script hits the "DropFromOrbit" statement, the cores are already on the ground and once the script does hit the drop form orbit statement, they essentially redeploy.
How do I Keep the cores off the ground at mission start while still having them drop from orbit a few seconds later?
Here's the code:
Spoiler
# Bunker.crpl
# Created on: 10/9/2014 4:01:53 PM
# ------------------------------------------

once
90 delay
CurrentCoords DropFromOrbit
200 -200 MakeRain
Self CONST_AMMO 0 SetUnitAttribute
Self CONST_HEALTH 10 SetUnitAttribute
Self CONST_CONNECTABLE TRUE SetUnitAttribute
Self CONST_MAXAMMO 51 SetUnitAttribute
Self CONST_CANREQUESTAMMO TRUE SetUnitAttribute
Self CONST_MAXHEALTH 10 SetUnitAttribute
Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute
Self CONST_HEALRATE .01 SetUnitAttribute
Self CONST_PACKETREQUESTDELAY 15 SetUnitAttribute
Self CONST_TAKEMAPSPACE TRUE SetUnitAttribute
Self CONST_CREATEPZ 0 SetUnitAttribute
Self CONST_DESTROYONDAMAGE TRUE SetUnitAttribute
Self CONST_DESTROYMODE 2 SetUnitAttribute
Self CONST_MAXAMMOAC 200 SetUnitAttribute
Self CONST_AMMOAC 200 SetUnitAttribute
Self CONST_REQUESTACPACKETS False SetUnitAttribute
SetUnitAttribute(self CONST_DESTROYONDAMAGE False)
SetUnitAttribute(self CONST_COUNTSFORVICTORY True)
90 delay
CreateEffect(11 CellToPixel(CurrentCoords) -1 2 2 0.01)
"UnitLand" PlaySound
endonce
if(GetCreeper(CurrentCoords) gt(0))
Self CONST_HEALTH GetUnitAttribute ->Health
<-Health .03 sub ->Health
Self CONST_HEALTH <-Health SetUnitAttribute
endif
if(GetUnitAttribute(Self CONST_HEALTH) .05 lt)
FailMission
Self 2 Destroy
endif
GetTimer2 eq0 if
3600 SetTimer2
endif
Self CONST_AMMO GetUnitAttribute 50 gte GetTimer2 900 gt and if
AscendToOrbit
90 delay
once
30 -40 MakeRain

endonce
endif
200 ->ACAMMO
if(<-ACAMMO 0 gt GetTimer1 eq0 and)
"CRPLCORE" CurrentCoords CreateUnit ->ACShell
<-ACShell "ACShell.crpl" AddScriptToUnit
"MortarFire" PlaySound
Self CONST_AMMOAC GetUnitAttribute ->ACAMMO
<-ACAMMO 1 sub ->ACAMMO
Self CONST_AMMOAC <-ACAMMO SetUnitAttribute
60 SetTimer1
endif
if(<-ACAMMO 0 gt CurrentCoords GetCreeper 0 gt and)
CurrentCoords -20 SetCreeper
Self CONST_AMMOAC GetUnitAttribute ->ACAMMO
<-ACAMMO 1 sub ->ACAMMO
Self CONST_AMMOAC <-ACAMMO SetUnitAttribute
endif
[close]
Quoteyou will be assimilated into the herd, resistance is futile
(picture's too big :( )
just though I'd let you guys know :)

Grayzzur

Do you need to keep them off the ground, or just invisible? Your "take map space" change also wouldn't take effect until after the delay, so there should be no indication the core is hiding on the map.

once
self "main" 255 255 255 0 SetImageColor
90 delay
self "main" 255 255 255 255 SetImageColor
CurrentCoords DropFromOrbit
.....
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

creeper killer

Quoteyou will be assimilated into the herd, resistance is futile
(picture's too big :( )
just though I'd let you guys know :)