RequiredExports.h
From OPU Wiki
The below EXPORTs need to be defined by your mission. Without them OUTPOST2 can not function and will refuse to load your DLL Script:
| char MapName[ ] | Holds the file name of the .map file |
| char LevelDesc[ ] | Description that appears in the list/menu |
| char TechtreeName[ ] | The tech tree to use for this level |
| SDescBlock DescBlock | Exports game info |
- Note that MapName and TechtreeName are required to point to valid map- and techtree files in order for OUTPOST2 to load & run your mission!
These functions are required exports as well. If these functions are not found by Outpost2.exe, the game will not load the level. Any initialization in your mission should be put into InitProc
AIProc shopuld not be used BUT has to be added
| int InitProc( ) | Called on mission startup. Should return 1 to be able to run the mission! |
| void AIProc( ) | Can be used to implement an AI (Called every game cycle) |
| void GetSaveRegions(struct BufferDesc &bufDesc) | Used to return a buffer description to OP2 for storing data to saved game files |
The following two exports are not strictly required but are usually found in all level DLLs.
| int StatusProc() | Unused, returns 0 |
| void NoResponseToTrigger() | Used for triggers with no custom effects |
[edit]
Blank Mission
A new, blank, mission source file should look like this:
SCRIPT_API char MapName[]="mymap.map";
SCRIPT_API char LevelDesc[]="This text shows up as the mission title";
SCRIPT_API char TechtreeName[]="MULTITEK.TXT";
SCRIPT_API SDescBlock DescBlock={ MULTI_LastOneStanding, 4, 12, 0 };
void GetSaveRegions(struct BufferDesc &bufDesc)
{
}
void AIProc()
{
}
int InitProc()
{
// Init stuff goes here
return 1; // 1=okay, 0=error - do not load mission
}
[edit]
DescBlock
The DescBlock above uses these params:
- missionType (see table below)
- numPlayers (number of players, including AI's)
- maxTechLevel (tech level 12 = max, 0 = no techs available)
- boolUnitMission (1 = unitmission, 0 = basemission)
[edit]
missionType
For single-player (campaign) missions, this is the mission number; or use one of these values:
| COLONY |
| AUTODEMO |
| TUTORIAL |
| MULTI_LandRush |
| MULTI_SpaceRace |
| MULTI_ResourceRace |
| MULTI_Midas |
| MULTI_LastOneStanding |
Categories: Coding | SDK
