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
DogFollowEvent
ParentEventFunctions
emptyNew
DescriptionDefinitionemptyNew()Code
12 | function DogFollowEvent.emptyNew() |
13 | local self = Event.new(DogFollowEvent_mt) |
14 | return self |
15 | end |
new
DescriptionDefinitionnew()Code
19 | function DogFollowEvent.new(dog, player) |
20 | local self = DogFollowEvent.emptyNew() |
21 | |
22 | self.dog = dog |
23 | self.player = player |
24 | self.follow = player ~= nil |
25 | |
26 | return self |
27 | end |
readStream
DescriptionDefinitionreadStream()Code
31 | function DogFollowEvent:readStream(streamId, connection) |
32 | self.dog = NetworkUtil.readNodeObject(streamId) |
33 | self.follow = streamReadBool(streamId) |
34 | if self.follow then |
35 | self.player = NetworkUtil.readNodeObject(streamId) |
36 | end |
37 | |
38 | self:run(connection) |
39 | end |
run
DescriptionDefinitionrun()Code
52 | function DogFollowEvent:run(connection) |
53 | if self.dog ~= nil then |
54 | -- check for follow and special check for player for the case that player does not exist on client or server |
55 | if self.follow then |
56 | if self.player ~= nil then |
57 | self.dog:followEntity(self.player) |
58 | end |
59 | else |
60 | self.dog:goToSpawn() |
61 | end |
62 | end |
63 | end |
writeStream
DescriptionDefinitionwriteStream()Code
43 | function DogFollowEvent:writeStream(streamId, connection) |
44 | NetworkUtil.writeNodeObject(streamId, self.dog) |
45 | if streamWriteBool(streamId, self.follow) then |
46 | NetworkUtil.writeNodeObject(streamId, self.player) |
47 | end |
48 | end |