Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani Script/player.attr problems (https://forums.graalonline.com/forums/showthread.php?t=134260594)

Jiroxys7 09-21-2010 10:30 PM

Gani Script/player.attr problems
 
So I'm using a script that checks to see if a param isnt null, then if so, checks what that param is, then runs through a list of what it should be doing with that param. i'm working on 'binding' ganis to buffs in this way. now, everything's working for the most part, except the gani scripts are doing something weird:

First of all, when the param tells the script to set one of the player's attributes, to, in this case, a particle, itll be all fine and dandy. but for some reason, in order to clear that attribute when the param doesnt exist anymore, i need to set the player's attribute to a nonexistant gani. "player.attr[3] = null" doesnt cut it for some reason.

Now the bigger issue: The buff will run out (which will clear the param), removing the gani, but when I cast the buff again, from that point forward, until i reconnect, the gani seems to not want to show until a certain time has elapsed. I've tried messing around with the gani's script. things such as changing the lifetime of the particle and changing the max number of particles doesnt do anything. and if i set continueafterdestroy = true, it still wont work when I can visually see that the particle has ended. and will stay hidden for an unknown period of time until some time has elapsed. I've tried using a scheduleevent trick that i read elsewhere and that didnt seem to help either. I'm pretty convinced it's not actually a problem within the gani script, but possibly a problem with the player.attr system that needs to be worked around in a certain way.

So yeah, has anyone run into this problem before? And/or know what might be causing my problem?

oo_jazz_oo 09-21-2010 11:09 PM

If you want to clear the attribute, just use player.attr[#] = "";

Edit: Attr[3] is not used for the hat, i was mistaken. Its used for the image of carried items. :P

Fulg0reSama 09-21-2010 11:09 PM

the player.attr[3] should be

PHP Code:

player.attr[3] =""

that gani problem you mention I forget how to fix however with the reappearances.

edit: Jazz beat me to the punch :P

ffcmike 09-21-2010 11:17 PM

Quote:

Originally Posted by Jiroxys7 (Post 1601828)
Now the bigger issue: The buff will run out (which will clear the param), removing the gani, but when I cast the buff again, from that point forward, until i reconnect, the gani seems to not want to show until a certain time has elapsed. I've tried messing around with the gani's script. things such as changing the lifetime of the particle and changing the max number of particles doesnt do anything. and if i set continueafterdestroy = true, it still wont work when I can visually see that the particle has ended. and will stay hidden for an unknown period of time until some time has elapsed. I've tried using a scheduleevent trick that i read elsewhere and that didnt seem to help either. I'm pretty convinced it's not actually a problem within the gani script, but possibly a problem with the player.attr system that needs to be worked around in a certain way.

So yeah, has anyone run into this problem before? And/or know what might be causing my problem?

Sounds similar to what would happen if you were using the onCreated event within the gani script as opposed to onPlayerEnters.

Jiroxys7 09-21-2010 11:18 PM

Alright, I'll give that a shot.

Edit: Alright, I did that and set it to [10] instead and it seems to be working now. thanks guys :D

Quote:

Originally Posted by oo_jazz_oo (Post 1601850)
Edit: Attr[3] is not used for the hat, i was mistaken. Its used for the image of carried items. :P

:eek: Whoops, I didnt know that. crap. Is the attribute limit still at 20? (or was it 30?)

Quote:

Originally Posted by ffcmike (Post 1601852)
Sounds similar to what would happen if you were using the onCreated event within the gani script as opposed to onPlayerEnters.

I've gotten into the habit of using onCreated for some of the particle scripts because with onPlayerEnters, I noticed that it gets buggy with certain mods like movex and movey and will start stacking every time you enter the level that the npc is in. so if it's movex + 3, then you leave and enter two more times, to that client it will act like a movex + 9.

MrOmega 09-22-2010 08:45 AM

I believe attr go to like 99 or 255 now, I'm not sure but I use attr[22] and it works, but it may be 30....?

xAndrewx 09-22-2010 09:12 AM

30 is the max ^^


All times are GMT +2. The time now is 12:28 PM.

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