op2_sdk:placing_units

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
op2_sdk:placing_units [2016/01/31 21:04] vagabondop2_sdk:placing_units [2016/01/31 21:11] vagabond
Line 10: Line 10:
  
 Unit positions are represented in game by either the structure LOCATION or by passing 2 integers into a function, representing the x and y position. LOCATION represents the tile currently being occupied by the unit. The Outpost 2 game engine requires units to be placed +31 X tiles and -1 Y tiles from their actual position. For example: LOCATION(21 + 31, 15 - 1) would be the position (21,15) on the map. Unit positions are represented in game by either the structure LOCATION or by passing 2 integers into a function, representing the x and y position. LOCATION represents the tile currently being occupied by the unit. The Outpost 2 game engine requires units to be placed +31 X tiles and -1 Y tiles from their actual position. For example: LOCATION(21 + 31, 15 - 1) would be the position (21,15) on the map.
- 
  
 ===== Building Origin ===== ===== Building Origin =====
Line 24: Line 23:
  
 When any vehicle is created, it defaults to lights off. The function void ''DoSetLights(int boolOn)'' from Unit.h can be used to turn the lights on. When any vehicle is created, it defaults to lights off. The function void ''DoSetLights(int boolOn)'' from Unit.h can be used to turn the lights on.
 +
 +===== Using the CreateUnit Function =====
 +
 +Some variables used in ''CreateUnit'' are not required depending on what unit is being created. For example, a command center cannot have cargo or if you want to create a truck that does not contain any cargo. In these situations use the enum map_id::mapNone to indicate no cargo is required.
 +
 +When placing buildings, the variable rotation does not have any meaning and can be set to any value.
  
 ===== Related Source Code ===== ===== Related Source Code =====
  • op2_sdk/placing_units.txt
  • Last modified: 2016/10/12 21:32
  • by 127.0.0.1