scripting:reference:system_functions:buildinginformationfunctions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:reference:system_functions:buildinginformationfunctions [2020/01/30 14:23] – mit | scripting:reference:system_functions:buildinginformationfunctions [2025/05/28 18:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| System functions that provide information about a building and its contents, and allow you to control the building UI. | System functions that provide information about a building and its contents, and allow you to control the building UI. | ||
| + | |||
| + | Unless otherwise stated, these functions refer to the building currently being accessed by the player. (This can be overriden using SetBuildingContext). | ||
| ==== sysAmountInStocks ==== | ==== sysAmountInStocks ==== | ||
| - | ^ Format | sysAmountInStocks( | + | ^ Format | sysAmountInStocks( |
| ^ Description | Returns the amount of the item currently in the building' | ^ Description | Returns the amount of the item currently in the building' | ||
| - | ^ Parameters | Item Name or number | | ||
| ^ Example | '' | ^ Example | '' | ||
| ==== sysMaxAmountInStocks ==== | ==== sysMaxAmountInStocks ==== | ||
| - | ^ Format | sysMaxAmountInStocks ( [Item_Name or Num] )| | + | ^ Format | sysMaxAmountInStocks ( Item_Name_or_Num |
| ^ Description | Returns the maximum amount of the item currently allowed in the building' | ^ Description | Returns the maximum amount of the item currently allowed in the building' | ||
| - | ^ Parameters | Item Name or number | | ||
| ^ Example | '' | ^ Example | '' | ||
| ==== sysGetBuyPrice ==== | ==== sysGetBuyPrice ==== | ||
| - | ^ Format | sysGetBuyPrice | + | ^ Format | sysGetBuyPrice( Item ) | |
| ^ Description | Returns the 'Buy Price' set for this item in the currently accessed building | | ^ Description | Returns the 'Buy Price' set for this item in the currently accessed building | | ||
| - | ^ Parameters | Item name or number | ||
| ^ Returns | 'Buy Price' of the item in denari | | ^ Returns | 'Buy Price' of the item in denari | | ||
| ^ Notes | Related commands: *setbuyprice [BuildingID] [Item] [Price] | | ^ Notes | Related commands: *setbuyprice [BuildingID] [Item] [Price] | | ||
| Line 28: | Line 27: | ||
| osdcreate( OSDBUILDING, | osdcreate( OSDBUILDING, | ||
| - | | + | |
| osdactivate() | osdactivate() | ||
| } | } | ||
| Line 35: | Line 34: | ||
| ==== sysGetSellPrice ==== | ==== sysGetSellPrice ==== | ||
| - | ^ Format | sysGetSellPrice( | + | ^ Format | sysGetSellPrice( |
| - | ^ Description | Returns the price that the item is currently set for sale at (Or 0 if it is not currently for sale) | | + | ^ Description | Returns the price that the item is currently set for sale at (Or 0 if it is not currently for sale) |
| - | ^ Parameters | + | ^ Returns |
| // | // | ||
| < | < | ||
| Line 46: | Line 45: | ||
| if ( $woodSellPrice == 0 ) | if ( $woodSellPrice == 0 ) | ||
| { | { | ||
| - | | + | |
| } | } | ||
| else | else | ||
| { | { | ||
| $woodSellPriceText = sysGetPriceText( $woodSellPrice ) | $woodSellPriceText = sysGetPriceText( $woodSellPrice ) | ||
| - | | + | |
| } | } | ||
| osdactivate() | osdactivate() | ||
| Line 58: | Line 57: | ||
| </ | </ | ||
| ==== sysGetEmployeeID ==== | ==== sysGetEmployeeID ==== | ||
| - | ^ Format | sysGetEmployeeID( | + | ^ Format | sysGetEmployeeID( Index ) | |
| ^ Description | Returns the employee player ID for the currently accessed building. Buildings can have up to 16 employees. | | ^ Description | Returns the employee player ID for the currently accessed building. Buildings can have up to 16 employees. | | ||
| - | ^ Parameters | Index (0 - 15) | | ||
| ^ Returns | PlayerID of the employee or 0 if none is set for this index | | ^ Returns | PlayerID of the employee or 0 if none is set for this index | | ||
| + | ^ Notes | Buildings currently have 16 possible slots for employees, index parameter is 0 - 15 | | ||
| // | // | ||
| < | < | ||
| Line 70: | Line 69: | ||
| { | { | ||
| $employeeName = sysGetPlayerName( $employeeID ) | $employeeName = sysGetPlayerName( $employeeID ) | ||
| - | | + | |
| } | } | ||
| else | else | ||
| { | { | ||
| - | | + | |
| } | } | ||
| osdactivate() | osdactivate() | ||
| Line 83: | Line 82: | ||
| ==== sysGetBuildingName ==== | ==== sysGetBuildingName ==== | ||
| - | ^ Format | sysGetBuildingName( | + | ^ Format | sysGetBuildingName( BuildingID ) | |
| ^ Description | Returns the building name for a particular ID | | ^ Description | Returns the building name for a particular ID | | ||
| - | ^ Parameters | Building ID number | ||
| ^ Returns | The building name | | ^ Returns | The building name | | ||
| // | // | ||
| Line 101: | Line 99: | ||
| TBD\\ | TBD\\ | ||
| - | ==== sysBuildingActivateStockroom | + | ==== sysBuildingGetSoldItem |
| - | ==== sysBuildingActivateBuyItem | + | ==== sysBuildingGetMadeItem |
| - | ==== sysBuildingActivateSetPrices | + | ==== sysBuildingGetDemandedItem |
| - | ==== sysBuildingActivateSellItem | + | ==== sysBuildingGetProducedItem |
| - | ==== sysBuildingActivateEmployeeList | + | ==== sysBuildingGetTotalSold |
| + | ^ Format | sysBuildingGetTotalSold ( Item_Name_or_Num )| | ||
| + | ^ Description | Returns the total amount of the item that has been sold (since the count was reset with *buildingresetsoldtotal). If item name is omitted or set to 0, a total of all items is provided. | | ||
| + | ^ Example | '' | ||
| + | |||
| + | ==== sysBuildingGetTotalMade ==== | ||
| + | ^ Format | sysBuildingGetTotalMade ( Item_Name_or_Num )| | ||
| + | ^ Description | Returns the total amount of the item that has been made (since the count was reset with *buildingresetmadetotal). If item name is omitted or set to 0, a total of all items is provided. | | ||
| + | ^ Example | '' | ||
| ===== Related System Values ===== | ===== Related System Values ===== | ||
| Line 111: | Line 118: | ||
| \\ | \\ | ||
| \\ | \\ | ||
| - | **$gBuildingNum**, **$gBuildingAccessNum**, **$gBuildingScriptParam**, **$gBuildingX**, **$gBuildingY**, **$gBuildingCode**, **$gBuildingOwnerID**, **$gBuildingNumEmployees**, **$gBuildingMaxEmployees**, **$gBuildingSalePrice**, **$gBuildingWage**, **$gBuildingWorldX**, **$gBuildingWorldY**, **$gBuildingInvestment**, | + | **$gBuildingX**, **$gBuildingY** : X,Y location of the building in map coords (default 0 -> 255)\\ |
| - | **$gBuildingEfficiency**, | + | **$gBuildingCode** : Building type code - the number of the building type in the buildings editor list\\ |
| + | **$gBuildingNum**, **$gBuildingAccessNum** : Unique ID number of the specific building being accessed \\ | ||
| + | **$gBuildingWorldX**, **$gBuildingWorldY** : X,Y location of the building in world coords\\ | ||
| + | **$gBuildingTeam** : Team the building belongs to (or 0 if none)\\ | ||
| + | **$gBuildingCapacity** : Capacity value of the building (e.g. for homes)\\ | ||
| + | **$gBuildingSpaceRemaining** : Remaining capacity of the building (e.g. for homes)\\ | ||
| + | **$gBuildingTown** : Town building num of the town the building is in (or 0 if the building is not in a town)\\ | ||
| + | **$gBuildingScriptParam**, , **$gBuildingOwnerID**, **$gBuildingNumEmployees**, **$gBuildingMaxEmployees**, **$gBuildingSalePrice**, **$gBuildingWage**, **$gBuildingInvestment**, | ||
| + | **$gBuildingEfficiency**, | ||
| + | |||
| + | ===== Collated Player Building Information ===== | ||
| + | |||
| + | The following functions are somewhat different.. rather than being about a specific building, they return information about all the buildings a player currently owns. | ||
| + | |||
| + | ==== sysPlayerBuildingsGetTotalMade ==== | ||
| + | ^ Format | sysPlayerBuildingsGetTotalMade ( PlayerID, Item_Name_or_Num )| | ||
| + | ^ Description | Returns the total amount of the item that has been made in the player' | ||
| + | ^ Example | '' | ||
| + | |||
| + | ==== sysPlayerBuildingsGetTotalSold ==== | ||
| + | ^ Format | sysPlayerBuildingsGetTotalSold ( PlayerID, Item_Name_or_Num )| | ||
| + | ^ Description | Returns the total amount of the item that has been sold from the player' | ||
| + | ^ Example | '' | ||
scripting/reference/system_functions/buildinginformationfunctions.1580394219.txt.gz · Last modified: (external edit)
