Page MenuHomeFeedback Tracker

[Feature Request] ParticleCreated mission event handler
New, NormalPublic

Description

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)

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Particles

Event Timeline

Leopard20 created this task.Sep 5 2024, 5:56 PM
Leopard20 updated the task description. (Show Details)
h- added a subscriber: h-.Sep 8 2024, 8:28 AM
dedmen added a subscriber: dedmen.Sep 16 2024, 1:47 PM

since there can be thousands of them.

Yeah, and the eventhandler will be spammed alot, seems hard to do without causing lag.

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)

Rougle added a subscriber: Rougle.Oct 7 2024, 9:52 PM