Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani - Emulate "Serverside" particle effects (https://forums.graalonline.com/forums/showthread.php?t=134269473)

samich 08-13-2014 04:20 PM

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!

Blah64 08-13-2014 04:58 PM

are you setting attrs to the ganiscript?

samich 08-13-2014 05:21 PM

No I'm not. How would I go about doing that?

Blah64 08-13-2014 06:45 PM

To initialize the script, set a player's attr to the gani:

player.attr[1] = "name.gani";

scriptless 08-13-2014 09:57 PM

Quote:

Originally Posted by Blah64 (Post 1729998)
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?

samich 08-14-2014 01:29 AM

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.

Blah64 08-14-2014 02:18 AM

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.

scriptless 08-14-2014 03:30 AM

Quote:

Originally Posted by Blah64 (Post 1730012)
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?

Blah64 08-14-2014 03:52 AM

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.

scriptless 08-14-2014 05:19 PM

Quote:

Originally Posted by Blah64 (Post 1730014)
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.

Jakov_the_Jakovasaur 08-14-2014 05:24 PM

Quote:

Originally Posted by scriptless (Post 1730027)
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

scriptless 08-14-2014 07:32 PM

Quote:

Originally Posted by Jakov_the_Jakovasaur (Post 1730028)
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?

Jakov_the_Jakovasaur 08-14-2014 07:38 PM

Quote:

Originally Posted by scriptless (Post 1730029)
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 


samich 08-15-2014 01:48 AM

I've tried so many test. I just can't get it.

samich 08-15-2014 03:16 AM

Got it now! Thanks for the assistance blah! (I guess I'm more tired than I thought haha)


All times are GMT +2. The time now is 11:52 PM.

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