Full Version : Checking for Gold In Chest Problem
xmlspawner >>Q&A >>Checking for Gold In Chest Problem


<< Prev | Next >>

Mideon- 07-27-2008
I am finally starting to try and make up some more complex things with XML Spawner and am having some difficulty.

I want to create a chest that once a week will look to see if there is X amount of gold in it (x is hardcoded by me into the spawner). If there is X amount of gold, it removes it, if there isn't, then it hides the chest. (I realize there are some issues with checking for amounts of items...so I basically just look for the first gold pile....this is fine as I'll just tell my players only one pile...or they are SOL lol)

I am stuck on how to do this though. I am able to check and see if the gold is there, and if so I can remove it....but how do I check if it's NOT there, and hide the chest? Am I going to have to use a second spawner for this?

Thanks a bunch.

Mideon- 07-28-2008
Ok I managed to get the thing working...lol That was a testament to hard work tongue.gif

But I have one issue left....I currently use sequential spawning to produce a command flow of checks in my spawning.

So I check to see if there's a pile of gold with more than the required amt of gold, if so I go to a spawn group that says to simply reduce the amount of the gold.

If this passes, then it checks to see if there's a pile of gold with just the right amt of gold, if so it goes to a spawn group that deletes that pile of gold

If neither of these check, meaning there is not enough gold or no gold, then I shut the chest down.

It works quite well and I am happy with it...but I need this to happen once every 7 days. Currently the way it's going is...it spawns group 1, then spawns group 2 some seconds later. If I set the Min/Max delays to 7 days..it'll take many many weeks to actually go through this process (aka not what I want). I thought by setting the Refractory Min/Max to 7 days, it would do the trick, go through the sequence spawn, and then refract for the desired week long dormancy. Unfortunately the Refractory period seems to be doing nothing.

Any ideas?

Lichtblitz- 07-29-2008
A subgroup is always handled instantly while advancing takes time. So try to use as few subgroups as possible/needed. If you jump into a subgroup via the IF keyword it will also be evaluated instantly (take care never to create loops with the IF keywords).

The GOTO keyword will also take time so you should use it at the end of each branch to set your pointer back to the beginning subgroup.