logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Storing/retrieving large amount of data in OnModuleLoad

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Dracos



Joined: 16 Oct 2006
Posts: 21

PostPosted: Fri Dec 22, 2006 10:16    Post subject: Storing/retrieving large amount of data in OnModuleLoad Reply with quote

I've tried to read and store a large amount of array data in OnModuleLoad, but after a while the script stops executing and all the code I put after is simply ignored (the script "crashes").

For 29 times I reiterate the following:
Code:

   ilevmin=1;
   ilevmax=12;
   for (i=ilevmin; i<ilevmax; i++)
      {
      SQL = "SELECT data_1, data_2 FROM *appropriate_table* WHERE data_3='"+IntToString(i)+" ' ";
       SQLExecDirect(SQL);
       while (SQLFetch())
          {
         data_1=SQLGetData(1);
         data_2=SQLGetData(2);      
         StoreArrayString("*string*"+IntToString(i), StringToInt(data1), data_2);
         }
      }


where StringToInt(data1) = array index
data_2 = value of the string


the function StoreArray is set properly (stores data in GlobalString) because if I reduce the amount of data the script fires. Is a LIMIT on the amount of GlobalInts (and GetModule Ints because if i change global with strings on the module is exactly the same, and so is the same if i fire the script on pc loaded!!!) or what??
Back to top
View user's profile Send private message MSN Messenger
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Fri Dec 22, 2006 12:11    Post subject: Reply with quote

Depending on how hefty that array fuction is, you might be hitting the script TMI limit. In nwn it was simply a matter of delaycommanding the script into smaller chunks to prevent the TMI (delaycommand or asssigncommand to another object restarts the TMI instruction count). You just do a few loops, then delaycommand the next few, then a longer delaycommand, etc etc. By contrast, I'm aware of no such limit on variables. Im unsure of what the TMI limit in nwn2 is, as I have yet to script in it.
Funky
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group