no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | op2_sdk:victory_and_defeat_conditions [2016/10/12 21:32] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Victory and Defeat Conditions ====== | ||
+ | '' | ||
+ | |||
+ | Outpost 2 scenarios can contain multiple conditions to stipulate either victory or defeat. These conditions can be dynamically enabled or disabled as game play progresses to shift a scenario' | ||
+ | |||
+ | Victory and defeat triggers require a hook to a separate trigger that tracks if a specific event has occurred. | ||
+ | |||
+ | For victory conditions, the text placed in the variable missionObjective will be displayed on the Mission Objectives screen in game. | ||
+ | |||
+ | For non-multiplayer games, Victory and Defeat condition triggers are not automatically saved and loaded by Outpost 2. These triggers must be saved by placing them in a custom structure with all other data requiring tracking between saving and loading the scenario. See the save regions section for details. | ||
+ | |||
+ | For multiplayer games, it is not recommended to create failure conditions. When a player loses a multiplayer game due to a failure trigger, they will be immediately ejected from the games and all other players will receive a message saying the losing player is having connection problems that pauses the game. To allow losing players to continue watching the game and keep from pausing the game for other' | ||
+ | |||
+ | Victory and defeat conditions should be hooked to triggers in the InitProc() function. Victory or defeat conditions that cannot be covered by the established triggers alone can be implemented through the AIProc() function. | ||
+ | |||
+ | ===== Useful Functions ===== | ||
+ | |||
+ | //From Triggers.h// | ||
+ | <code cpp> | ||
+ | Trigger __fastcall CreateVictoryCondition( | ||
+ | int bEnabled, int bOneShot, Trigger& | ||
+ | |||
+ | Trigger __fastcall CreateFailureCondition( | ||
+ | int bEnabled, int bOneShot, Trigger& | ||
+ | </ | ||
+ | |||
+ | //From OP2Helper.cpp// | ||
+ | <code cpp> | ||
+ | void CreateStarshipVictoryCondition() | ||
+ | void CreateLastOneStandingVictoryCondition() | ||
+ | void CreateNoCommandCenterFailureCondition(int playerNum) | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Unused Variables ===== | ||
+ | |||
+ | * For the functions '' | ||
+ | * For the function '' | ||
+ | |||
+ | ===== Sample Code ===== | ||
+ | |||
+ | Set space race victory condition for a colony game | ||
+ | <code cpp> | ||
+ | int InitProc() | ||
+ | { | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | - //Go Back to [[op2_sdk: | ||
+ | - //Go Back to [[op2_sdk: | ||
+ | - //Go Back to [[outpost_2: | ||
+ | - //Go Back to [[http:// |