Broken Code - Can I get some help?

Started by flareboy127, November 15, 2015, 02:11:25 AM

Previous topic - Next topic

flareboy127

Im attempting to create a unit that will fire Mass Artifacts at random spots at the map every 45 seconds. This unit also emits creeper when units come near it. If you get close enough to it, you can connect it to your network and send it up into orbit, where it will stay for a bit before coming back down.
Whats working:
-Emitting Creeper
-Firing the Mass Artifacts
-Sending the pod back up into orbit
Whats not working:
-Removing the ammo count from the tower (This causes the tower to come back down and almost instantly go back up)
-A Delay from when the object goes up to when it comes back down (If i use [frames] Delay the tower does not come back down)

# Unit1.crpl
# Created on: 11/15/2015 1:06:22 AM BY: flareboy127
#Orbital Creeper Cannon With recall ability
# ------------------------------------------
#Orbital Cannon
GetTimer0 eq0 if
FireAoo("MASS" RandCoords)
1350 SetTimer0
endif
#Creeper Emiter
CurrentCoords 400 GetUnitCountInRange if
GetTimer2 eq0 if
CurrentCoords 20 AddCreeper
60 SetTimer2
endif
endif
#*Broken* Recall Ability
Self CONST_REQUESTPACKETS 1 SetUnitAttribute
Self CONST_MAXAMMO 50 SetUnitAttribute
Self CONST_SHOWAMMOBAR SetUnitAttribute
Self CONST_AMMO GetUnitAttribute 50 eq if
AscendToOrbit
#10 in game minute delay
18000 Delay
#Having problems here setting ammo value back to zero, object keeps flying back up into orbit and coming back down, but it never stays and restarts the proccess
Self CONST_AMMO 0 SetUnitAttribute
RandCoords DropFromOrbit
endif
NMASDA - National Missile and Atomic Science Development Association - CW3 Post your scores to the group NMASDA today!

teknotiss

can't help personally, but this forum
http://knucklecracker.com/forums/index.php?board=25.0
might be more appropriate!
hope someone can get you sorted!  8)
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

Grayzzur

AscendToOrbit takes the unit out of play, effectively destroying it.

You need a 2nd hidden manager CRPLCORE to create a new unit to "bring it back."
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker