Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-13-2014, 04:20 PM
samich samich is offline
Registered User
samich's Avatar
Join Date: Jan 2007
Posts: 59
samich will become famous soon enough
Send a message via MSN to samich
Gani - Emulate "Serverside" particle effects

I've read other posts and I just can't figure it out or get it right. I was wondering if anyone could possibly help me with getting particles to display through a gani (as I've heard, its possible to do) so that some of the effects will show on all players screens.

I've tried several attempts at getting them to display, but it always failed to show to all players.

I know you have to plug in SCRIPT ENDSCRIPT tags into the gani file, but as for displaying the gani, I just don't follow. I feel like maybe I've setup the effect wrong in the gani, such as how it should initialize and continue playing. I just want it to show after an onWeaponFired() call, and turn off after another call.

Simple this.on = !this.on weapon with a gani (for testing).

Any help is much appreciated!
__________________
[Graal Related Business]
Reply With Quote
  #2  
Old 08-13-2014, 04:58 PM
Blah64 Blah64 is offline
Registered User
Blah64's Avatar
Join Date: Oct 2012
Posts: 20
Blah64 is on a distinguished road
are you setting attrs to the ganiscript?
Reply With Quote
  #3  
Old 08-13-2014, 05:21 PM
samich samich is offline
Registered User
samich's Avatar
Join Date: Jan 2007
Posts: 59
samich will become famous soon enough
Send a message via MSN to samich
No I'm not. How would I go about doing that?
__________________
[Graal Related Business]
Reply With Quote
  #4  
Old 08-13-2014, 06:45 PM
Blah64 Blah64 is offline
Registered User
Blah64's Avatar
Join Date: Oct 2012
Posts: 20
Blah64 is on a distinguished road
To initialize the script, set a player's attr to the gani:

player.attr[1] = "name.gani";
Reply With Quote
  #5  
Old 08-13-2014, 09:57 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Blah64 View Post
To initialize the script, set a player's attr to the gani:

player.attr[1] = "name.gani";
I've seen this before. But can this pass gani params too? And what are the cords of this gani? If I did idle.gani for example would it align with my player in such a way that it looks like 1 gani or can u see both?
Reply With Quote
  #6  
Old 08-14-2014, 01:29 AM
samich samich is offline
Registered User
samich's Avatar
Join Date: Jan 2007
Posts: 59
samich will become famous soon enough
Send a message via MSN to samich
If anyone has a small example, I feel that would be the best way to go about it... I'm still a little confused on how to effectively do this.
__________________
[Graal Related Business]
Reply With Quote
  #7  
Old 08-14-2014, 02:18 AM
Blah64 Blah64 is offline
Registered User
Blah64's Avatar
Join Date: Oct 2012
Posts: 20
Blah64 is on a distinguished road
I believe, sending params to the script is done:

player.attr[1] = "name.gani,param1,param2,param3,etc.";

then they are set as the params for onPlayerEnters() in the gani script.

As for 'player position', I don't think it actually sets the player's gani when you set the attr, you need to do setani() for that still. I might be wrong, but I think it just sets the script part of the gani, so you don't have to worry about it looking like multiple ganis.

example:

NPC Code:
onActionProjectile()
{
player.attr[2] = "";
player.attr[2] = "display_hp.gani";
scheduleevent(2,"reset",null);
}

onReset()
{
player.attr[2] = "";
}




Note: I usually clear the attr to "" whenever I set the gani script because I remember there were issues with the script not updating if it was already running when you decide to set it again.
Reply With Quote
  #8  
Old 08-14-2014, 03:30 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Blah64 View Post
I believe, sending params to the script is done:

player.attr[1] = "name.gani,param1,param2,param3,etc.";

then they are set as the params for onPlayerEnters() in the gani script.

As for 'player position', I don't think it actually sets the player's gani when you set the attr, you need to do setani() for that still. I might be wrong, but I think it just sets the script part of the gani, so you don't have to worry about it looking like multiple ganis.

example:

NPC Code:
onActionProjectile()
{
player.attr[2] = "";
player.attr[2] = "display_hp.gani";
scheduleevent(2,"reset",null);
}

onReset()
{
player.attr[2] = "";
}




Note: I usually clear the attr to "" whenever I set the gani script because I remember there were issues with the script not updating if it was already running when you decide to set it again.
I ment where is the attr[]'s gani position in relation to the player's position? In other word how does it know to display below, or above player?
Reply With Quote
  #9  
Old 08-14-2014, 03:52 AM
Blah64 Blah64 is offline
Registered User
Blah64's Avatar
Join Date: Oct 2012
Posts: 20
Blah64 is on a distinguished road
There's nothing to display, it isn't displaying any actual 'gani'. It is just running the 'gani script', which is usually particle effects. The location of the particle effects are determined by the script, usually in relation to player.x/y and with setting the layer to determine whether it is above things or below things.
Reply With Quote
  #10  
Old 08-14-2014, 05:19 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Blah64 View Post
There's nothing to display, it isn't displaying any actual 'gani'. It is just running the 'gani script', which is usually particle effects. The location of the particle effects are determined by the script, usually in relation to player.x/y and with setting the layer to determine whether it is above things or below things.
Oh ok. Now I understand. I seen someone use a gani in an attr and it showed a gani wad why I asked. They must have used a gani script to show a gani. Explains alot.
Reply With Quote
  #11  
Old 08-14-2014, 05:24 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 354
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by scriptless View Post
Oh ok. Now I understand. I seen someone use a gani in an attr and it showed a gani wad why I asked. They must have used a gani script to show a gani. Explains alot.
its more efficient than using a gani scripted showimg();, plus since v6 you can set LAYER 0 in the text to force the gani to show below the player
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #12  
Old 08-14-2014, 07:32 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
its more efficient than using a gani scripted showimg();, plus since v6 you can set LAYER 0 in the text to force the gani to show below the player
In what text? The attrtext? Or as text in the file somewhere outside the script and scriptend tags?
Reply With Quote
  #13  
Old 08-14-2014, 07:38 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 354
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by scriptless View Post
In what text? The attrtext? Or as text in the file somewhere outside the script and scriptend tags?
as text within the gani file, like so:

PHP Code:
LOOP
CONTINUOUS
SINGLEDIRECTION
DEFAULTHEAD 
DEFAULTBODY
LAYER 0 
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #14  
Old 08-15-2014, 01:48 AM
samich samich is offline
Registered User
samich's Avatar
Join Date: Jan 2007
Posts: 59
samich will become famous soon enough
Send a message via MSN to samich
I've tried so many test. I just can't get it.
__________________
[Graal Related Business]
Reply With Quote
  #15  
Old 08-15-2014, 03:16 AM
samich samich is offline
Registered User
samich's Avatar
Join Date: Jan 2007
Posts: 59
samich will become famous soon enough
Send a message via MSN to samich
Got it now! Thanks for the assistance blah! (I guess I'm more tired than I thought haha)
__________________
[Graal Related Business]
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 12:22 PM.


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