Garry's Mod

Garry's Mod

Not enough ratings
[E2] Particle Core v3
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
File Size
Posted
Updated
33.707 KB
17 Jan, 2020 @ 9:41am
23 Jan, 2020 @ 12:43am
6 Change Notes ( view )

Subscribe to download
[E2] Particle Core v3

Description
Allows E2s to create particles.

Improvement on particle core v1 ( https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1235042437 ) and particle core v2 by 343N ( https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=833933309 )

Disable v1 and v2 to run this properly.

Differences over previous versions:
Allows configuration of particles once before they need to be used so that the main chunk of data can be sent from the server to clients only once and then reused by the client
Allows multiple particle configurations in a single e2 without having to constantly send differing particle data
Adds back longer parameter setup functions (for more compact code) but also allows any particle property to be edited individually
Lots of different parameter options for functions so that code can written easily or compact, search "particle" in e2helper for a full list
Optimised net code to send less data per particle
Also re-adds legacy functions to make use with particle core v1 e2s easy (minimal code changes required)

Quick start example code: https://pastebin.com/q59KTy6B (shows multiple syntaxes including string index, number and legacy version)

Console vars:
sbox_e2_maxparticlespersecond - the maximum amount of particle actions that can be performed per second per player (default 100/sec)
sbox_e2_maxparticlesize - maximum size allowed for particles (default 64)
sbox_e2_alwaysrenderparticles - unused in this version
sbox_e2_maxparticlelifetime - maximum duration for particles (default 180 seconds)

E2 Functions:
particleCanCreate() - returns whether a particle can currently be created/edited by the current e2 (includes creating, starting and modifying actions)
particleMaxPerSecond() - returns the actions per second limit
particleCreate(index, ... ) - configure a particle with multiple different parameter options (check e2helper at the top right of the e2 editor for more specifics)
particleStart(index, pos, velocity, pitch) - starts a particle - this is the function that actually makes a particle appear after it has been configured
particleGravity(index, grav) - sets the gravity of a particle, all particle properties can be modified this way using their respective functions
particle<.......>(index, .......)
particleGetList() - returns an array of all valid particle materials (more than 100)
particleMaterialList(index,array) - lets you set a particle to have multiple materials that will be chosen randomly when the particle is ran using particleStart


Legacy syntax:
particle(Duration, StartSize, EndSize, string Path, vector Col, vector Pos, vector Vel)
particle(Duration, StartSize, EndSize, string Path, vector Col, vector Pos, vector Vel, Pitch)
Unlike in particle core v1 you use these above functions once and then use the below to create the particle:
particleStart(vector pos, vector vel, number pitch)

More samples:
Snow: https://pastebin.com/G0MCkhWt
Rain: https://pastebin.com/zjEWX2ks
16 Comments
Rezerkity 17 Aug, 2021 @ 8:12am 
Seems the only real functioning part of the code is when the index is set as a string, which is very clunky. The regular number-based indexing is very much broken.
jon b 16 Aug, 2021 @ 8:53pm 
all of the postive comments are from your friends aswell. This chip can only output certain particles from the chip.
jon b 16 Aug, 2021 @ 8:49pm 
How much of this addon works???? particlePos(nv) doesn't work at all.
jon b 16 Aug, 2021 @ 3:23pm 
Alright if you do this code:

@name
@inputs
@outputs
@persist Array:array I
@trigger

Array = particleGetList()

interval(100)
print(Array[I,string])
I++

Then the e2 will print out in the console (~) on the particles that are usuable. You might want to increase interval because it doesn't print out *everything* but it's better than nothing.
jon b 16 Aug, 2021 @ 3:14pm 
How do we know what textures are usable???
Rezerkity 23 Apr, 2021 @ 3:17am 
Many textures will return the default texture and not function, such as "flags16/bv.png".
Is it possible to increase the viable list of particles to textures as well?

particleDuration causes particles to never spawn from the chip, regardless of settings.
particlePos does not function, and will spawn particles from the chip regardless, particleStart(index,vector) does function however.

Particles do not collide with any non-brush entities.
80Hg 5 Jan, 2021 @ 8:29am 
Is there any way to stop these through the chip after they've been started?
Elzzy 1 Dec, 2020 @ 8:32pm 
Particles don't appear if you set the duration of the particle
and if you code particleStartAlpha or particleEndAlpha IT DOESN'T WORK
GABE2k2 23 Oct, 2020 @ 10:59pm 
Hummmmm Interesting !
Sanders 21 Oct, 2020 @ 12:40pm 
what particles did you use? as in where are they found?