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
SimParticleSystem
DescriptionThis pre-simulates a particle system so it doesn't start at zero when the game beginsFunctions
new
DescriptionCreating SimParticleSystemDefinition
new(integer name)Arguments
integer | name | node id |
table | instance | Instance of object |
21 | function SimParticleSystem:new(name) |
22 | local self = {}; |
23 | setmetatable(self, SimParticleSystem_mt); |
24 | self.id = name; |
25 | |
26 | local particleSystem = nil; |
27 | |
28 | if getHasClassId(self.id, ClassIds.SHAPE) then |
29 | local geometry = getGeometry(self.id); |
30 | if geometry ~= 0 then |
31 | if getHasClassId(geometry, ClassIds.PRECIPITATION) then |
32 | particleSystem = geometry; |
33 | end; |
34 | end; |
35 | end; |
36 | |
37 | if particleSystem ~= nil then |
38 | local lifespan = getParticleSystemLifespan(particleSystem); |
39 | addParticleSystemSimulationTime(particleSystem, lifespan); |
40 | end; |
41 | |
42 | return self; |
43 | end |
onCreate
DescriptionCreating SimParticleSystemDefinition
onCreate(integer id)Arguments
integer | id | node id |
13 | function SimParticleSystem:onCreate(id) |
14 | g_currentMission:addNonUpdateable(SimParticleSystem:new(id)); |
15 | end |