Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-09-2006, 04:27 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
The mass deletion of client. and clientr. variables! Yay!

So I want to be able to delete mass amounts of client. and clientr. variables in the most efficient way.

First thing I tried:

NPC Code:
for (temp.d : client.blah.getdynamicvarnames()) {
("client.blah." @ temp.d) = "";
}



A for loop that checks all the getdynamicvarnames() and deletes all that data in each sub variable. Problem here is you get a "folder depth" issue where you have to have for loops inside for loops if you have variables like this:
client.blah.rar.test (while trying to clear client.blah)

This method works but is obviously very lag intensive.

Second thing I tried:

NPC Code:
client.blah.copyfrom(null);



This is a much easier way to clear all the data and sub-variables in the variable but there remains a big problem with client. and clientr. variables:
If a client. or clientr. variable is cleared using a method such as copyfrom(), The effect can be seen on the side it is done on (clientside or serverside) but the effect does not transfer over to the other side and also does not save to the account (you don't see the changes if you do "/open account" in rc).

Third thing I tried

NPC Code:
client.blah = new TStaticVar("client.blah");
client.blah.destroy();
client.blah = new TGraalVar("client.blah");



Maybe making a client. or clientr. variable an object and then destroying it will work? Not quiet. It deletes all the data and sub-variables like we want but it has the same problem as above: The data does transfer to the other side.

So...

Anyone have another way to do this? Thoughts on the process? Ideas? Questions? Comments?

Thanks,
- Zero
__________________
Do it with a DON!
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:40 AM.


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