Scripter MAIN

From OPU Wiki

Table of contents

Overview

The MAIN block is where you put all the mission-specific definitions. These include: (bold properties are manditory)

  • NAME
  • DESCRIPTION
  • MAP
  • PLAYERS
  • MAXTECHLEVEL
  • MISSIONTYPE
  • TECHTREE
  • AUTHOR
  • UNITMISSION

The order in which the properties are set is not important. Any or all of these properties can be included inside the MAIN block, or outside of any blocks, but they have to be defined before you start any other block.

Not all properties are compulsory: the ones that are optional have default values. To set these properties, use the SET command.

Example MAIN block:

BEGIN MAIN

   SET PLAYERS=     3
   SET MAP=         "eden04.map"
   SET MAXTECHLEVEL=5
   SET MISSIONTYPE= COLONY
   SET DESCRIPTION= "Example mission"
   SET AUTHOR=      "My name here"

END



Mission properties

NAME

This is the name of the mission. It will be used for creating the C++ file, as well as the mission DLL-name. The NAME property is optional, and the default value is "op2script". You may not use more than 8 characters, and it can only contain letters, numbers or underscores (DOS filename restrictions apply)

SET NAME = "myscript"


DESCRIPTION

The description as it should appear in the mission briefing room. There is no default value, and it cannot be empty. This makes it a compulsory definition.

SET DESCRIPTION = "This will appear in the briefing"


MAP

Each mission needs a MAP file. This property is compulsory: the mission cannot start without a valid map-file. Scripter does not check for the existance of the map file - therefor the file does not have to be in your scripter folder. You do not have to include the .MAP extention.

SET MAP="eden04"


PLAYERS

The number of players that this mission can handle. Each player (human or AI) has a player-slot, so if you want to have 2 human players and 1 computer opponent, you need to set this property to 3.

SET PLAYERS=3


MAXTECHLEVEL

The MAXTECHLEVEL is set to 12 (the highest possible tech-level) by default. If you want to use a lower tech-level, set this property to the correct value. Only values between 1 and 12 are accepted.

SET MAXTECHLEVEL=5

Each tech-level value corresponds with a single-player campaign level. Although those campaign levels are irrelevant for multi-player games, the tech-levels are roughly the same as with single-player mission. This also means, since unit-only missions in the campaigns do not have research, there are a few tech-levels without extra technologies, compared to its predecessor. Those are:

Eden 1 4 6 7 9 11
Plymouth 1 4 6 7 9 11

This means that setting MAXTECHLEVEL to 4 is the same as setting it to 3.


MISSIONTYPE

Each mission DLL needs to know what type it is to be able to be run by Outpost 2. Campaign (single-player) mission are numbered from 1 to 12. These are not allowed for Scripter. You must supply a valid missiontype:

  • COLONY
  • AUTODEMO
  • TUTORIAL
  • LANDRUSH
  • SPACERACE
  • RESOURCERACE
  • MIDAS
  • LASTONESTANDING
SET MISSIONTYPE = COLONY


TECHTREE

The tech-tree is where Outpost 2 get all information about technologies that a player can research. Although it is possible to design your own techtree, it is safer and more practical to use the default techtree: "multitek.txt". You do not have to define this property, unles you want the mission to use some other techtree; the definition is optional.

SET TECHTREE="edentek.txt"


AUTHOR

This string property is not visibly included in the mission. But is does appear in the C++ file Scripter creates.

SET AUTHOR="My name here"


UNITMISSION

There are unit missions and base missions in Outpost 2. A unit mission does not allow buildings to be constructed or research to be done: all you have at mission start are units. By default this property is set to FALSE meaning it will be a base mission.

SET UNITMISSION=TRUE

Valid values for UNITMISSION are:

  • YES
  • NO
  • TRUE
  • FALSE
  • 1 (the number one)
  • 0 (the number zero)



Beacons

Mining beacons are also defined within the MAIN block. A mission can have any number of beacons, including zero (which would only be recommendable in a unit-only mission)

A beacon command can be of the form BEACON <type> or <type> BEACON, where <type> is either COMMON or RARE. The beacon command takes 3 or 4 parameters: x, y, yield and an optional variant param. Examples:

BEACON COMMON  8, 20, 1BAR
BEACON RARE   12, 20, 3BAR

COMMON BEACON  8, 30, 2BAR, VARIANT1
RARE BEACON   12, 30, 2BAR, VARIANT3

All four of the above beacon lines are correct. The first 2 use the BEACON <type> form, while the other 2 are vise-versa. There is no difference between those 2 forms, and the compiler has no preference.

Also, the third and fourth beacons are of a VARIANT type, meaning their yields will fluctuate with the number of loads that have been extracted. These are the most commanly used beacons.

The first two beacons have a fixed yield and do not fluctuate. They are rarely used in the original missions.


Please be aware that, although a mine does not require tubes, you do need at least a 4 x 3 tile area to be able to place a mine over a beacon!


Disasters

All disasters, like volcanoes and tornadoes, are to be inserted into the MAIN block (or again: outside any block, since MAIN is the default block). Outpost 2 has these disasters:

  • VOLCANO
  • QUAKE
  • STORM
  • TORNADO
  • BLIGHT

Technically speaking, the Blight is not a disaster, but programmaticly it can be treated as one.


VOLCANO

QUAKE

STORM

TORNADO

BLIGHT

Miscellaneous properties

CENTER

Although the native block of CENTER is PLAYER, it can also be used within the MAIN block. Is this case it always refers to player 1, and is therefor only useful when creating single player missions.

SET CENTER=5,12

By default, the center is set to the location of the first CC that is defined for a each player.

TUBE

WALL

WRECK

MARKER


Back to manual

Personal tools