Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
Farm
DescriptionPermission types.Parent
ObjectFunctions
- addHandTool
- addUser
- calculateDailyLoanInterest
- changeBalance
- demoteUser
- getActiveUsers
- getBalance
- getColor
- getEquity
- getFarmhouse
- getHandTools
- getIsContractingFor
- getLoan
- getNumActivePlayers
- getNumPlayers
- getSleepCamera
- getSpawnPoint
- getUserPermissions
- hasHandtool
- isUserFarmManager
- loadFromXMLFile
- merge
- new
- onUserJoinGame
- onUserQuitGame
- promoteUser
- removeHandTool
- removeUser
- resetToSingleplayer
- saveToXMLFile
- setInitialEconomy
- setIsContractingFor
- setUserPermission
- updateLastNickname
- updateMaxLoan
addHandTool
DescriptionAdd ownership of given handtoolDefinition
addHandTool()
addUser
DescriptionAdd a new user to the farm. This adds it to the players and active players list. And also gives default permissions.Definition
addUser()
calculateDailyLoanInterest
DescriptionCalculate the daily loan interestDefinition
calculateDailyLoanInterest()Return Values
float | daily | loan interest |
changeBalance
DescriptionAdd or remove money from the farmDefinition
changeBalance(number amount)Arguments
number | amount | Amount to add (positive) or remove (negative) |
demoteUser
DescriptionDemote a user from farm manager.Definition
demoteUser()
getActiveUsers
DescriptionGet a list of active users. Useful for using their connection IDDefinition
getActiveUsers()
getBalance
DescriptionGet the current account balance of the farm.Definition
getBalance()Return Values
float | Account | balance |
getColor
DescriptionGet the farm colorDefinition
getColor()Return Values
table | {r,g,b} |
getEquity
DescriptionGet the total equity (farmlands + placeables) of the farmDefinition
getEquity()
getFarmhouse
DescriptionGet the farmhouse associated with the farm.Definition
getFarmhouse()Return Values
table | farmhouse | or nil |
getHandTools
DescriptionGet a list of filenames for accessible handtoolsDefinition
getHandTools()
getIsContractingFor
DescriptionGet whether this farm is contracting for given farmDefinition
getIsContractingFor()
getLoan
DescriptionGet the current loan of the farm.Definition
getLoan()Return Values
float | Loan |
getNumActivePlayers
DescriptionGet the number of players in the farm that are currently onlineDefinition
getNumActivePlayers()
getNumPlayers
DescriptionGet the number of players in the farmDefinition
getNumPlayers()
getSleepCamera
DescriptionGet the sleep camera.Definition
getSleepCamera()Return Values
integer | Camera | or 0 if no farmhouse. |
getSpawnPoint
DescriptionGet the spawnpoint associated with the farm(house).Definition
getSpawnPoint()Return Values
integer | spawnpoint | node or the career spawnpoint node. |
getUserPermissions
DescriptionGet the farm permissions of a user.Definition
getUserPermissions(userId User)Arguments
userId | User | ID |
table | Permission | hash table {permission= |
hasHandtool
DescriptionGet whether this farm owns given handtoolDefinition
hasHandtool()
isUserFarmManager
DescriptionDetermine if a user is a manager of this farm.Definition
isUserFarmManager(userId User)Arguments
userId | User | ID |
bool | True | if the user is a manager of this farm, false otherwise |
loadFromXMLFile
DescriptionLoad the farm from the savegameDefinition
loadFromXMLFile()
merge
DescriptionMerge another farm into this farm. Used for creating an SP game from an MP game. (this is mutating)Definition
merge(table other)Arguments
table | other | Another Farm |
new
DescriptionCreate a new farm. Do not call directly! Only use the farm manager and createFarm()Definition
new()
onUserJoinGame
DescriptionCalled when a user joins the game. Active users is updated, and for spectator. a new user might be added. Server only.Definition
onUserJoinGame()
onUserQuitGame
DescriptionCalled when a user quits the game. The active user list is updated. Server only.Definition
onUserQuitGame()
promoteUser
DescriptionPromote a user to farm manager.Definition
promoteUser()
removeHandTool
DescriptionRemove ownership of given handtoolDefinition
removeHandTool()
removeUser
DescriptionRemove a user from the farm.Definition
removeUser()
resetToSingleplayer
DescriptionReset the farm to a singleplayer state by removing all players and adding a new single player with all permissionsDefinition
resetToSingleplayer()
saveToXMLFile
DescriptionSave the farm to the savegameDefinition
saveToXMLFile()
setInitialEconomy
DescriptionDefinitionsetInitialEconomy()
setIsContractingFor
DescriptionUpdate contracting statusDefinition
setIsContractingFor(noSendEvent boolean)Arguments
noSendEvent | boolean | Send no event, forces setting of actual value without server feedback |
setUserPermission
DescriptionSet a user's permission in this farm.Definition
setUserPermission(userId User, string permission, bool hasPermission)Arguments
userId | User | ID |
string | permission | Permission key from Farm.PERMISSION |
bool | hasPermission | True if the permission is to be granted, false to be denied |
updateLastNickname
DescriptionDefinitionupdateLastNickname()
updateMaxLoan
DescriptionRe-calculate the maximum loanDefinition
updateMaxLoan()