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:morale [2016/10/12 21:32] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Morale ====== | ||
+ | '' | ||
+ | |||
+ | Colony morale can be set as either fixed or variable individually per colony. If creating a multiplayer scenario, check to see if the players' | ||
+ | |||
+ | ===== Morale Table ===== | ||
+ | |||
+ | ^Level^Value^MoraleLevels Enum^ | ||
+ | |Excellent (Great)|99|0| | ||
+ | |Good (OK) |75|1| | ||
+ | |Fair | ||
+ | |Poor | ||
+ | |Terrible (Rotten)|0|4| | ||
+ | |||
+ | ===== Useful Functions ===== | ||
+ | |||
+ | From TethysGame | ||
+ | <code cpp> | ||
+ | static int __fastcall UsesMorale(); | ||
+ | |||
+ | static void __fastcall ForceMoraleGreat(int playerNum); | ||
+ | static void __fastcall ForceMoraleGood(int playerNum); | ||
+ | static void __fastcall ForceMoraleOK(int playerNum); | ||
+ | static void __fastcall ForceMoralePoor(int playerNum); | ||
+ | static void __fastcall ForceMoraleRotten(int playerNum); | ||
+ | static void __fastcall FreeMoraleLevel(int playerNum); | ||
+ | </ | ||
+ | |||
+ | From OP2 _Player | ||
+ | <code cpp> | ||
+ | enum MoraleLevels MoraleLevel() const; | ||
+ | </ | ||
+ | |||
+ | From Enums.h | ||
+ | <code cpp> | ||
+ | enum MoraleLevels | ||
+ | { | ||
+ | moraleGreat = 0, | ||
+ | moraleGood, | ||
+ | moraleOK, | ||
+ | moralePoor, | ||
+ | moraleRotten | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | ===== Noted Bugs ===== | ||
+ | |||
+ | Calling ForceMoraleX functions after tick 0 will cause a " | ||
+ | |||
+ | ForceMoraleX is buggy if playerNum is not -1. You may need to call the function twice for the correct effect. FreeMoraleLevel is not affected by this bug. | ||
+ | |||
+ | |||
+ | ===== Sample Code ===== | ||
+ | |||
+ | Check for Steady Morale in Multiplayer | ||
+ | <code cpp> | ||
+ | int InitProc() | ||
+ | { | ||
+ | TethysGame:: | ||
+ | | ||
+ | if (TethysGame:: | ||
+ | { | ||
+ | TethysGame:: | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | - //Go Back to [[op2_sdk: | ||
+ | - //Go Back to [[op2_sdk: | ||
+ | - //Go Back to [[outpost_2: | ||
+ | - //Go Back to [[http:// |