Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-15-2007, 01:56 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
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.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #2  
Old 01-17-2007, 08:00 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
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.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 01-18-2007, 12:12 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Finding examples is simple, check your levels/ganis folder, particle effects are often stored in gani script.
Reply With Quote
  #4  
Old 01-19-2007, 01:58 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
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?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #5  
Old 01-19-2007, 02:57 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Here a script I found somewhere long ago, helped me learn alot from particles and how they work.
Attached Files
File Type: txt emitters.txt (16.2 KB, 381 views)
__________________
Deep into the Darkness peering...
Reply With Quote
  #6  
Old 01-19-2007, 03:50 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Raeiphon View Post
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
__________________
Reply With Quote
  #7  
Old 01-20-2007, 06:57 AM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Any basic examples on how to get an emitter to work inside a gani, and how to display that gani through showani?
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #8  
Old 01-20-2007, 08:24 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Raeiphon View Post
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#']

Last edited by Chandler; 01-20-2007 at 09:21 AM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:35 PM.


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