COB Extensions

Requirements

All you need to use new extensions is:
- current build of TADR Recorder (dplayx)
- Scriptor
- have a look at new extensions list and examples

Limitations

Setters [set SOMETHING to xx] are limited to a single parameter.
Getters [get SOMETHING(par1, par2, par3, par4)] can take max. 4 parameters (however it could take much more but this is a Scriptor limit).
Because a lot of extensions require more than a single parameter, i've decided to use getter capability also for calls that don't really result in any value ("pseudo get" setter).

Unit type CRC ID value vs string name

Scriptor doesn't support strings (text) as getters/setters parameter. Some of my extensions that require providing unit type (i.e. ARMCOM) accept only numbers (IDs). You can obtain current units and weapons IDs list by pressing LEFT ALT + LEFT SHIFT + W hotkey when development mode of TA is enabled (F10 / F11 key in skirmish). Units and weapons list will be saved to a text file "unitsweps.h" into your TA root directory. Save location can be changed via INI setting called "ScriptorIncludePath".

A small note on how TA store unit ID in memory

Every unit that exists in game has its own double word sized ID. Where low word is a number in range specified for player. F.e. if totala.ini is set to max 1500 units - Player 1 will be allowed to use Ids in range of 1 to 1500, Player 2 - 1501 to 3000 etc. High word is a value that is being randomized every time unit is being created. Randomization process happens for every player locally, making it unique.

Example: Unit #3 has been created by first player. How players see it ?

Player 1:

High word Low word
0xCDFA 0x0003


Player 2:

 

High word Low word
0x4FEB 0x0003

 

High word of unit ID stays untouched till unit gets killed. This fact makes it useful for making double checks of unit ID when it comes to making any operations involving two units and there's some time period between knowing ID and doing something with the unit.

Example:
- in COB script we search for the nearest enemy unit, as a found result we get a long unit ID f.e. ABCD0002
- we store that ID for further operations, f.e. we want to do something with that unit but 10 seconds later
- 3 seconds later after the search, unit has been killed and a new one with the short ID #2 has been created, so TA assigns different high word to it f.e. FFCC0002
- since the new "#2" unit can be something totally different, and located on second edge of map we don't want to touch it at all, and this is the moment where we should confirm that long id we have stored in COB - still matches current state. Obviously ABCD0002 != FFCC0002 so we know that unit #2 is something new. No need to check again unit type, height and whatever. Long ID doesn't match = it's a different unit.
*CONFIRM_LONG_ID COB extension.

COB extensions properties used in documentation :

Network Network packet will be broadcast to all players in game
Recording Extension is not going to work in replayed games. Some of my extensions are able to create native TA network packet that will be stored in demo file anyway. There's no reason to duplicate extension event in replayed games.

Comments

Submitted byJ0rmungander on Thu, 19/05/2016 - 23:50

I know these extensions are for TA but a few extensions for TA:K if you have the time, need deciphering such as unit value 30, 33 and 40.
I assume 40 in TA:K equals a stance due to looking at berserkers or crusaders sheathe and unsheathe their weapons using one of three stances: attack, defensive and passive.

Thanks for any help!