Scripts / ParticlesAddEmitter?

Author
Message
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 30th Jul 2017 20:01
Hi. Is there any tutorial on how to use the ParticlesAddEmitter command? I seem to lack the basic understanding of it and whatever I write, nothing useful comes out. This is the "best" I've come up with it so far:

It creates a ridiculously fast smoke effect.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2017 21:53
Check out this thread:

https://forum.game-guru.com/thread/218347#msg2582757

If you compare what you did with what I did then maybe you can work it out, if you do please explain it to me.
Been there, done that, got all the T-Shirts!
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 1st Aug 2017 00:40
I dont really intend to play around with it much till it supports more particle assets. Believe you can still only use the smoke one?
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Aug 2017 20:09
@ Moshroom
Do you means you are getting something like this?



3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 7th Aug 2017 12:24
Quote: "Believe you can still only use the smoke one?"

It seems like it.
Quote: "Do you means you are getting something like this?"

Pretty much.

However I was able to figure out some ideas on how the command works. The key realization is that the command creates a particle emitter field relative to player position. Here are what I undestand about the parameters:

animationSpeed : I have no idea what this does. I'm using 1.
startsOffRandomAngle : I have no idea what this does. I'm using 0.

offsetMinX, offsetMinY, offsetMinZ, offsetMaxX, offsetMaxY, offsetMaxZ : These define the position of the particle emitting field relative to player position. If you want to have 100 x 100 x 100 field around player, set these 6 to to -50, -50, -50, 50, 50, 50.

scaleStartMin, scaleStartMax : These define the size range of the particles while they appear. I suggest 0 or 100. (Whether you want growing or shrinking particles)
scaleEndMin, scaleEndMax : These define the size range of the particles while they disappear. I suggest 0 or 100. (Different than the previous.)

movementSpeedMinX, movementSpeedMinY, movementSpeedMinZ, movementSpeedMaxX, movementSpeedMaxY, movementSpeedMaxZ : These define the direction range where the particles move. If min and max are set to same values but opposite signs, the particles move to both directions in an axis. For the effect to look anything that makes sense (as smoke effect) I suggest to use values smaller than 1. Rising and spreading smoke can be created with -1,0,-1,1,1,1.

rotateSpeedMinZ, rotateSpeedMaxZ : I have no idea what these do. Just left them to 0.

lifeMin, LifeMax : I'm not 100 % sure, but these seem to define how long the particles are visible. The effect looks ok when these are set to 0 and 10000.

alphaStartMin, alphaStartMax : These define the opacity range when the particles appear. My suggestion is 10,100, so the particles are visible when they appear.
alphaEndMin, alphaEndMax : These define the opacity range when the particles disappear. My suggestion is 0,1, so the particles fade away instead of disappearing suddenly.

frequency : This defines how often do the particles appear. I suggest to use value smaller than 1 unless you want to create a mess.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Aug 2017 13:46
wait, so you can't move or place the emitter manually?
does it follow the player once spawned?
i wonder what the intention of it is, just for rain box and stuff?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 7th Aug 2017 16:50 Edited at: 7th Aug 2017 16:52
Yes (at least when called like this):

However you can make an entity emit the particles if you use the distances of player and entity as the offsetnnnN coordinates :
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 7th Aug 2017 17:02 Edited at: 7th Aug 2017 21:39
I wrote a simple function to turn an entity into an actual emitter (instead of just making particles appear near player):

Add the above function to your script between init() and main() and call it like this:

First parameter is entity ID (e), second tells the source of the emitter (0 = player, 1 = calling entity), third the amount of particle spreading (0 = straight up, etc), fourth is the frequency/10, fifth the maximum size of the particles and sixth defines whether particles grown or shrink (0 = grow, 1 = shrink).

Edit: smallg, answers to your previous question: the field created with the command as I showed in the previous post does follow player. I don't know why it is so. The rain box is a good guess. The only way to make the emitter stay in one place is to make the script always calculate the coordinates of that place relative to player location before calling the emitter command (my solution as showed in this post is to calculate distance of player and the emitter entity in each axis and use that distance as both min and max value in that axis, so the "field" will become a spot that is located inside the entity no matter where player moves).

Login to post a reply

Server time is: 2024-12-23 00:19:21
Your offset time is: 2024-12-23 00:19:21