====== 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
===== Related Source Code =====
//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 [[op2_sdk:programming_scenario_dlls|Programming a Scenario]]//\\
- //Go Back to [[op2_sdk:software_development_kit_sdk|Outpost 2 Software Development Kit]]//\\
- //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\
- //Go Back to [[http://wiki.outpost2.net/doku.php?id=start|Wiki Home Page]]//