Jump to content


Photo

Arevulopapo's Particle Engine for RPG Maker VX Ace


  • Please log in to reply
29 replies to this topic

#1 PK8

PK8

    I sense there's something in the wind...

  • Members
  • 510 posts
  • LocationSpiral Hill
  • Primarily UsesRMXP

Posted 12 May 2012 - 02:42 PM

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.co...icle Engine.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 Archeia_Nessiah'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, 15 October 2014 - 06:44 AM.

  • Chaos17, TearsOfNightfall, Holder and 20 others like this

I'm currently not supporting any of my scripts because I recently came back from a lengthy hiatus. I will begin revamping almost all of them in due time. For now, look at the Progress page on my site to check my current progress.
 

CALLING ALL SCRIPTERS
Let's improve $imported!
$imported Expansion | $imported[:SCRIPT_LIST] | Cross-engine Scripting

Spoiler

#2 Bravo2Kilo

Bravo2Kilo

    ᕦ(ò_óˇ)ᕤ

  • Members
  • 23 posts
  • LocationU.S.
  • Primarily UsesRMVX Ace

Posted 12 May 2012 - 05:15 PM

this is pretty awesome, great job on the port
Posted Image I have a blog now where I will be posting my scripts that I create
My Favorite Animes:
1. Full Metal Panic (all 3 seasons)
2. Dragonaut the Resonance
3. The Legend of the Legendary Heroes
4. Spice and Wolf
5. Rosario + Vampire

Spoiler

#3 DDay

DDay

    Member

  • Members
  • 13 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 12 May 2012 - 05:57 PM

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, 12 May 2012 - 06:04 PM.


#4 Bird Eater

Bird Eater

    Boredom is just another thing you want to avoid

  • Members
  • 147 posts
  • Primarily UsesRMVX Ace
  • First LanguageDutch

Posted 12 May 2012 - 06:06 PM

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

#5 PK8

PK8

    I sense there's something in the wind...

  • Members
  • 510 posts
  • LocationSpiral Hill
  • Primarily UsesRMXP

Posted 12 May 2012 - 06:09 PM

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, 12 May 2012 - 06:09 PM.

  • ShinGamix likes this

I'm currently not supporting any of my scripts because I recently came back from a lengthy hiatus. I will begin revamping almost all of them in due time. For now, look at the Progress page on my site to check my current progress.
 

CALLING ALL SCRIPTERS
Let's improve $imported!
$imported Expansion | $imported[:SCRIPT_LIST] | Cross-engine Scripting

Spoiler

#6 Jamaz

Jamaz

    Member

  • Members
  • 15 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 13 May 2012 - 12:09 AM

I'm totally tripping out with this demo.

#7 Abysinian

Abysinian

    Newbie

  • Members
  • 7 posts
  • LocationScotland
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 27 May 2012 - 12:57 PM

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.

#8 Argami

Argami

    Advanced Member

  • Members
  • 64 posts
  • Primarily UsesRMVX Ace
  • First LanguageSpanish

Posted 24 June 2012 - 11:43 AM

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

#9 Maus Merryjest

Maus Merryjest

    Advanced Member

  • Members
  • 116 posts
  • LocationColorado
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 25 June 2012 - 12:42 PM

EDIT: Nevermind, it was my error :3

Edited by Maus Merryjest, 25 June 2012 - 12:54 PM.

Come support my game!

 

supportbar_zps4bc13d1f.png

 

MausSiggie.png


#10 Vee

Vee

    Advanced Member

  • Early Adopter+
  • 72 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 25 June 2012 - 05:35 PM

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 :)
  • PK8, Argami and flimbo like this
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
"Give them something they don't expect" - Quote by my grandfather
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

self.be_self until self.awesome - just a fun way to express a motto of mine:
Be true to yourself, awesomeness is attained by sticking to your guns and
consistently doing things that are in line with the person you strive to be.

#11 Argami

Argami

    Advanced Member

  • Members
  • 64 posts
  • Primarily UsesRMVX Ace
  • First LanguageSpanish

Posted 26 June 2012 - 01:32 PM

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

#12 Vee

Vee

    Advanced Member

  • Early Adopter+
  • 72 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 26 June 2012 - 03:22 PM

Nice! That edited flame looks really good!
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
"Give them something they don't expect" - Quote by my grandfather
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

self.be_self until self.awesome - just a fun way to express a motto of mine:
Be true to yourself, awesomeness is attained by sticking to your guns and
consistently doing things that are in line with the person you strive to be.

#13 Chaos17

Chaos17

    Advanced Member

  • Early Adopter+
  • 648 posts
  • LocationFrance
  • Primarily UsesRMVX Ace
  • First LanguageFrench

Posted 26 June 2012 - 07:04 PM

@Argami : do youmind to tell us how you edited it please ?
I am not really good with english.

ban.png
 


#14 Argami

Argami

    Advanced Member

  • Members
  • 64 posts
  • Primarily UsesRMVX Ace
  • First LanguageSpanish

Posted 27 June 2012 - 09:07 AM

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:

Posted Image

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, 27 June 2012 - 10:51 AM.

  • Chaos17 likes this

#15 KevinFrost

KevinFrost

    Phrostbyte

  • Members
  • 14 posts
  • LocationNorthern Utah, USA
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 19 July 2013 - 12:17 AM

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, 19 July 2013 - 12:22 AM.

Current Projects At SircleSoft Studios (Website) (Blog)

Nyan%20Cat%20Button.jpg Shallows%20Island%20Button.jpg

Nyan%20Cat%20GIF.gif

Spoiler

#16 Engr. Adiktuzmiko

Engr. Adiktuzmiko

    Chemical Engineer, Game Developer, Using BlinkBoy's Avatar

  • Member+
  • 7,413 posts
  • LocationPhilippines
  • Primarily UsesRMVX Ace
  • First LanguageTagalog

User's Awards

     

Posted 19 July 2013 - 02:00 AM

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



#17 KevinFrost

KevinFrost

    Phrostbyte

  • Members
  • 14 posts
  • LocationNorthern Utah, USA
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 19 July 2013 - 01:12 PM

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, 01 September 2013 - 01:42 AM.

Current Projects At SircleSoft Studios (Website) (Blog)

Nyan%20Cat%20Button.jpg Shallows%20Island%20Button.jpg

Nyan%20Cat%20GIF.gif

Spoiler

#18 Napoleon

Napoleon

    Advanced Member

  • Members
  • 843 posts
  • Primarily UsesRMVX Ace
  • First LanguageDutch

Posted 08 November 2013 - 08:09 AM

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?


  • MISTER BIG T likes this
The Devil's Deal Progress: Sig.png
My Scripts Collection & Demo

#19 glatteis

glatteis

    Newbie

  • Members
  • 1 posts
  • Primarily UsesRMVX Ace
  • First LanguageGermany

Posted 16 March 2014 - 09:54 AM

So, my problem is solved, sorry.

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


Edited by glatteis, 16 March 2014 - 09:56 AM.


#20 AdamGlasier

AdamGlasier

    Newbie

  • Members
  • 2 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 16 March 2014 - 03:24 PM

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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users