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 
 
Getting Multiple Rows one at a time
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Jun 27, 2007 19:15    Post subject: Reply with quote

I'm like totally out of ideas right now... you could export the relevant 8 lines from your table into a csv file and post it in a code section below. Maybe I can pinpoint the problem when I have access to the same data.

(you can backup your database using mysqladmin and then copy the create and insert statements from the resulting text file)
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
utimagus



Joined: 22 Jun 2007
Posts: 20

PostPosted: Thu Jun 28, 2007 1:28    Post subject: Reply with quote

Code:
AreaTag   WaypointTag   MobResRef   MobTag   IsBoss   SpawnOnlyAtNight   DespawnAtDayBreak   SpawnOnlyDuringDay   DespawnAtTwilight   SpawnChance
Valdedomus   spawn_valdedomus_wilddog1   krs_badger01   valdedomus_wilddog1   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog2   krs_badger01   valdedomus_wilddog2   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog3   krs_badger01   valdedomus_wilddog3   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog4   krs_badger01   valdedomus_wilddog4   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog5   krs_badger01   valdedomus_wilddog5   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog6   krs_badger01   valdedomus_wilddog6   0   0   0   0   0   100
Valdedomus   spawn_valdedomus_wilddog7   krs_badger01   valdedomus_wilddog7   0   0   0   0   0   100


the cvs is also available at http://loi2-test.game-server.cc:668/database.csv if you need the file itself.
Back to top
View user's profile Send private message
utimagus



Joined: 22 Jun 2007
Posts: 20

PostPosted: Sun Jul 01, 2007 13:27    Post subject: Reply with quote

any progress?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jul 08, 2007 20:22    Post subject: Reply with quote

Not yet, I didn't get a chance in the meantime... will try within the next couple of days, though.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Jul 14, 2007 16:22    Post subject: Reply with quote

I reproduced your environment and got the following result:

Code:

[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog1
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog2
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog3
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog4
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog5
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog6
[Sat Jul 14 16:19:40] Got WayPointTag: spawn_valdedomus_wilddog7
[Sat Jul 14 16:19:40] Exited loop! Fetched rows: 7


This is the code I used, a slight variation on your example:

Code:

   //get the information of all the mobs to spawn in the area
    string sSQL = "SELECT WaypointTag,MobResRef,MobTag,IsBoss,SpawnOnlyAtNight,DespawnAtDayBreak,SpawnOnlyDuringDay,DespawnAtTwilight,SpawnChance FROM Spawn_Data WHERE AreaTag='Valdedomus'";
    SQLExecDirect(sSQL);
   int iCount = 0;

   //cycle throguh the entries till we are out of them
    while(SQLFetch())
    {     
      string sWaypointTag = SQLGetData(1);   //this is the first datafield returned by the query
      string sMobResRef = SQLGetData(2);
      string sMobTag = SQLGetData(3);
     
      int iIsBoss = StringToInt(SQLGetData(4));
      int iSpawnOnlyAtNight = StringToInt(SQLGetData(5));
      int iDespawnAtDayBreak = StringToInt(SQLGetData(6));
      int iSpawnOnlyDuringDay = StringToInt(SQLGetData(7));
      int iDespawnAtTwilight = StringToInt(SQLGetData(8));
      int iSpawnChance = StringToInt(SQLGetData(9));

     WriteTimestampedLogEntry("Got WayPointTag: " + sWaypointTag);
          
      //see if the mob exists, if so bail
      if(GetObjectByTag(sMobTag) != OBJECT_INVALID)
      {
      }
     else
      {
         //everything checks, spawn that bitch!
         CreateObject(OBJECT_TYPE_CREATURE,sMobResRef,GetLocation(GetWaypointByTag(sWaypointTag)),TRUE, sMobTag);
      }
      iCount++;
    }
   
   WriteTimestampedLogEntry("Exited loop! Fetched rows: " + IntToString(iCount));


Since it works here, and not for you, there has to be something else in between.

Maybe the call to GetTimer() disturbs the loops ? Please try to get rid of all the extra function calls in the if-then-else statements.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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