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 09-21-2010, 10:30 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 09-21-2010, 11:09 PM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
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
__________________

Reply With Quote
  #3  
Old 09-21-2010, 11:09 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
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
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #4  
Old 09-21-2010, 11:17 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Jiroxys7 View Post
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.
Reply With Quote
  #5  
Old 09-21-2010, 11:18 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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

Quote:
Originally Posted by oo_jazz_oo View Post
Edit: Attr[3] is not used for the hat, i was mistaken. Its used for the image of carried items. :P
Whoops, I didnt know that. crap. Is the attribute limit still at 20? (or was it 30?)

Quote:
Originally Posted by ffcmike View Post
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.
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 09-21-2010 at 11:31 PM..
Reply With Quote
  #6  
Old 09-22-2010, 08:45 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
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....?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #7  
Old 09-22-2010, 09:12 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
30 is the max
__________________
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 05:46 PM.


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