This is gonna get windy, so bear with me.
Following FNW's old Tutorial for creating spawn_events (
found here), I set out on the arduous journey of trying to make day/night shifts spawn *anywhere*. I tried the suggested additions from the tutorial, watched the spawns in East Waste for Korrigain, and even checked the data from Cavedude's database that had some Kithicor shifts in it. None of them yield the expected result. Here's an analysis of over 6 hours of testing...
Created 2 new NPCs - DayTest, NightTest.
Went into game, #zone load2 so I could test privately, and spawned my 2 new NPCs in their own locations, and added them to the spawn tables. I verified that #repop did in fact re-spawn my 2 new NPCs.
Added 2 spawn_conditions using the template from the tutorial, changing the zone to "load2", but leaving the other data alone.
Code:
insert into spawn_conditions (zone,id,value,onchange,name) VALUES('load2', 1, 0, 2, 'Test Day Shifts');
insert into spawn_conditions (zone,id,value,onchange,name) VALUES('load2', 2, 1, 2, 'Test Night Shifts');
I then added the spawn_events per the tutorial, again changing only the data for my test zone:
Code:
INSERT INTO spawn_events (id,zone,cond_id,name,period,next_minute,next_hour ,next_day,next_month,next_year,enabled,action,argument)
VALUES(1,'load2',1,'Enable Day Shift',720, 0, 6, 9, 1, 3100, 1, 0, 1);
INSERT INTO spawn_events (id,zone,cond_id,name,period,next_minute,next_hour ,next_day,next_month,next_year,enabled,action,argument)
VALUES(2,'load2',1,'Disable Day Shift',720, 0, 18, 9, 1, 3100, 1, 0, 0);
INSERT INTO spawn_events (id,zone,cond_id,name,period,next_minute,next_hour ,next_day,next_month,next_year,enabled,action,argument)
VALUES(3,'load2',2,'Enable Night Shift',720, 0, 18, 9, 1, 3100, 1, 0, 1);
INSERT INTO spawn_events (id,zone,cond_id,name,period,next_minute,next_hour ,next_day,next_month,next_year,enabled,action,argument)
VALUES(4,'load2',2,'Disable Night Shift',720, 0, 6, 9, 1, 3100, 1, 0, 0);
Checking my zone time when I was in, the system seems to start on Jan 1, 3100. So if I read the next_* info correctly, I should not expect to see this event take place until the 9th day(?) so I did change that - next_day = 2 for all events.
While in game, I also ran #mlog setcat SPAWNS on so I could see what's going on.
I then started the load2 zone static so it was always running.
Watching the log, I saw my day-shift NPC spawn properly. YAY! I thought we were in business. But after 720 EQ minutes, he despawned, and all hell broke loose in my perfect world. This is where the 6 hours comes in, because I was sure I had something setup wrong.
What I was seeing was the despawn of NPC-Day went ok, but the spawning of NPC-Night was prohibited by condition 2 (see log below). What happened next was the "next_hour" setting for the disable day and enable night shifts both switched to the same hour as the enable day, disable night. In other words, all 4 events are firing at the same moment (again, see failed log).
Logs -
Successful spawn of night-shift during zone startup (expected, and happy):
Code:
[10.29. - 17:41:27] [SPAWNS__MAIN] Spawn2 378216: Spawn reset, repop in 1200000 ms
[10.29. - 17:41:32] [SPAWNS__MAIN] Spawn2 378216: Timer has triggered
[10.29. - 17:41:32] [SPAWNS__MAIN] Spawn2 378216: Group 1433713 spawned Jak_NightSpawn (185001) at (-291.228, 48.029, -723.523). Grid loading delayed.
[10.29. - 17:41:32] [SPAWNS__MAIN] Spawn2 378215: Timer has triggered
[10.29. - 17:41:32] [SPAWNS__CONDITIONS] Spawn2 378215: spawning prevented by spawn condition 1
[10.29. - 17:41:32] [SPAWNS__MAIN] Spawn2 378215: Spawn reset, repop in 1200000 ms
[10.29. - 17:41:38] [SPAWNS__MAIN] Spawn2 378216: Spawn reset, repop in 1200000 ms
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded spawn condition 1 with value 1 and on_change 2
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded spawn condition 2 with value 1 and on_change 2
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded enabled spawn event 1 on condition 1 with period 720, action 0, argument 1
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded enabled spawn event 2 on condition 1 with period 720, action 0, argument 0
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded enabled spawn event 3 on condition 2 with period 720, action 0, argument 1
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Loaded enabled spawn event 4 on condition 2 with period 720, action 0, argument 0
[10.29. - 17:43:11] [SPAWNS__CONDITIONS] Next event determined to be event 1
[10.29. - 17:43:11] Default weather for zone is:1
[10.29. - 17:43:12] [SPAWNS__MAIN] Spawn2 378216: Timer has triggered
[10.29. - 17:43:12] [SPAWNS__MAIN] Spawn2 378216: Group 1433713 spawned Jak_NightSpawn (185001) at (-291.228, 48.029, -723.523). Grid loading delayed.
[10.29. - 17:43:12] [SPAWNS__MAIN] Spawn2 378215: Timer has triggered
[10.29. - 17:43:12] [SPAWNS__MAIN] Spawn2 378215: Group 1433712 spawned Jak_DaySpawn (185000) at (-230.391, 52.381, -723.523). Grid loading delayed.
(not completely sure why there was a second spawning 2 mins later but both NPCs were there when I zoned in)
First despawn (20 mins later), repopped and took out the night-shift as expected as well:
Code:
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Event 1: Executing. Setting condition 1 to 1.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Local Condition update requested for 1 with value 1, which is what we already have.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Event 1: Will trigger again in 720 EQ minutes at 01/03/3100 18:00.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Next event determined to be event 4
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Event 4: Executing. Setting condition 2 to 0.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Local Condition update requested for 2 with value 0
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Zone notified that spawn condition 2 has changed from 1 to 0. Notifying all spawn points.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Spawn2 378216: Notified that our spawn condition 2 has changed from 1 to 0. Our min value is 1.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Spawn2 378216: Our condition is now disabled. Preforming a repop.
[10.29. - 18:03:17] [SPAWNS__MAIN] Spawn2 378216: Spawn reset, repop immediately.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Event 4: Will trigger again in 720 EQ minutes at 01/03/3100 18:00.
[10.29. - 18:03:17] [SPAWNS__CONDITIONS] Next event determined to be event 1
[10.29. - 18:03:18] [SPAWNS__MAIN] Spawn2 378216: Timer has triggered
[10.29. - 18:03:18] [SPAWNS__CONDITIONS] Spawn2 378216: spawning prevented by spawn condition 2
[10.29. - 18:03:18] [SPAWNS__MAIN] Spawn2 378216: Spawn reset, repop in 1200000 ms
So far, so good. But here's where it went wrong. On the next event cycle, both spawn_condition values were set to 0, neither could spawn, and the rest of the night, the zone could not get the NPCs to spawn.
3 things to note: The Opcode error (might not have a thing to do with it):
Code:
[10.29. - 18:14:32] Unable to convert EQ opcode 0x6a5f to an Application opcode.
[10.29. - 18:14:32] [CLIENT__NET_ERR] Jak: Unhandled incoming opcode: [OpCode OP_Unknown (0x6a5f) Size=8]
This "mini spawn attempt @ 23 mins:
Code:
[10.29. - 18:23:18] [SPAWNS__MAIN] Spawn2 378216: Timer has triggered
[10.29. - 18:23:18] [SPAWNS__CONDITIONS] Spawn2 378216: spawning prevented by spawn condition 2
[10.29. - 18:23:18] [SPAWNS__MAIN] Spawn2 378216: Spawn reset, repop in 1200000 ms
(con't next post)