Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
ChainsawDelimbEvent
DescriptionEvent for delimbParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
14 | function ChainsawDelimbEvent.emptyNew() |
15 | local self = Event.new(ChainsawDelimbEvent_mt) |
16 | return self |
17 | end |
new
DescriptionCreate new instance of eventDefinition
new(table player, float x, float y, float z, float nx, float ny, float nz, float yx, float yy, float yz, boolean onDelimb)Arguments
table | player | player |
float | x | x |
float | y | y |
float | z | z |
float | nx | nx |
float | ny | ny |
float | nz | nz |
float | yx | yx |
float | yy | yy |
float | yz | yz |
boolean | onDelimb | on delimb |
table | instance | instance of event |
33 | function ChainsawDelimbEvent.new(player, x,y,z, nx,ny,nz, yx,yy,yz, onDelimb) |
34 | local self = ChainsawDelimbEvent.emptyNew() |
35 | self.player = player |
36 | self.x, self.y, self.z = x, y, z |
37 | self.nx, self.ny, self.nz = nx, ny, nz |
38 | self.yx, self.yy, self.yz = yx, yy, yz |
39 | self.onDelimb = onDelimb |
40 | return self |
41 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
47 | function ChainsawDelimbEvent:readStream(streamId, connection) |
48 | if not connection:getIsServer() then -- server side |
49 | self.player = NetworkUtil.readNodeObject(streamId) |
50 | self.x = streamReadFloat32(streamId) |
51 | self.y = streamReadFloat32(streamId) |
52 | self.z = streamReadFloat32(streamId) |
53 | self.nx = streamReadFloat32(streamId) |
54 | self.ny = streamReadFloat32(streamId) |
55 | self.nz = streamReadFloat32(streamId) |
56 | self.yx = streamReadFloat32(streamId) |
57 | self.yy = streamReadFloat32(streamId) |
58 | self.yz = streamReadFloat32(streamId) |
59 | self.onDelimb = false |
60 | if self.player ~= nil then |
61 | local chainsaw = self.player.baseInformation.currentHandtool |
62 | if chainsaw ~= nil then |
63 | local ret = findAndRemoveSplitShapeAttachments(self.x,self.y,self.z, self.nx,self.ny,self.nz, self.yx,self.yy,self.yz, 0.7, chainsaw.cutSizeY, chainsaw.cutSizeZ) |
64 | if ret then |
65 | self.onDelimb = true |
66 | connection:sendEvent(self) |
67 | end |
68 | end |
69 | end |
70 | end |
71 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
98 | function ChainsawDelimbEvent:run(connection) |
99 | print("Error: ChainsawDelimbEvent is not allowed to be executed on a local client") |
100 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
77 | function ChainsawDelimbEvent:writeStream(streamId, connection) |
78 | if connection:getIsServer() then -- client |
79 | NetworkUtil.writeNodeObject(streamId, self.player) |
80 | streamWriteFloat32(streamId, self.x) |
81 | streamWriteFloat32(streamId, self.y) |
82 | streamWriteFloat32(streamId, self.z) |
83 | streamWriteFloat32(streamId, self.nx) |
84 | streamWriteFloat32(streamId, self.ny) |
85 | streamWriteFloat32(streamId, self.nz) |
86 | streamWriteFloat32(streamId, self.yx) |
87 | streamWriteFloat32(streamId, self.yy) |
88 | streamWriteFloat32(streamId, self.yz) |
89 | else |
90 | NetworkUtil.writeNodeObject(streamId, self.player) |
91 | streamWriteBool(streamId, self.onDelimb) |
92 | end |
93 | end |