Creeper World 3 CRPL Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

My own custom "Scout" Unit...

Go down

My own custom "Scout" Unit... Empty My own custom "Scout" Unit...

Post by Admin Tue Jun 13, 2017 9:27 pm

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... Very Happy
And, make it request Energy and Ammo packets. Smile


# 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)

Admin
Admin

Posts : 4
Join date : 2017-06-13

https://cw3maps-crpl.board-directory.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum