PK8

Arevulopapo's Particle Engine for RPG Maker VX Ace

35 posts in this topic

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

30uz1ur.jpg

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.

Edited by PK8

Share this post


Link to post
Share on other sites

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.

Edited by DDay

Share this post


Link to post
Share on other sites

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!

PK8 likes this

Share this post


Link to post
Share on other sites

No prob, guys.

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

Edited by PK8
ShinGamix likes this

Share this post


Link to post
Share on other sites

I'm totally tripping out with this demo.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Thanks

Share this post


Link to post
Share on other sites

EDIT: Nevermind, it was my error :3

Edited by Maus Merryjest

Share this post


Link to post
Share on other sites

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 :)

flimbo, PK8 and Argami like this

Share this post


Link to post
Share on other sites

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, AmnesiacJack and PK8 like this

Share this post


Link to post
Share on other sites

Nice! That edited flame looks really good!

Share this post


Link to post
Share on other sites

@Argami : do youmind to tell us how you edited it please ?

I am not really good with english.

Share this post


Link to post
Share on other sites

I created a new particle with this 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):


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:

fireud.jpg

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.

Edited by Argami
BCj and Chaos17 like this

Share this post


Link to post
Share on other sites

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

Edited by KevinFrost

Share this post


Link to post
Share on other sites

I think you can modify it via playing with the positional parameters

Share this post


Link to post
Share on other sites

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?

Edited by KevinFrost

Share this post


Link to post
Share on other sites

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?

Tuomo L likes this

Share this post


Link to post
Share on other sites

So, my problem is solved, sorry.

The effects look pretty great. Gotta keep a town burning down.

Edited by glatteis

Share this post


Link to post
Share on other sites

So can you make the particle effects (esp. flames) even larger? The code rather confuses me...

Share this post


Link to post
Share on other sites

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?

 

I second Napoleon, I really would like to know the terms of this script. 

Share this post


Link to post
Share on other sites

The dropbox link is down. Does anyone have a copy of the demo?

Share this post


Link to post
Share on other sites

I was doing some cleaning up on my Dropbox to make room for better/revamped scripts and demos.

Here's a link but it's not going to be permanent. [Link]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.