Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Particle effects (https://forums.graalonline.com/forums/showthread.php?t=71465)

Raeiphon 01-15-2007 01:56 PM

Particle effects
 
Help?

I've tried over and over to get particle emitters to work - the wiki documentation is nice, but not what i'm looking for. I learn best off working examples and I have no idea where to find any. I'm trying to create an emitter/effect that makes the player trail a little (Zodiac has a similar) effect. Could anyone assist me here? Code snippets, advice, where to start, anything is welcome.

napo_p2p 01-17-2007 08:00 AM

http://forums.graalonline.com/forums...ad.php?t=60909

Attached to that thread is a tutorial written by TGC and an emitters demo scripted by Stefan.

Admins 01-18-2007 12:12 AM

Finding examples is simple, check your levels/ganis folder, particle effects are often stored in gani script.

Raeiphon 01-19-2007 01:58 PM

Thanks for the assistance, but now I have another problem:

I want every player in the level to see said particle effects. The particle effect in mind would radiate over my player. The only way I can think of doing this is by gani scripting and showani, but I have no experience with either.

Help?

Angel_Light 01-19-2007 02:57 PM

1 Attachment(s)
Here a script I found somewhere long ago, helped me learn alot from particles and how they work.

Chompy 01-19-2007 03:50 PM

Quote:

Originally Posted by Raeiphon (Post 1266303)
Thanks for the assistance, but now I have another problem:

I want every player in the level to see said particle effects. The particle effect in mind would radiate over my player. The only way I can think of doing this is by gani scripting and showani, but I have no experience with either.

Help?

Yup, you gotta use gani script :)

Raeiphon 01-20-2007 06:57 AM

Any basic examples on how to get an emitter to work inside a gani, and how to display that gani through showani?

Chandler 01-20-2007 08:24 AM

Quote:

Originally Posted by Raeiphon (Post 1266595)
Any basic examples on how to get an emitter to work inside a gani, and how to display that gani through showani?

If you're attaching the gani to the player, use an attribute. Example:
HTML Code:

player.attr[4] = "sword.gani";
You'd mainly use attributes if you were wanting something to follow a player that other people could also see. Let's say a light- or an aura; for example.


HTML Code:

showani(index, this.x, this.y, direction, gani, params);
showani(300, this.x, this.y, 2, "sword", NULL);
showani(1, this.x, this.y, 2, "sword", NULL);

As you can see, it's clientside and also serverside! You can modify this also, like so
HTML Code:

with(findimg(index))
{
  //and ok
}

Not too sure why you'd decide to use this over the player.attr, maybe if you wanted to display something that wasn't connected to the player, yet interacted with the player in some way?

Gani scripting is generally used when you're wanting something to show for everyone, such as an effect. You'd most-likely use gani script in combination with the player.attr command.
Inside the gani, you'd insert something like this:
HTML Code:

SCRIPT
function onPlayerEnters()
{
  with(findimg(200))
  {
    //doParticle effects
  }
  setTimer(0.05);
}
function onTimeout()
{
  findimg(200).# = ##;
  setTimer(0.05);
}
SCRIPTEND

As you can see, you can also pretty much add anything inside of the gani. You can't edit this locally, the NPC-server would read the script from the gani inside the servers FTP.
You'd now need to know more about particles, I suggest opening a few Graal Kingdoms spell effects, they're mostly particles and they help you to understand how they work. [They're the gani's, 'g2k2_spell#']


All times are GMT +2. The time now is 01:20 PM.

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