Script v1.4.4.0
- Handtools
- Events
- Objects
- AnimatedObject
- Bale
- Basketball
- Bga
- BunkerSilo
- FieldDefinition
- FillablePallet
- HelpIcons
- MountableObject
- Nightlight2
- NightlightFlicker
- PhysicsObject
- Rotator
- SaplingPallet
- ShovelTarget
- SimParticleSystem
- StationCrane
- Storage
- TourIcons
- Train
- VehicleSellingPoint
- Placeables
- Triggers
- Utils
- Vehicles
- Specializations
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
SimParticleSystem
DescriptionThis pre-simulates a particle system so it doesn't start at zero when the game beginsFunctions
onCreate
DescriptionCreating SimParticleSystemDefinition
onCreate(integer id)Arguments
integer | id | node id |
15 | function SimParticleSystem:onCreate(id) |
16 | g_currentMission:addNonUpdateable(SimParticleSystem:new(id)); |
17 | end; |
new
DescriptionCreating SimParticleSystemDefinition
new(integer name)Arguments
integer | name | node id |
table | instance | Instance of object |
23 | function SimParticleSystem:new(name) |
24 | local self = {}; |
25 | setmetatable(self, SimParticleSystem_mt); |
26 | self.id = name; |
27 | |
28 | local particleSystem = nil; |
29 | |
30 | if getHasClassId(self.id, ClassIds.SHAPE) then |
31 | local geometry = getGeometry(self.id); |
32 | if geometry ~= 0 then |
33 | if getHasClassId(geometry, ClassIds.PRECIPITATION) then |
34 | particleSystem = geometry; |
35 | end; |
36 | end; |
37 | end; |
38 | |
39 | if particleSystem ~= nil then |
40 | local lifespan = getParticleSystemLifespan(particleSystem); |
41 | addParticleSystemSimulationTime(particleSystem, lifespan); |
42 | end; |
43 | |
44 | return self; |
45 | end; |