My own custom "Scout" Unit...
Page 1 of 1
My own custom "Scout" Unit...
Wait, I did finally manage to make it! I will upload the image and the code! (Put the Bertha.crpl to the CRPLCore, and dont attact the Bullet.crpl to anyting, just leave it there, put on the CRPLCore any image you want...
And, make it request Energy and Ammo packets.
# Bertha.crpl
# Created on: 6/12/2017 2:42:36 PM
# ------------------------------------------
once
Self CONST_MAXAMMO 250 SetUnitAttribute #Sets maximum ammo
Self CONST_AMMO 0 SetUnitAttribute #Sets ammo to 0
Self CONST_CONNECTABLE True SetUnitAttribute #Makes sure unit can connect to collectors
Self CONST_SHOWAMMOBAR True SetUnitAttribute #Shows the ammo bar for the unit
0 SetTimer0 #Sets timer0 to 0 Timers are more useful than delays because they do not "freeze" the core
endonce
GetTimer0 eq0 if #Wait till the timer is at 0
Self CONST_AMMO GetUnitAttribute ->Ammo #Check how much ammo it has
<-Ammo 250 gte if #Check and see if there is atleast 100 ammo in it's ammo store
<-Ammo 250 sub ->Ammo #Subtract the total ammo supply by 100
CreateUnit("CRPLCore" CurrentCoords) ->Bullet
AddScriptToUnit(<-Bullet "Bullet.crpl")
Self CONST_AMMO <-Ammo SetUnitAttribute #Sets the ammo to the amount of ammo that it has from the subtractor
endif
endif
# Bullet.crpl
# Created on: 6/12/2017 3:10:38 PM
# ------------------------------------------
Self CONST_CREATEPZ 0 SetUnitAttribute
GetDeepestCreeperCell SetCurrentCoords
CurrentCoords -2500 AddCreeper
Destroy(self 3)
And, make it request Energy and Ammo packets.
# Bertha.crpl
# Created on: 6/12/2017 2:42:36 PM
# ------------------------------------------
once
Self CONST_MAXAMMO 250 SetUnitAttribute #Sets maximum ammo
Self CONST_AMMO 0 SetUnitAttribute #Sets ammo to 0
Self CONST_CONNECTABLE True SetUnitAttribute #Makes sure unit can connect to collectors
Self CONST_SHOWAMMOBAR True SetUnitAttribute #Shows the ammo bar for the unit
0 SetTimer0 #Sets timer0 to 0 Timers are more useful than delays because they do not "freeze" the core
endonce
GetTimer0 eq0 if #Wait till the timer is at 0
Self CONST_AMMO GetUnitAttribute ->Ammo #Check how much ammo it has
<-Ammo 250 gte if #Check and see if there is atleast 100 ammo in it's ammo store
<-Ammo 250 sub ->Ammo #Subtract the total ammo supply by 100
CreateUnit("CRPLCore" CurrentCoords) ->Bullet
AddScriptToUnit(<-Bullet "Bullet.crpl")
Self CONST_AMMO <-Ammo SetUnitAttribute #Sets the ammo to the amount of ammo that it has from the subtractor
endif
endif
# Bullet.crpl
# Created on: 6/12/2017 3:10:38 PM
# ------------------------------------------
Self CONST_CREATEPZ 0 SetUnitAttribute
GetDeepestCreeperCell SetCurrentCoords
CurrentCoords -2500 AddCreeper
Destroy(self 3)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|