Arevulopapo's Particle Engine for RPG Maker VX Ace

PK8

I sense there's something in the wind...
Veteran
Joined
Mar 17, 2012
Messages
1,220
Reaction score
152
Primarily Uses
I can't find Arevulopapo's original thread. I'm porting the original RMXP version of the script taken from this page (which was posted by me).


New Particle Engine for RPG Maker VX Ace


by Arevulopapo / port by PK8


Introduction


This script lets you create particle effects in your game. Particles are integrated into "Spriteset_Map", so the can be displayed over/under an event.


Features


This script lets you create particles.


Screenshot





Demo


Arevulopapo's Particle Engine (RMVXA)


http://dl.dropbox.com/u/68527961/RMVXA/Scripts/[2012]/Arevulopapo's%20Particle%20Engine.zip


Script


In the demo.


Instructions


All particle files are placed in the Graphics/Pictures/Particles folder. Read the script header and have a look at the demo to figure out how to call particles.


Thanks


mobychan for helping out and pointing me to 's RPG Maker VX's Ace tips and tricks page, which talked about how events set to parallel process need to be put in a loop in order for them to keep animating while events are being interacted with.
 
Last edited by a moderator:

Bravo2Kilo

ᕦ(ò_óˇ)ᕤ
Veteran
Joined
Mar 21, 2012
Messages
48
Reaction score
6
Primarily Uses
this is pretty awesome, great job on the port
 

DDay

Villager
Member
Joined
Apr 26, 2012
Messages
7
Reaction score
0
First Language
English
Primarily Uses
On the demo I noticed the fire place and checked if it had an Particle attached to it. truns out it dose play around with it seems to be broken or / make an script error. line Game_Interpreter 1411

but good job on the whole nice script but what with the fire place interest on what type of effect that will make.
 
Last edited by a moderator:

Bird Eater

Boredom is just another thing you want to avoid
Veteran
Joined
Mar 22, 2012
Messages
272
Reaction score
27
First Language
Dutch
Primarily Uses
Soooo pretty...

Also noticed the fireplace, you need to change

SceneManager.scene.effect(@event_id, ['fire2', 'fire'], 'event', 0, 8)

to

particle_effect(@event_id, ['fire2', 'fire'], 'event', 0, 8)

Thanks for converting this!
 
  • Like
Reactions: PK8

PK8

I sense there's something in the wind...
Veteran
Joined
Mar 17, 2012
Messages
1,220
Reaction score
152
Primarily Uses
No prob, guys.

And wow, derp moment #2 of the day for me. What's up with me? Anyway, just updated the demo again.
 
Last edited by a moderator:

Jamaz

Villager
Member
Joined
Apr 5, 2012
Messages
17
Reaction score
5
First Language
English
Primarily Uses
I'm totally tripping out with this demo.
 

Abysinian

Villager
Member
Joined
May 28, 2012
Messages
7
Reaction score
1
First Language
English
Primarily Uses
N/A
I think this script is fantastic, looks great and has a lot of uses.

There's one thing I was wondering, however. Is it possible to slow the particles down?

I'm wanting to have things like special switches which have a very slow stream of particles coming from them, just enough to make them stand out a bit, to show that they're important objects. Is this possible?

Cheers.
 

Argami

Veteran
Veteran
Joined
Jun 22, 2012
Messages
130
Reaction score
10
First Language
Spanish
Primarily Uses
It's possible to change the particle's speed? I think it works too fast :S

Thanks
 

Maus Merryjest

Veteran
Veteran
Joined
May 8, 2012
Messages
240
Reaction score
40
First Language
English
Primarily Uses
EDIT: Nevermind, it was my error :3
 
Last edited by a moderator:

AlaiaVee

Villager
Member
Joined
Mar 14, 2012
Messages
76
Reaction score
21
First Language
English
Primarily Uses
Thanks for posting this PK8! It's a pretty cool script.

Of course, now I have several ideas about how it can be improved upon, but it would probably require a major rewrite. I think I'll just add it to my list of things I'd like to do when I have time.

