Contents |
Source
This has a list of all COB SET/GET keys: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobInstance.cpp
You'll want to include a file with these constants in your script.
SET/GET
Use
Use GET [tag] to get a value. Some GETs refer to functions; in this case, use GET [tag](arg1, arg2, arg3, arg4). Use SET [tag] to [value] to change a value.
Tags
There's a lot of GET/SET tags; I'll cover some of the more useful but less intuitive ones.
- ACTIVATION: Whether the unit is on (true) or off (false).
- ARMORED: When true, any damage dealt to the unit will be multiplied by its damageModifier.
- PRINT: You can use GET PRINT to send up to 4 arguments to chat. Useful for debugging.
- VETERAN_LEVEL: The unit's experience times 100. Note that you can SET this via script, although the unit won't gain any extra health from doing so.
emit-sfx
emit-sfx [sfxtype] from [piece];
The least significant byte of sfxtype is treated as an unsigned integer; the remaining bits are a bitmask. The bitmask indicates what type of sfx to emit, while the number indicates which sfx of that type to emit. The bits are as follows:
- 256: Point-based fx. Used for white smoke (1), black smoke (2), and bubbles (3).
- 1024: Unit sfx. Use with the unit's sfxtypes.explosionGenerators. The first one is 0, the second one is 1, etc.
- 2048: Fire weapon. Fires a weapon from the piece (no aiming involved). Again, the first weapon is 0, the second weapon is 1, etc.
- 4096: Explode weapon. Detonates a weapon at the piece. Again, the first weapon is 0, the second weapon is 1, etc.
explode
Causes the piece to explode and possibly go flying. This actually gives the appearance of making a copy of the piece (henceforth referred to as "debris") so if you're using it outside of Killed() you may want to hide the piece in question.
explode [piece] type [exptype];
exptype is a bitmask. The bits are as follows:
- SHATTER: Explodes the debris into tiny triangles. Looks like confetti.
- EXPLODE_ON_HIT: Debris will explode on impact, causing about 40 damage.
- FALL: Debris is affected by gravity.
- SMOKE
- FIRE
- BITMAPONLY: No debris, just an explosion graphic.
- NOCEGTRAIL
- BITMAP[1...5]: Doesn't actually appear to do anything.
