View previous topic :: View next topic |
Author |
Message |
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Wed Jun 27, 2007 19:15 Post subject: |
|
|
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 |
|
|
utimagus
Joined: 22 Jun 2007 Posts: 20
|
Posted: Thu Jun 28, 2007 1:28 Post subject: |
|
|
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 |
|
|
utimagus
Joined: 22 Jun 2007 Posts: 20
|
Posted: Sun Jul 01, 2007 13:27 Post subject: |
|
|
any progress? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Jul 08, 2007 20:22 Post subject: |
|
|
Not yet, I didn't get a chance in the meantime... will try within the next couple of days, though. _________________ Papillon |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Jul 14, 2007 16:22 Post subject: |
|
|
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 |
|
|
|