Full Version : WAITUNTIL Usage and complex if?
xmlspawner >>Q&A >>WAITUNTIL Usage and complex if?


<< Prev | Next >>

godfood- 01-04-2006
QUOTE
Originaly Posted by CEO on the RunUO Forum's


Hey Arte,

I've got a sequential spawner, when I hit the last sequence I want the spawner to delay for 2 hours before it respawns.

I've tried:

WAITUNTIL,120/1
WAITUNTIL,,120/1

And a number of variants. However, I can't seem to get it to work, it always immediately restarts to sequence 1. Should I be using something like:

I've also tried:

GOTO/7 (7 being the final sequence) with a reset value of 120 instead, but sequence 1 immediately starts up.

Q2:

When doing property checks are () allowed? I tried doing something like:

alive = true & (bodyvalue = 400 | bodyvalue = 401)

and couldn't seem to get that to work.

----
Also, is it possible (I think this will be a feature request), to reorganize the spawner into sequence order? Sometimes while building a sequential spawner, I'll want to add something into an existing sequence, but have to put it at the bottom. Or sometimes I need to add a goto or new if statement, but I don't see of anyway to get that sequence line up to where it belongs. IE, maybe the ability to sort the spawner by sequence, and also a way to move a line up or down. Not sure if up/down would be absolutely needed but it would give the ability to organize a sequence of ifs statements in a specific order.

TIA!

godfood- 01-04-2006
QUOTE
Originally posted by ArteGordon on the RunUO Foum's


Q1: for just adding a simple delay this should work

WAITUNTIL,120

and then after that

GOTO/1

like this

CODE

<Spawns>
 <Points>
   <Name>waitspawn</Name>
   <UniqueId>9d5f1e12-41d2-40db-955d-2c9f33e3700b</UniqueId>
   <Map>Felucca</Map>
   <X>5435</X>
   <Y>1173</Y>
   <Width>10</Width>
   <Height>10</Height>
   <CentreX>5440</CentreX>
   <CentreY>1178</CentreY>
   <CentreZ>0</CentreZ>
   <Range>5</Range>
   <MaxCount>8</MaxCount>
   <MinDelay>0</MinDelay>
   <MaxDelay>0</MaxDelay>
   <DelayInSec>False</DelayInSec>
   <Duration>0</Duration>
   <DespawnTime>0</DespawnTime>
   <ProximityRange>-1</ProximityRange>
   <ProximityTriggerSound>500</ProximityTriggerSound>
   <TriggerProbability>1</TriggerProbability>
   <InContainer>False</InContainer>
   <MinRefractory>0</MinRefractory>
   <MaxRefractory>0</MaxRefractory>
   <TODStart>0</TODStart>
   <TODEnd>0</TODEnd>
   <TODMode>0</TODMode>
   <KillReset>1</KillReset>
   <ExternalTriggering>False</ExternalTriggering>
   <SequentialSpawning>2</SequentialSpawning>
   <AllowGhostTriggering>False</AllowGhostTriggering>
   <SpawnOnTrigger>False</SpawnOnTrigger>
   <SmartSpawning>False</SmartSpawning>
   <Team>0</Team>
   <Amount>1</Amount>
   <IsGroup>False</IsGroup>
   <IsRunning>True</IsRunning>
   <IsHomeRangeRelative>True</IsHomeRangeRelative>
   <Objects2>ratman:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:OBJ=WAITUNTIL,120:MX=1:SB=2:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:OBJ=troll:MX=1:SB=3:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:OBJ=GOTO/1:MX=1:SB=4:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1</Objects2>
 </Points>
</Spawns>




Q2: you cannot use parens to group tests. They are implicitly grouped by order like (A & (B & (C & D))), so you just have to order them accordingly, so this

alive = true & bodyvalue = 400 | bodyvalue = 401

would be grouped like this

alive = true & (bodyvalue = 400 | bodyvalue = 401)




Q3:
That feature is already there. It is the Sort button in the lower right corner of the spawner gump.

godfood- 01-04-2006
QUOTE
Originally posted by CEO on the RunUO Forum's


OMG, I've looked at the gump so many times I can't believe how I missed that! ohmy.gif Thanks for the quick answers!

Hmm, tried it like that, if I respawn on that sequence or complete the sequence before it (to advance to this sequence), there's a pause and the sequence 1 immediately starts without a 2 hour wait. I think this has something to do with the spawner also being a trigger? IE, the spawn initially starts when someone comes within range of it, then it should pause for 2 hours when it's completed, and then triggered again when someone walks within the trigger range.

Edit: Nope. Removed the trigger values. Same effect... /me stumped.

godfood- 01-04-2006
QUOTE
Originally posted by ArteGordon on the RunUO Forum's


did you try the spawner that I posted because that worked for me. You can post what didnt work for you and I can take a look at it.
What version are you running?

LowCastle- 01-31-2006
I'm working on a similar spawner. Here's how I've set it up:

In the properties I changed these default values:
Group=true
KillReset=12
MinDelay=20 seconds
MaxDelay=20 seconds
SequentialSpawn=0
SmartSpawning=true
SpawnRange=10

Here are my spawner entries:
Harpy max=2 sub=0 kills=2 rk=yes cl=no
Ogre max=2 sub=1 reset=3 to=0 kills=2 rk=yes cl=no
Cyclops max=1 sub=2 reset=3 to=1 kills=1 rk=yes cl=yes
WAITUNTIL,2 max=1 sub=3 rk=yes cl=yes

The problem I'm having is the WAITUNTIL command is not functioning properly when set up this way, and I'm not sure what is conflicting. I have tried every combination of rk=yes/no and cl=yes/no. I have tried adding the line GOTO/1 on sub=4 but that really isn't necessary since the sequence loops. Either way, the spawn DOES delay after the cylops is killed, but only for 30-40 seconds, then the harpies spawn again. I tried setting the WAITUNTIL,40 and still only achieved a 30-40 second delay.

I did figure out a way to get a longer delay. I changed it to:
WAITUNTIL,2 max=1 sub=3 reset=2 to=0 kills=1 rk=yes cl=yes

That will give me a 2 minute delay after I kill the cyclops. changing reset to 5 will produce a 5 minute delay. But in this case the WAITUNTIL is only useful as an intangible that cannot be killed before the reset kicks in.

Can you tell me what I did wrong? I'm using version 3.05 updated sometime after Christmas.

ArteGordon- 01-31-2006
Turn off the 'Group' flag on the spawner. In general, setting Group to true when using sequential spawning doesnt give you what you expect when using those delay type keywords. I'll have to look into that.

LowCastle- 02-01-2006
That explains it!
Thanks! I can't thank you enough for all of the Q&A work you've done for all of us. And this site has been an indespensible resource for information.

ArteGordon- 02-01-2006
thanks. I'll try to get a "real" explanation when I dig around into the behavior of delay keywords with the Group setting.
It is a little tricky because I have to think about what is actually the "right" thing to do when the Group flag is set with sequential spawning.

Group is an original distro spawner property for standard spawning conditions and so wasnt really intended for anything else.
That doesnt mean that you shouldnt use it, just that it isnt something that was designed to be used under those conditions, so the behavior might not be what you expect.

What Group does under standard conditions is to suppress any new spawning until all the spawns on the spawner are cleared, and then it does a full respawn - so clear them all, and then get them all back as a group.