Standard Unit Scripts?

Started by syth9, January 21, 2015, 03:29:01 PM

Previous topic - Next topic

syth9

I've been coding for a while now and I keep finding barriers that I have to overcome. I usually find a way to fix it myself, but it has occurred to me many times that the problem could be easily solved if I had access to the scripts for the units that come built in to the game, such as Mortar, Runner, Spore, Thor, etc.
Does anyone know how I could get access to (or even just get a look at) the script for the enemies and the players' units?

J

The standard units are hard-coded in the game and are not made with CRPL. If you want scripts for the spore tower and emitter you can take a look at the PlayAsCreeper template. A creeper cannon shooting at player units can be found in the chimera alpha map, there's a wiki page showing you how to get scripts out of a map. I can't help you with the other units, but someone else might be able to do so.

edit: Welcome to the forums  :)

syth9

Yes, just after posting this it occurred to me that nothing else is coded in CRPL while I was reading about CRPLcores and connecting to the player's energy network.
Perhaps you could help me with one of my biggest problems:
I want my CRPLcore to make a sound when it does a given action - change terrain height, grow digitalis, release creeper, move, etc. However, the PlaySound command plays the specified sound regardless of whether the core is on screen (as opposed to mortars, cannons, etc.). I found a command GetScreenPosition that returns two numbers, but they do not appear to be the X,Y coordinates or help me to tell when the core is on screen. Can you tell me what these numbers mean, or perhaps give me a better way to play the sound?

and thanks  :)