Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Gani Construction (https://forums.graalonline.com/forums/forumdisplay.php?f=50)
-   -   particle engine in a gani? (https://forums.graalonline.com/forums/showthread.php?t=62373)

prozac424242 11-19-2005 05:58 PM

particle engine in a gani?
 
I know how to put a light effect in a gani,
but is it possible to put in particle engine code into a gani?
I have particle engine code, but just not sure how it would interpret to gani code.

Codein 11-19-2005 06:20 PM

Wouldn't it be pointless? You could make sprites appear to be emitting something by hand :P

Lance 11-19-2005 07:24 PM

Quote:

Originally Posted by Codein
Wouldn't it be pointless? You could make sprites appear to be emitting something by hand :P

Sure, if you miss the point or want it to act in a way that the particle engine doesn't allow.

Fogles 11-19-2005 09:59 PM

Quote:

Originally Posted by Codein
Wouldn't it be pointless? You could make sprites appear to be emitting something by hand :P



I'm bored, I'll do it.

Codein 11-19-2005 10:12 PM

Quote:

Sure, if you miss the point or want it to act in a way that the particle engine doesn't allow.
I get it alright, but it'd look more..organic so to speak.

Yen 11-20-2005 04:51 AM

Quote:

Originally Posted by prozac424242
I know how to put a light effect in a gani,
but is it possible to put in particle engine code into a gani?
I have particle engine code, but just not sure how it would interpret to gani code.

It doesn't look like anyone's answered you, so..
Yes you can.

For anyone who wants to know how:
At the bottom of the gani, type
HTML Code:

SCRIPT

SCRIPTEND

Between the SCRIPT and SCRIPTEND, place the particle script.

Admins 11-20-2005 06:52 PM

Yes put the code into a gani script, if you do a gani for a projectile (shoot command) then you can retrieve the angle by reading player.angle

prozac424242 11-21-2005 09:01 PM

it works wonderfully! thanks!

Codein 11-21-2005 09:28 PM

This is kind of related, but how does Script work in Ganis? I'm trying to make spell that uses lighting effects.

--Chris-- 11-22-2005 12:00 AM

.Open in wordpad
.Type "SCRIPT"
.<insert script here>
.Type "SCRIPTEND"

Codein 11-22-2005 12:01 AM

Thanks. I'll experiment with it later :)

Admins 11-24-2005 12:45 AM

Quote:

Originally Posted by prozac424242
it works wonderfully! thanks!

Post some screenshots :D

prozac424242 11-24-2005 06:42 AM

1 Attachment(s)
Stefan asking me for something?
Ok yes I am happy to post a screenshot!

Me on the left with the particle engine eminating smoke in a modified idle.gani,
the fire on the right shows the same smoke script with different variables.
The smoke image the first frame of the old smokeani.gif / smokeani.mng
The level here and ganis are on Sanstrata Classic (in development)

Also, here in America it's Thanksgiving, so thank you Stefan for Graal,
it has been great fun the past five years that I have been playing and devloping with thee program, and I hope to enjoy it for many years to come.

Admins 11-26-2005 05:28 PM

Quote:

Originally Posted by prozac424242
Also, here in America it's Thanksgiving, so thank you Stefan for Graal,
it has been great fun the past five years that I have been playing and devloping with thee program, and I hope to enjoy it for many years to come.

Thanks for developing and improving playerworlds and such :D

Hmmm the particles-in-ganis might be interesting for effects like player-on-fire and foot-steps (in snow, water, grass) may be? The foot-steps in the water could be even animated

Malinko 11-26-2005 05:30 PM

Quote:

Originally Posted by Stefan
Hmmm the particles-in-ganis might be interesting for effects like player-on-fire and foot-steps (in snow, water, grass) may be? The foot-steps in the water could be even animated

Good way to ruin an idea for Kingdoms. :(

ApothiX 11-26-2005 05:51 PM

Quote:

Originally Posted by Malinko
Good way to ruin an idea for Kingdoms. :(

How is that ruining an idea?

Yen 11-28-2005 01:21 AM

I had been using a gani with a particle effect in a projectile.
However, the particles didn't follow the projectile's z. Is this a bug?
Can anyone check this out for me?

Admins 11-28-2005 02:44 PM

You have set the z value of the showimg/findimg ?

Yen 11-29-2005 10:39 PM

Yes, I tried updating the z with findimg. It still emitted at 0.

prozac424242 12-13-2005 12:25 AM

I have just recently tried using a particle effect in a gani where the player moves, and I have found that the x and y of the gani stay where the player was and do not follow the player. How do I get the particle effect to stay with the gani and the player? A timeout loop kills the particles, and setting the x and y in the gani makes no difference, please help.

Admins 12-13-2005 01:48 AM

Yen/prozac: what is the script that you have used? Remember that you must do "z = playerz"

There is also the new option "attachtoowner" to let the showimg+emitter automatically follow the player/npc/projectile

Yen 12-13-2005 05:58 AM

:) 'attachtoowner' fixed it, thanks!

prozac424242 12-13-2005 07:20 PM

Yes, Thank you again Stefan, here is the code that I put with a text editor after the ANIEND at the end of the file.
It makes little concentric circles around, or following, the player.

PHP Code:

SCRIPT
//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
  
x=playerx;
  
y=playery;
  
z=playerz;
  
attachtoowner true;
  
attachoffset = {0,0,0};
    
layer 2;
    
emitter.continueafterdestroy=true// looks much better!  thank you!
    
emitter.delaymin 0.05;
    
emitter.delaymax 0.1;
    
emitter.nrofparticles 180;
    
emitter.particle.lifetime 1;
    
emitter.particle.image "icemateria.gif"//or whatever image you like
    
emitter.particle.mode 1;
    
emitter.particle.alpha .4;
    
emitter.particle.red 1;
    
emitter.particle.green 1;
    
emitter.particle.blue 1;
    
emitter.particle.zoom .5;
    
emitter.particle.angle pi 2;
    
emitter.particle.spin=2.18;
    
emitter.particle.speed 5;
    
emitter.addlocalmodifier("once"00"angle""add", -5,5);
    
emitter.addlocalmodifier("range"01"alpha""replace",.4.01);
    
emitter.addlocalmodifier("range"01"zoom""replace",.5.01);
  }
}
SCRIPTEND 

However, even if I modify the x and y to be the player's x+1.5 and playery+1.5, that makes no difrence. the center of the emitter is still at the player's x and y.

Admins 12-15-2005 12:04 AM

Either you remove the attachoffset = line (it will use the current difference to the player position then), or you set attachoffset to a good value. So either this
PHP Code:

with (findimg(200)) {
  
playerx 1.5;
  
playery 1.5;
  
playerz;
  
attachtoowner true;


or this
PHP Code:

with (findimg(200)) {
  
attachtoowner true;
  
attachoffset = {1.5,1.5,0}; 


The second is the preferred method.


All times are GMT +2. The time now is 02:53 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.