Category: Player
Since engine version: 1.0 OC
GetBaseProduction
Description
With id specified, the function returns how quickly objects of that type are resupplied to the player's home base. In this case index and category are ignored. If id is not specified, the function returns the id of the indicated type of objects of the specified category in the player's resupply list. This will return all object types from the resupply list, even if they are currently not being resupplied.
Syntax
int GetBaseProduction(int player, id id, int index, int category);
Parameters
- player:
- Number of the player whose buying options you want to determine. The first player has the player number 0.
- id:
- [opt] If specified, the function returns the number of objects of the given type which are resupplied to the player's home base. In this case index and category are ignored.
- index:
- [opt] List index of the buyable item to check.
- category:
- [opt] Category of buyable items you want to check.
Example
if(!GetBaseProduction(0, Firestone)) GetCursor(0)->CreateContents(Firestone);
Gives a flintstone to the selected clonk of the first player if currently no flintstones are resupplied to the player's home base.