Full Version : Setting up a very special spawn.
xmlspawner >>XMLSpawner - Discussion >>Setting up a very special spawn.
<< Prev | Next >>
XavierWER- 07-25-2006
Evening, im a Seer on UODivinity and ive setup quite abit of special spawns
with the use of xmlspawner, actually the whole world is spawned via regionspawning
on xmlspawner.
Anyway, I got an idea for a very special spawn that ive been attempting to setup.
The overall idea:
A player will be able to get hold of a special map (simplemap).
Initially this map will have one pin (location) on it, telling the player where to go next.
When the player gets close to this location a xmlspawner will trigger on the map
being carried and spawn a group of monsters, upon killing all the monsters the map
will recieve a new pin togo a new location. Until after 10 locations it ends up at
a specefic location where theres a final "boss" to the whole hunt.
For each new location the spawn gets abit tougher, like on the first pin
theres just a few gargoyles, and then on the fifth pin theres daemons... and so on
and so forth.
Each new pin added will be random between about 50 locations.
So I need to setup xmlspawners at each of these locations, that trigger on the map
and spawns monsters depending on what the current pin number is.
The whole map buisness is easy, Simplemap has properties to add new pins
(NewPinLocation) read the newest pin location(PinLocation, and the number of pins
on the map (NPin).
The spawner triggersoncarried ",simplemap" proximityrange 5.
Ive been having some trouble with the first entry... using:
Subgroup 1:
IF/GETONCARRIED,,simplemap,PinLocation = ( {GETONTHIS,x}, {GETONTHIS,y} )/2/1
Subgroup 2:
mongbat (just to test so that it works)
Ive double checked so that the PinLocation x/y is the same as the x/y on the
spawner. But it doesnt work. I even used SENDMSG/({GETONTHIS,x},{GETONTHIS,y}) to see if it was properly formated, and it was
I even tried SETVAR/GETVAR to set and get the x/y, but didnt work either
tested it with SENDMSG aswell.
And I believe I just froze up the server from all...
Prior to this, when testing with setting the x/y manually, I ran into alot of trouble
getting the sequential part to work.
Spawner:
Triggeroncarried ",simplemap" proximityrange 5 Min/MaxDelay 10 seconds.
1: IF/GETONCARRIED,,simplemap,PinLocation = (5276, 1164)/3
2: GOTO/1
3: IF/GETONCARRIED,,simplemap,Npin = 1/11
3: IF/GETONCARRIED,,simplemap,Npin = 2/22
3: IF/GETONCARRIED,,simplemap,Npin = 3/33
3: IF/GETONCARRIED,,simplemap,Npin = 4/44
3: IF/GETONCARRIED,,simplemap,Npin = 5/55
3: IF/GETONCARRIED,,simplemap,Npin = 6/66
3: IF/GETONCARRIED,,simplemap,Npin = 7/77
3: IF/GETONCARRIED,,simplemap,Npin = 8/88
3: IF/GETONCARRIED,,simplemap,Npin = 9/99
4: GOTO/1
11: 5x mongbat
12: 1x orc
Mongbats represent the monster group you need to kill
And orc represents the new pin that will be added to the map.
Triggering and everything worked perfectly, when the simplemap had Pinlocation
5276, 1164 and Npin = 1 the mongbats spawned. But not often in the correct
amount. Only way to get all 5 mongbats to spawn was to have a very large
MaxCount on the spawner, if it was just 5 then only 2 spawned.
Ive tested all sorts of things, group spawning true/false, setting Per to 5 on mongbats
basicly everything, and ive been at it for hours.
Ive been using xmlspawners for well over 2 years, if not more.
Self proclaimed xmlspawner god etc. Basicly I know how to setup more or less
anything. But I cant get this to function...
Anyone got any insight on these two problems?
ArteGordon- 07-25-2006
well, the issue with the mongbat number is due to the way that those IF spawn entries are counted as spawns.
When any keyword entry is spawned, it actually adds to the spawn count as long as it is active. It actually does create a spawn object (a keyword token) that is tracked internally and so that is what is being counted.
So the spawner maxcount has to take those keyword "spawns" into consideration.
The problem with this line
IF/GETONCARRIED,,simplemap,PinLocation = ( {GETONTHIS,x}, {GETONTHIS,y} )/2/1
may be a simple formatting thing with spaces in the (x,y) construction.
Try removing the spaces after the parentheses, like
({GETONTHIS,x}, {GETONTHIS,y})
I would just do a [get pinlocation on the simple map and see exactly what the format for that looks like.
If you cant get it to do the location comparison correctly, you can also just do it by comparing the x and y values separately like
IF/GETONCARRIED,,simplemap,PinLocation.X = {GETONTHIS,x} & GETONCARRIED,,simplemap,PinLocation.y = {GETONTHIS,y}/2/1
I'll also check out the location comparison myself and see if there is some problem with point2D tests.
(edit)
point2D tests default to simple string comparisons of the results, so the spaces will matter.
XavierWER- 07-25-2006
btw I found what caused the server to totally freeze.
in:
IF/GETONCARRIED,,simplemap,PinLocation = ( {GETONTHIS,x}, {GETONTHIS,y} )/2/1
I at one time used ,PinLocation= instead of ,PinLocation =
XavierWER- 07-25-2006
sorry for double post...
The main problem with the mongbat spawner wasnt actually that not all
the mongbats spawned, but that it didnt advance to orc after the mongbats was
killed.
I noticed that it kept going back to Subgroup 1 all the time
ArteGordon- 07-25-2006

QUOTE (XavierWER @ July 25, 2006 04:00 pm)
sorry for double post... The main problem with the mongbat spawner wasnt actually that not all the mongbats spawned, but that it didnt advance to orc after the mongbats was killed. I noticed that it kept going back to Subgroup 1 all the time

when subgroups are spawned as part of an IF conditional, it doesnt actually advance the sequential index to that subgroup. Think of them like a subroutine that is executed and then control flow returns to the caller.
The GOTO keyword actually changes the sequential index. So if you didnt want it to return to the calling entry, you could do this
11: 5x mongbat
11:GOTO/12
12: 1x orc
and so when it spawned the mongbats, it would also set the sequential index to 12 and then it would continue to advance from there.
Also, I did test out the location test and it didnt want to work. I'll have to check that out. Doing the test with x and y did work though.
ArteGordon- 07-25-2006

QUOTE (XavierWER @ July 25, 2006 03:57 pm)
btw I found what caused the server to totally freeze. in: IF/GETONCARRIED,,simplemap,PinLocation = ( {GETONTHIS,x}, {GETONTHIS,y} )/2/1 I at one time used ,PinLocation= instead of ,PinLocation =

hmm. that is a puzzle. The space before the = operator shouldnt make any difference.
What probably caused it to freeze was that the IF test entry calls subgroup 1 if the test fails, but subgroup 1 is the IF entry, which then fails and calls subgroup 1, etc.
So there is an infinite recursive loop. This is related to the discussion of how subgroups in conditionals are spawned as suubroutines instead of advancing the sequential index.
I will look into adding some protection against that kind of accidental recursion.
XavierWER- 07-25-2006
It went down again, and yeah thats the problem.
Did a typo
1: IF/GETONCARRIED,,simplemap,PinLocation =(5285, 1156/2/1
Forgot a ) which caused it to loop over and over.
Odd thing was that the spawner was set to trigger on speech but still caused the
freeze even when it wasnt triggered.
ArteGordon- 07-25-2006
right.
1: IF/GETONCARRIED,,simplemap,PinLocation =(5285, 1156/2/1
will always fail and and so will always call subgroup 1 which creates the infinite loop.
1: IF/GETONCARRIED,,simplemap,PinLocation =(5285, 1156)/2
1:GOTO/1
this way is not an infinite loop since the GOTO/1 doesnt actually cause subgroup 1 to be executed, but instead just sets the sequential index to 1 so that will be the subgroup spawned on the next spawner ontick.
(edit)
if you entered that entry and then clicked the uparrow to bump the maxcount for it while the spawner was active, it would cause the entry to be spawned regardless of the triggering settings.
XavierWER- 07-25-2006
yeah, would be great with a fix so that wouldn't happen.
Ive only had xmlspawner crash a server once, now ive done it twice in a day.
admins gonna have my head
ArteGordon- 07-25-2006

QUOTE (XavierWER @ July 25, 2006 05:00 pm)
yeah, would be great with a fix so that wouldn't happen. Ive only had xmlspawner crash a server once, now ive done it twice in a day. admins gonna have my head

hehe. yeah, I'll add some protection (for the looping, not your head...)
XavierWER- 07-25-2006
Gotten a spawner setup now that works perfectly, spawns different groups
of monsters depending on how many pins is on the map. Resets back to normal
perfectly, but ive run into my final problem.
After you complete a spawn the map should get a new pin added to it
ive got the map part covered with SETVAR on the map serial.
But my problem now is setting random X/Y locations.
I first thought it just use
SETVAR,RndX/{RNDLIST,x,x,x,x} and SETVAR,RndY/{RNDLIST,y,y,y,y}
but then the X & Ys will be missmatched.
x1 & y1 works, x1 & y3 doesnt. If you get my drift.
Since RNDLIST only works for int I tried using RNDSTRLIST
{RNDSTRLIST,(x, y),(x, y)}
but I ended up with "(x" etc.
Tried using <> and even "" but the RND allways reacts to the commas.
ArteGordon- 07-26-2006
yeah, the problem is that the current parser doesnt allow you to ignore certain restricted chars like / or , in strings. The literal-to-end-of-line @ operator allows you do to that, but it is limited.
I am expanding the literal @ operator so that it can be used as a general delimiter to tag things like @(x, y)@ so that any char can be included in strings to deal with situtations like this.
To do it with the current limitations you could set up a series of SETVAR entries in different subgroups, and then just randomly select the subgroup
subgroup 50: SETVAR,Rndloc/(1000, 2000)
subgroup 51: SETVAR,Rndloc/(1500, 400)
etc.
subgroup 60:SETVAR,Rndloc/(300, 1400)
and then then do something like
IF/somecondition/{RND,50,60}
and the substitution will cause one of the randomly selected setvar subgroups to be executed
for example, take a look at this spawner

CODE
<Spawns> <Points> <Name>Rndloc</Name> <UniqueId>e9b3ceb4-bc90-4bf2-a8d0-cd4c8daa51d2</UniqueId> <Map>Felucca</Map>
<X>5434</X>
<Y>1139</Y>
<Width>10</Width>
<Height>10</Height>
<CentreX>5439</CentreX>
<CentreY>1144</CentreY>
<CentreZ>0</CentreZ>
<Range>5</Range>
<MaxCount>6</MaxCount>
<MinDelay>3</MinDelay>
<MaxDelay>3</MaxDelay>
<DelayInSec>True</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>1</SequentialSpawning>
<AllowGhostTriggering>False</AllowGhostTriggering>
<AllowNPCTriggering>False</AllowNPCTriggering>
<SpawnOnTrigger>False</SpawnOnTrigger>
<SmartSpawning>False</SmartSpawning>
<Team>0</Team>
<Amount>1</Amount>
<IsGroup>False</IsGroup>
<IsRunning>False</IsRunning>
<IsHomeRangeRelative>True</IsHomeRangeRelative>
<Objects2>IF/true=true/{RND,20,22}:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETONNEARBY,5,,playermobile/MSG/location is {GETVAR,Rndloc}:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=GOTO/1:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETVAR,Rndloc/(100, 200):MX=1:SB=20:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETVAR,Rndloc/(300, 1500):MX=1:SB=21:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETVAR,Rndloc/(400, 1100):MX=1:SB=22:RT=0:TO=0:KL=0:RK=0:CA=1:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
</Points>
</Spawns>

XavierWER- 07-26-2006
problem now is that ive actually used up all the 60 spawn entries for the
different monster groups to spawn.
I did have the thought of putting all the newloc list on a secondary spawner,
would be kinda good since ive planned to have about 50 different locations
so each location will have a spawner each.
Thats why ive used GETONTHIS.x etc, so I can just dupe the spawner and it will
work at any location.
It would actually be good if I could setup a secondary spawner to set the new
locations on the simplemap, that would be shared by all the duped monster spawners.
hm, Id have to setup some way to get the monsterspawners to send the serial
of the simplemap that triggered the spawn to the secondary spawner.
Would perhaps work to set the SETItem on the monsterspawners to the secondary
spawner, and spawn entry
SET/name/{GETVAR,TheMap}/DoRespawn/true
which would then set the secondaryspawners name to the serial of the
simplemap.
Spawnentries on the secondary map wouldn't need to be in any sequential
order or use any random command.
Just enter a Point2d in each spawnfield and set the maxcount to 1. Which would
then just spawn 1 random entry.
Entries would have to look something like
SET,{GETONTHIS,name}/Newpin/xy
SET,{GETONTHIS,name}/Newpin/xy
SET,{GETONTHIS,name}/Newpin/xy
etc
Not absolutly sure if that would work though, setting the name of secondaryspawner
to the serial of the simplemap is no problem. But question is would
SET,{GETONTHIS,name} try to find the item with the serial thats entered
on the name property
or try to find an item that has that serial as its name property.
Not at home atm to try it.
ArteGordon- 07-26-2006

QUOTE
SET,{GETONTHIS,name} try to find the item with the serial thats entered

if {GETONTHIS,name} returns a hex value (begins with 0x), then SET will treat it like a serial number.
You could also pass the triggering mob from the first spawner to the second spawner by manually assigning the TriggerMob property on the second spawner and use GETONCARRIED again to get the simplemap info.
from xmlspawner2.txt

QUOTE
- Added a new proximityrange setting. Setting proximity range to -2 disables both proximity detection as well as free spawning. This allow a spawner to be set to spawn only under external direction by having the ProximityActivated property explicitly set to true by some external agent, such as another spawner, or a switch, etc.
This can be used to create spawn chains that are triggered by one spawner, and then propagate to other spawners. e.g. Have a quest spawner that triggers on a player, and then causes another spawner to trigger using the spawn spec "SET/triggermob/TRIGMOB/proximityactivated/true". Because the proximityrange is set to -2, this becomes the only way to activate the spawner.

this is also how you can use things like the GETONCARRIED keywords to apply to arbitrary mobs by just setting TriggerMob to the mob as in this post
http://xmlspawner.15.forumer.com/index.php?showtopic=506
XavierWER- 07-26-2006
ah excellent.
What version is that though? My shard doesnt have the latest.