Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- AnimatedMapObject
- AnimatedObject
- AnimatedObjectEvent
- Bale
- Basketball
- Bga
- BgaSellStation
- BunkerSilo
- BuyingStation
- DigitalDisplay
- DogBall
- HelpIcons
- LoadingStation
- NightIllumination
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SellingStation
- SimParticleSystem
- Storage
- StorageSystem
- SunAdmirer
- TourIcons
- UnloadingStation
- VehicleSellingPoint
- WildlifeSpawner
- 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
AnimatedObjectEvent
DescriptionSets animatedObject directions Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.Parent
EventFunctions
emptyNew
DescriptionDefinitionemptyNew()Code
12 | function AnimatedObjectEvent:emptyNew() |
13 | local self = Event:new(AnimatedObjectEvent_mt) |
14 | return self |
15 | end |
new
DescriptionDefinitionnew()Code
19 | function AnimatedObjectEvent:new(animatedObject, direction) |
20 | local self = AnimatedObjectEvent:emptyNew() |
21 | |
22 | self.animatedObject = animatedObject |
23 | self.direction = direction |
24 | |
25 | return self |
26 | end |
readStream
DescriptionDefinitionreadStream()Code
30 | function AnimatedObjectEvent:readStream(streamId, connection) |
31 | assert(g_currentMission:getIsServer()) |
32 | self.animatedObject = NetworkUtil.readNodeObject(streamId) |
33 | self.direction = streamReadUIntN(streamId, 2) - 1 |
34 | self:run(connection) |
35 | end |
run
DescriptionDefinitionrun()Code
47 | function AnimatedObjectEvent:run(connection) |
48 | self.animatedObject.animation.direction = self.direction |
49 | self.animatedObject:raiseActive() |
50 | end |
writeStream
DescriptionDefinitionwriteStream()Code
39 | function AnimatedObjectEvent:writeStream(streamId, connection) |
40 | assert(connection:getIsServer()) |
41 | NetworkUtil.writeNodeObject(streamId, self.animatedObject) |
42 | streamWriteUIntN(streamId, self.direction + 1, 2) |
43 | end |