Garry's Mod

Garry's Mod

评价数不足
[E2] Particle Core v3
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
文件大小
发表于
更新日期
33.707 KB
2020 年 1 月 17 日 上午 9:41
2020 年 1 月 23 日 上午 12:43
6 项改动说明 ( 查看 )

订阅以下载
[E2] Particle Core v3

描述
Allows E2s to create particles.

Improvement on particle core v1 ( https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1235042437 ) and particle core v2 by 343N ( https://psteamcommunity.yuanyoumao.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 条留言
Rezerkity 2021 年 8 月 17 日 上午 8:12 
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 bastard 2021 年 8 月 16 日 下午 8:53 
all of the postive comments are from your friends aswell. This chip can only output certain particles from the chip.
jon bastard 2021 年 8 月 16 日 下午 8:49 
How much of this addon works???? particlePos(nv) doesn't work at all.
jon bastard 2021 年 8 月 16 日 下午 3:23 
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 bastard 2021 年 8 月 16 日 下午 3:14 
How do we know what textures are usable???
Rezerkity 2021 年 4 月 23 日 上午 3:17 
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.
8eHg 2021 年 1 月 5 日 上午 8:29 
Is there any way to stop these through the chip after they've been started?
Elzzy 2020 年 12 月 1 日 下午 8:32 
Particles don't appear if you set the duration of the particle
and if you code particleStartAlpha or particleEndAlpha IT DOESN'T WORK
GABE2k2 2020 年 10 月 23 日 下午 10:59 
Hummmmm Interesting !
Sanders 2020 年 10 月 21 日 下午 12:40 
what particles did you use? as in where are they found?