It's not very efficient to use allObjects to get the particles since there can be thousands of them.
Having an EH similar to "EntityCreated" to track particles in a mission would be really handy. (I personally need it for AI modding)
(alternative name: CloudletCreated)
Description
Details
- Severity
- Feature
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 10 x64
- Category
- Particles
Event Timeline
since there can be thousands of them.
Yeah, and the eventhandler will be spammed alot, seems hard to do without causing lag.
Yeah you can add a warning on wiki for that. In a single frame the game creates ~30 particles when an explosion occurs, and ~2 per frame for smokes. It won't be terrible if the scripter handles it properly. (tho idk how slow it is to just call a script by the game)
To make it a bit faster, what if you store all particles created during a frame and call all events at the end of frame simulation? (instead of calling them exactly in the part of the code that creates the particles)
It's ok if the event passes an array of particles instead of calling it one by one for each particle. (you can lock the array to prevent user modification between calls)