LUADOC - Farming Simulator 17

Printable Version

TreePlantUtil

Description
TreePlantUtil
Functions

registerTreeType

Description
Register tree type
Definition
registerTreeType(string name, string nameI18N, table treeFilenames, float growthTimeHours)
Arguments
stringnamename
stringnameI18Nlocalized name
tabletreeFilenameslist of filenames for each growth state
floatgrowthTimeHoursgrowth time hours

initTreesData

Description
Initalize tree data
Definition
initTreesData(table treeData)
Arguments
tabletreeDatatree data

deleteTreesData

Description
Delete tree data
Definition
deleteTreesData(table treeData)
Arguments
tabletreeDatatree data

canPlantTree

Description
Returns if tree can be planted
Definition
canPlantTree()
Return Values
booleancanPlantcan plant tree

plantTree

Description
Plant tree
Definition
plantTree(table treesData, table treeData, float x, float y, float z, float rx, float ry, float rz, float growthState, integer growthStateI, boolean isGrowing, integer splitShapeFileId)
Arguments
tabletreesDatatrees data
tabletreeDatatree data
floatxx world position
floatyz world position
floatzz world position
floatrxx world rotation
floatryy world rotation
floatrzz world rotation
floatgrowthStategrowth state
integergrowthStateIgrowth state
booleanisGrowingis growing
integersplitShapeFileIdsplit shape file id

loadTreeNode

Description
Load tree node
Definition
loadTreeNode(table treesData, table treeData, float x, float y, float z, float rx, float ry, float rz, integer growthStateI, integer splitShapeFileId)
Arguments
tabletreesDatatrees data
tabletreeDatatree data
floatxx world position
floatyz world position
floatzz world position
floatrxx world rotation
floatryy world rotation
floatrzz world rotation
integergrowthStateIgrowth state
integersplitShapeFileIdsplit shape file id
Return Values
integertreeIdid of tree
integersplitShapeFileIdsplit shape file id

updateTrees

Description
Update trees
Definition
updateTrees(table treesData, float dt, integer dtGame)
Arguments
tabletreesDatatrees data
floatdttime since last call in ms
integerdtGamedt of game

addTreeCutJoint

Description
Add tree cut joint
Definition
addTreeCutJoint(table treesData, integer jointIndex, integer shape, float nx, float ny, float nz, float maxAngle, float maxLifetime)
Arguments
tabletreesDatatrees data
integerjointIndexindex of joint
integershapeif of shape
floatnxx world direction
floatnyy world direction
floatnzz world direction
floatmaxAnglemax angle
floatmaxLifetimemax lifetime

cleanupDeletedTrees

Description
Cleanup deleted trees
Definition
cleanupDeletedTrees(table treesData)
Arguments
tabletreesDatatrees data

loadFromAttributesAndNodes

Description
Loading from attributes and nodes
Definition
loadFromAttributesAndNodes(table treesData, integer xmlFile, string baseKey)
Arguments
tabletreesDatatress data
integerxmlFileid of xml object
stringbaseKeybaseKey

getSaveAttributesAndNodes

Description
Get Save attributes and nodes
Definition
getSaveAttributesAndNodes(table treesData, string nodeIdent)
Arguments
tabletreesDatatress data
stringnodeIdentnode ident
Return Values
stringattributesattributes
stringnodesnodes

getTreeSaveAttributesAndNodes

Description
Get tree save attributes and nodes
Definition
getTreeSaveAttributesAndNodes(table treesData, string nodeIdent, table tree, boolean isGrowing, boolean firstTreeWritten)
Arguments
tabletreesDatatress data
stringnodeIdentnode ident
tabletreetree
booleanisGrowingis growing
booleanfirstTreeWrittenis first tree written
Return Values
stringattributesattributes

readFromServerStream

Description
Read from server stream
Definition
readFromServerStream(table treesData, integer streamId)
Arguments
tabletreesDatatrees data
integerstreamIdstream id

writeToClientStream

Description
Write to client stream
Definition
writeToClientStream(table treesData, integer streamId)
Arguments
tabletreesDatatrees data
integerstreamIdstream id