Full Version : Spawner not waiting for a GUMP to be processed
xmlspawner >>Q&A >>Spawner not waiting for a GUMP to be processed
<< Prev | Next >>
Lichtblitz- 04-05-2008
I'm stuck in the following task:
I configured an XMLSpawner to watch out for corpses of player characters nearby and transfering them and their owner to another region.

CODE
SETVAR,toX/RND,990,1000 SETVAR,toY/RND,990,1000 SETVAR,toZ/0 SETONNEARBY,5,*,corpse,false,owner.summonsmax>-10/x/{GETVAR,toX}/y/{GETVAR,toY}/z/{GETVAR,toZ}/owner.x/{GETVAR,toX}/owner.y/{GETVAR,toY}/owner.z/{GETVAR,toZ}

owner.summonsmax>-10 is just a workaround for detecting player characters.
Now I want to change this so that players are asked if they wish to be transfered. It's not a big problem marking the corpse so that they won't be asked every time but I'm having trouble with the GUMP:

CODE
GUMP,Transfering?,1/Wish to be transfered? IF/{GETONTHIS,GumpState}=yes/2/3

Even if my IF-command was correct it would be called upon before the user hat any chance to choose an answer. Is there any way to pause the Spawners processing until the gump has been answered? Or any workaround that does not include setting the variable to a dummy expression and WHILEing about until next summer? ;-)
ArteGordon- 04-15-2008
you can take a look at the way this is done in the Blather.xml example. It has a second spawner that triggers off of the GumpState of the other spawner.
You should also be able to do it with a WAITUNTIL keyword. See Blather3.xml for an example of doing it this way
WAITUNTIL/Gumpstate!(-null-)/2
will wait until some gump response is made which will set the Gumpstate property on the spawner to the response string. You probably also want to add a timeout so that if someone doesnt respond it doesnt continue waiting, like
WAITUNTIL,0,1/Gumpstate!(-null-)/2
You will also need to initialize the Gumpstate property to null before spawning the gump. The blather3.xml example does this.
You could have also used the GETONTHIS,gumpstate syntax. It is the same thing. When you refer to a property name in a condition test it assumes by default that you are referring to properties on the reference object which is the spawner in this case.
Jason- 04-20-2010
I'm trying to get this to work via xmldialog but its not working. I think the WAITUNTIL is conflicting with the keywords.