I think this script is fantastic, looks great and has a lot of uses.

There's one thing I was wondering, however. Is it possible to slow the particles down?

I'm wanting to have things like special switches which have a very slow stream of particles coming from them, just enough to make them stand out a bit, to show that they're important objects. Is this possible?

Cheers.
It's possible to change the particle's speed? I think it works too fast :S

Thanks
Yes, but unfortunately in this script's current state you cannot configure the speed when calling particle_effect. Instead you will have to edit the effect inside the script.

For example, to change the blue star particles I would find the following section under 'case effect':

when 'blue'

sprite='star_blue'

add_particles(object, x, y, sprite, [1.00*(-15+rand(30))/10, 1.00*(-15+rand(30))/10], [0,0], [160,5+rand(15)], lock, 1)

The format for the add_particles method is as follows:

add_particles(object, x, y, sprite, acceleration[x,y], gravity[x,y], opacity[base,loss], lock type, blending)

The values (object, x, y, sprite, and lock type) are all passed to the add_particles method based on the values you specified when calling particle_effect. So leave them alone. What you want to change are the values for acceleration and possibly gravity and opacity. First let's look at the current equation for x acceleration:

1.00*(-15+rand(30))/10

The 1.00 basically makes sure the result of the equation is a floating point.

As for rand(30), it will return an integer between 0 and 29 (I suspect the author meant to return an integer between 0 and 30)

Anyway, by subtracting 15 from the number and dividing it by 10 you end up with a range of -1.5 to 1.4. This value is then applied to the particle's X coordinate during every frame update. If you multiply this number by your frames per second (60) then you will see that the particle is potentially moving up to 90 pixels per second along the X axis.

How you choose to slow this down is entirely up to you. If you want to maintain a randomness of direction then make sure the result here can return both positive and negative results (causing the particle to randomly move forward or backwards, or in the case of Y acceleration, up or down). If you want a large variance in speed between the particles then make sure your random function allows for a large spread of numbers. Here are some examples of what you could set the acceleration to:

  • [.05, .05] - Will always move the same diagonal (down-right?) at about 3 pixels per second
  • [1.00*(-15+rand(31))/100], 1.00*(-15+rand(31))/100] - Almost the same configuration as before except it's 10 times slower (and I fixed the random range to [-15..+15])
  • [1.00*(-1+rand(2))/20, 1.00*(-1+rand(2))/20] - Can move any direction, but only at 3 pixels per second (could also remain stationary too).
  • [1.0*(rand(10) + 1)/10, 0] - Will only move forward on the X axis at anywhere from 6 - 60 pixels per second.

Now, on to the gravity setting. These values are subtracted from acceleration during each frame update. Some of the effects like fire, smoke, and sparks have a value here applied. Go ahead and play around with it if you want. My only recommendation is to keep the values for gravity small or your particles will fly away too fast.

I suppose I should also make a quick comment about opacity here. The way this script is written, the life of the particle is determined by it's opacity. The loss value is subtracted from the particle's opacity each frame update. Once a particle has faded to an opacity of 0 then it is disposed of. So if you want the particles to move slow and float around for a long time then set the opacity high (255 max) and the loss low. This behavior is one of the things I'd like to change in the script since I don't think the life of the particle should be tied to it's opacity level but rather a time value. (I plan on allowing the properties of a particle to fluctuate, for opacity this would be a ghosting in and out effect that can't be done in the current script)

Anyway, I hope these instructions help you get what you want. I actually enjoyed reading into this script to see what it does and how, so thanks for piquing my interest enough to investigate :)
 

Argami

Veteran
Veteran
Joined
Jun 22, 2012
Messages
130
Reaction score
10
First Language
Spanish
Primarily Uses
WOW! THANK YOU VERY MUCH VEE!!

Thanks for lose your time searching the answer. Your instructions are very clear, but I'm not good with scripts, so if I didn't understand something it's not for your explanation jajaja. You expressed it very well.

