euddraft calls most of these for you, but knowing the shape of the build makes its errors far easier to read.
| LoadMap(fname) | Open a map and read all of its CHK data. |
|---|---|
| SaveMap(fname, rootf) | Save the map with rootf as its entry point. |
| EUDOnStart(func) | Register a function to run when the map starts. |
| EUDDoEvents() | Yield the trigger loop where you stand. |
| GetChkTokenized() | Read and write CHK sections directly. Leave STR and TRIG alone. |
| MPQAddFile(fname, content, isWave) / MPQAddWave(fname, content) | Put a file or a WAV inside the map's MPQ. |
| IsMapdataInitalized() | Whether the map data has been loaded yet. |
| EncodeUnit / EncodeLocation / EncodeString / EncodeSwitch / EncodePlayer | Turn a name into the number a trigger uses. Not always the same as the index. |
|---|---|
| EncodeAIScript / EncodeAllyStatus / EncodeComparison / EncodeCount / EncodeModifier / EncodeOrder / EncodePropState / EncodeProperty / EncodeResource / EncodeScore / EncodeSwitchAction / EncodeSwitchState | The same conversion for every other argument type. |
| GetUnitIndex / GetLocationIndex / GetStringIndex / GetSwitchIndex / GetPropertyIndex | Turn a name into its index. |
| GetPlayerInfo(player) | Fetch a player's information. |
| UnitProperty(...) | Build the property bundle CreateUnitWithProperties takes. |
| CompressPayload(mode) | Compress the payload to shrink the map. On by default in euddraft. |
|---|---|
| EP_SetRValueStrictMode(mode) | Forbid assigning into an expression result. Off by default. |
| PRT_SetInliningRate(rate) | How much of TRIG to move into STR. It increases map size. |
| eudplibVersion() | Report the eudplib version. |
Saving runs in three phases, and knowing which one failed narrows the cause considerably.
- 1Collection - work out the address relationships and gather every object the map needs.
- 2Allocation - decide each object's address from its size.
- 3Writing - lay the data down at those addresses.
Forward() is the forward declaration for when you need something's address before you have defined it - common when triggers point at each other.
