Table of Contents

Setting Resources

Reviewed For: SDK 2.1

Colony resources can be set or retrieved for any player whether they are human controlled or AI controlled. Typically, resources values are reduces or increased based on the difficulty selected by the player.

For information on how to set colony morale, see: Stub

For information on how to set Day/Night cycles, see: Stub

From Player.h

class OP2 _Player
{
public:
...
	void SetKids(int numKids);
	void SetWorkers(int numWorkers);
	void SetScientists(int numScientists);
 
	void SetOre(int newCommonOre);
	void SetRareOre(int newRareOre);
	void SetFoodStored(int newFoodStored);
 
	void SetSolarSat(int numSolarSatellites);
...
}

Sample Code

int InitProc()
{
    switch (Player[0].Difficulty())
    {
    case 0:
        Player[0].SetOre(4000);
        Player[0].SetWorkers(25);
        Player[0].SetFoodStored(750);
        break;
    case 1:
        Player[0].SetOre(2000);
        Player[0].SetWorkers(20);
        Player[0].SetFoodStored(500);
        break;
    case 2:
        Player[0].SetOre(1800);
        Player[0].SetWorkers(18);
        Player[0].SetFoodStored(250);
        break;
    }
}

- Go Back to Programming a Scenario
- Go Back to Outpost 2 Software Development Kit
- Go Back to Outpost 2 Main page
- Go Back to Wiki Home Page