I have been playing with the scrpt and I think finally I got what I wanted. The idea was to make a fire more realistic, because the default fire looks like a hose splashing water xD. And here's the result (the video quality it's very bad):

I think that's better that way.
 

AlaiaVee

Villager
Member
Joined
Mar 14, 2012
Messages
76
Reaction score
21
First Language
English
Primarily Uses
Nice! That edited flame looks really good!
 

Chaos17

Dreamer
Veteran
Joined
Mar 13, 2012
Messages
1,281
Reaction score
450
First Language
French
@Argami : do youmind to tell us how you edited it please ?

I am not really good with english.
 

Argami

Veteran
Veteran
Joined
Jun 22, 2012
Messages
130
Reaction score
10
First Language
Spanish
Primarily Uses
I created a new particle with this code:



Code:
when 'fire3'
	  sprite='particle_orange'
	  add_particles(object, x, y, sprite, [((rand(5)-1)*0.18)/2, (-10+rand(150))/600], [0,0.1], [80,4+rand(2)], lock, 1)
I also made this other little fire (both are nearly equal):



Code:
when 'fire4'
	  sprite='particle_orange'
	  add_particles(object, x, y, sprite, [((rand(5)-1)*0.18)/1.4, (-10+rand(150))/600], [0,0.092], [100,4.5+rand(2.5)], lock, 1)
You don't ask me how I arrived at this result, because I simply don't know. I only touched and touched the code.. jajaja

And by the way, I noticed that the particles works different if you create an event without grafic, for that reason if you want to create only a flame or a particle you have to create an empty image and select it as a graphic. Here you can see it:



It's difficult to apreciate it in a static image but if you don't use graphic the particles lose lenght and gets a fireball aspect.

I don't know if I have been clear.
 
Last edited by a moderator:

KevinFrost

KevinFrost91
Veteran
Joined
Jul 19, 2013
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
I was wondering... The portal particle goes up. Would there be a way to make it go in a different direction? Say, left or right? And would it be possible to be able to change that throughout the game say with a conditional branch and a script call? (like say the player is facing left so the particle shoots right, and then they turn right and the particle shoots left.) Please and thank you!!

I absolutely love this script by the way! Way to go!! :D
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
I think you can modify it via playing with the positional parameters
 

KevinFrost

KevinFrost91
Veteran
Joined
Jul 19, 2013
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
Got a question. Is there any way to make it so you could turn the script on and off with either a script call or switch? I just thought that it would be nice to give players a chance in my game to turn particles on and off depending on if it is slowing their computer down. I would just do something like that myself and just tell all the events "Hey, if this switch is on be on page 2 and don't show particles" but I have hundreds of events that show particles and it would take forever... So, is there a way?
 
Last edited by a moderator:

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
96
First Language
Dutch
Primarily Uses
I know it's an old script. But what are the terms? Can I use this in a commercial project? Any credits required or is it public domain?
 

glatteis

Warper
Member
Joined
Mar 1, 2014
Messages
1
Reaction score
0
First Language
Germany
Primarily Uses
So, my problem is solved, sorry.

The effects look pretty great. Gotta keep a town burning down.
 
Last edited by a moderator:

AdamGlasier

Warper
Member
Joined
Mar 17, 2014
Messages
2
Reaction score
0
First Language
English
Primarily Uses
So can you make the particle effects (esp. flames) even larger? The code rather confuses me...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

have another character sheet! ill probably add some more details before i make my thread for this project
Every time the official RMWeb account makes a post, I think it's @Eliaquim writing it!

It's driving me crazy, but it's also wonderfully hilarious.
// Looks at Elfkisser, realizes he'd have to either install Windows 10 or compile it for Linux
// Didn't install Elfkisser.
Too much effort for a curiosity. :popcorn:
I was just high-fiving myself for all I've learnt in the engine, and how far I've come, only to forget to remove the Immortal state from a semi-scripted battle. Now the enemy never dies and I feel so smart >.>
Playtest your stuff. Always playtest.

Forum statistics

Threads
99,224
Messages
963,230
Members
130,813
Latest member
Gremter
Top