Table of Contents

Morale

Reviewed For: SDK 2.1

Colony morale can be set as either fixed or variable individually per colony. If creating a multiplayer scenario, check to see if the players' desire steady morale and set appropriately. For land rush games, consider setting morale as fixed until after the player establishes a base.

Morale Table

LevelValueMoraleLevels Enum
Excellent (Great)990
Good (OK) 751
Fair 502
Poor 253
Terrible (Rotten)04

Useful Functions

From TethysGame

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

enum MoraleLevels MoraleLevel() const;

From Enums.h

enum MoraleLevels 
{
    moraleGreat = 0,
    moraleGood,
    moraleOK,
    moralePoor,
    moraleRotten
};

Noted Bugs

Calling ForceMoraleX functions after tick 0 will cause a “Cheated Game!” message to appear.

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

int InitProc()
{
    TethysGame::FreeMoraleLevel(-1);
 
    if (TethysGame::UsesMorale() == 0)
    {
	TethysGame::ForceMoraleGood(-1);
    }
}

- Go Back to Programming a Scenario
- Go Back to Outpost 2 Mapmaking
- Go Back to Outpost 2 Main page
- Go Back to Wiki Home Page