Jump to content


Photo

Arevulopapo's Particle Engine for RPG Maker VX Ace


  • Please log in to reply
13 replies to this topic

#1 PK8

PK8

    Close the window.

  • Members
  • 455 posts
  • LocationStanding on the backs of angels
  • Primarily UsesRMXP
  • First LanguageEnglish

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
Posted Image

Demo
Arevulopapo's Particle Engine (RMVXA)

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.
Single-handedly putting an end to the monopolisation of the scripting forums. Proud member of The Underground and JIFZ-NFPZ.
pk8.png fb.png tw.png yt.png

Have you ever wanted to attach switches, variables, and various information onto your Actors, Events, Classes, Skills, Armors, Items, Weapons, and Skills? Now you can. The Self Data Suite -- The Most Extensive Set of Scripts Around (also available for RPG Maker XP and VX)

#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
  • 146 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

    Close the window.

  • Members
  • 455 posts
  • LocationStanding on the backs of angels
  • Primarily UsesRMXP
  • First LanguageEnglish

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.

Single-handedly putting an end to the monopolisation of the scripting forums. Proud member of The Underground and JIFZ-NFPZ.
pk8.png fb.png tw.png yt.png

Have you ever wanted to attach switches, variables, and various information onto your Actors, Events, Classes, Skills, Armors, Items, Weapons, and Skills? Now you can. The Self Data Suite -- The Most Extensive Set of Scripts Around (also available for RPG Maker XP and VX)

#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
  • 40 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

  • Member+
  • 109 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+
  • 70 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 :)
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
"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
  • 40 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.

#12 Vee

Vee

    Advanced Member

  • Early Adopter+
  • 70 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+
  • 489 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
  • 40 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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users