Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Make game.AddParticles return a table with all particles available #2115

Open gonzalologorg opened 1 year ago

gonzalologorg commented 1 year ago

This is a double edge sword, I can't explain how annoying it's to deal with particle editor and the client running simultaneously, but it's needed to know the particles names we are using

This way it's easier for developers to precache particles we need

local particles = game.AddParticle("particles/shared.pcf)
PrintTable(particles)
--["muzzleflash", "gunsmoke", ...]

The overlook here is that lazy developers will just precache all particles even when only few are needed (Since others might be children) stressing out particle stringtable, but it really would be helpful to use , even more now @robotboy655 it's working with particles

Pros: -Devs can make use of multiple particles from other addons which may improve art direction for mods -Devs won't need to use particle editor in order to see the particles they can use in game -It would help particle spawner tools to read particles and being able to spawn those (Since most particle spawner tools only rely on valve documentation of source engine particles)

Cons: -Useless and unused particles precached if not used correctly -Would increase load time since game has to read the whole particle definition? -Bad and generic naming on particles would generate duplicates more often due it accessibility

Zaurzo commented 1 year ago

yes please