The example on this page:
http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getscriptvar
shows that even units which are not CRPL cores have some variables to get and set. Is there a way to find out what variables are available for each unit?
eduran kindly added them to the SetScriptVar page.
Thanks for the pointer, not sure how I didn't see that.
Do we know that this is a definitive list? I was hoping player units (mortars etc) would expose some variables, like amount built (allowing creation of prebuilt units) or targeting control.
Edit: Also being able to set the energy generation of a reactor would let people do a lot of cool economy stuff. I guess this is partly a feature request and partly a question about whether there's already stuff available that I don't know about :P.
Actually, I was trying to figure that stuff out myself earlier, and couldn't find any answers yet.
Quote from: stewbasic on January 23, 2014, 10:30:48 PM
Thanks for the pointer, not sure how I didn't see that.
Do we know that this is a definitive list? I was hoping player units (mortars etc) would expose some variables, like amount built (allowing creation of prebuilt units) or targeting control.
Edit: Also being able to set the energy generation of a reactor would let people do a lot of cool economy stuff. I guess this is partly a feature request and partly a question about whether there's already stuff available that I don't know about :P.
For unit health and ammo, use
<-unitUID CONST_HEALTH GetUnitAttribute and
<-unitUID CONST_AMMO GetUnitAttribute, respectively. I don't know if other internal functions can be changed, such as energy production. As for changing how mortars target, I'm 99.9% sure that's impossible.
Quote from: stewbasic on January 23, 2014, 10:30:48 PM
Do we know that this is a definitive list?
Inhibitors are missing. They use the same variables as emitters. There is probably also a way to set the AE field range (both on towers and inhibs). I very much doubt that player units can be accessed in the same way, but virgil is the only one who could give you a definitive answer in that regard.
Also: http://knucklecracker.com/forums/index.php?topic=15295.0 has some answers about what is/isn't possible.
This is what is in the game right now for implicit var's available on non crpl tower units (for tonight's build and for last night's as well). If someone wouldn't mine syncing this up with the wiki I'd be very grateful. I've got a few irons in the fire right now and am rushing to get another build done before the day is out.
Emitter
STARTTIME
FINISHTIME
PRODUCTIONINTERVAL
PRODUCTIONAMT
SporeTower
STARTTIME
WAVEINTERVAL
WAVECOUNT
SPOREPAYLOAD
AETower
RANGE
RunnerNest
SPAWNINTERVAL
MAXPOPULATION
MOVESPEED
RUNNERMAXHEALTH
CREEPERPAYLOAD
Inhibitor
STARTTIME
PRODUCTIONINTERVAL
PRODUCTIONAMT
RANGE
ResourcePack
AMT
MAXAMT
RESOURCETYPE {'ENERGY', 'ORE', 'AETHER'}
Added to the wiki.