Full Version : Turning spawners off and on
xmlspawner >>Q&A >>Turning spawners off and on
<< Prev | Next >>
Ravenwolfe- 03-18-2006
Is there a way to have the spawners turn off and on based on a certain day of week, time period, or anything similar to that?
What I am trying to do is have several spawners that spawn rare items. The spawners will spawn an item every 2 hours if the item has been taken. But I only want certain spawners on certain days. Right now I manually turn them off and on. Is there an easier way?
ArteGordon- 03-18-2006
from xmlspawner2.txt

QUOTE
- added several timekeeping properties to XmlDialog entries that allows you to control their activation based upon time of the day, day of the week, day of the month, or phase of the moon. These properties are: GameTOD - has values of the form hh:mm:ss, so 14:00:00 would be 2pm
RealTOD - has values of the form hh:mm:ss
RealDayOfWeek - has values Sunday, Monday, etc. Note, these are enums so when referring to them in property tests precede them with a #, like "RealDayOfWeek=#Monday"
RealDay - has values 1-31
RealMonth - has values 1-12
MoonPhase - has values NewMoon, WaxingCrescentMoon, FirstQuarter, WaxingGibbous, FullMoon, WaningGibbous, LastQuarter, WaningCrescent
There are a number of ways that you might use these new properties.
By setting the Home property on an npc which will cause it to wander to that location. By setting Home at different times, you can have your npcs go to different places throughout the day.
You could also have certain conversations that could only be carried out at certain times of the day, or days of the week.
For example, setting the Condition field in an xmldialog entry to
GameTOD>12:00:00 & GameTOD<16:00:00
would restrict its activation to between the times of 12 and 4pm
- added an example of the use of these new properties in a .npc file timeofday.npc, and a spawner example that loads it up onto an npc in timeofday.xml. To test it out, just do an "[xmlloadhere timeofday.xml". The npc will respond with the day of the week in his banter, and if you respond with the keyphrase "hello", you will get different responses depending on the time of day (game time), and even the day of the week (he doesnt work on Sunday).

you can set object triggering conditions on the spawner based on those properties, so you could
1) set the TriggerObject property on a spawner to point to itself, and then
2) set the TriggerObjectProperty to something like
RealDay=18
to restrict spawning to the 18th day of every month. You can use any of the other timekeeping properties, and/or combinations of them, like
RealDayOfWeek=#Monday | RealDayOfWeek=#Thursday
to have a spawn that only occurs on Monday or Thursday.
You can also combine this with any of the other triggering properties, like TOD or speech etc.
Ravenwolfe- 03-18-2006
Oh duh! I was so focused on turning them off, I forgot about just setting the spawns for TOD....Thanks Arte!
ArteGordon- 03-18-2006
yeah, you can use TOD along with the additional day/date control that I described to get pretty much any time-specific spawning pattern that you want.