RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

XmlSpawner2

ArteGordon

Wanderer
Brennan said:
Hi ArteGordon, Thanks for great spawner.

I have RunUo 1.0 RC0 and Microsoft Framework v1.1.4322.

On my computer the Convert.ToDouble(string) didn't working, when string is like "0.25" and working when string is "1", "2", i.e. integer. I guess that this is a framework problem.

Little example:

using System;
using System.IO;
using System.Xml;

class A
{
static void Main()
{

string S = "0.2";
double D= Convert.ToDouble(S);

Console.WriteLine(S);
Console.WriteLine(D);
}
}


Generates errors on my computer.
If i'm using XmlConvert.ToDouble, then all is ok.


I'm using the notepad for editing and standart .xml files from your instalation pakage v.2.58.

P.S. and i,m using a simple spawn: ogre/ADD,0.25/WEAPON,2,5

you might also see if it is a culture effect.

in your example, if you try

Code:
double D= Convert.ToDouble(S,System.Globalization.CultureInfo.InvariantCulture);

does it work? If so, then it is a problem with your culture specification.
 

Brennan

Wanderer
Thanks, now i understand what was the case.

double D= Convert.ToDouble(S,System.Globalization.CultureInfo.InvariantCulture);


Converting is working in this format too.
 

ArteGordon

Wanderer
yes, thanks for pointing this out. I will probably enforce the culture invariant format for double arguments like that since a comma is used as an argument separator in that context and therefore cannot be used as a decimal separator regardless of culture. I guess XmlConvert is not culture sensitive but I would have to confirm that.
 

LadyLaurel

Wanderer
I was wondering if there is a way to unspawn and then respawn the spawners after they are placed without having to go to each one? Also, if this is possible, would it be worldwide, or area by area?
 

ArteGordon

Wanderer
yes, there are a couple of ways of doing this.
There are two built in respawning commands

[xmlspawnerrespawn [SpawnerPrefixFilter]
which will respawn everything on the current map and allows you to also specify an optional prefix filter which will be used to limit the respawn to those spawners whose names begin with the prefix string. This is handy if you have given your spawners names that relate to their region or function like, DeceitSpawner#1 in which case you could respawn all of the deceit spawners by doing

[xmlspawnerrespawn Deceit

the other respawning command is

[xmlspawnerrespawnall [SpawnerPrefixFilter]
which will respawn everything in the world, and again you could use the prefix filter.


You can also use the set command with the area modifiers to accomplish the same sort of thing

[global set dorespawn true where xmlspawner map == felucca

would respawn all of felucca

[area set dorespawn true where xmlspawner

would let you define a bounding area and respawn everything within it.

A third way is to use [xmlfind to locate spawners and then select and respawn them with the respawn button. This allows you to find spawners based on their distance from you, their name, the things they are spawning etc.


(edit)

note, there is also the companion to respawning which is resetting, that will unspawn and turn off the spawner. You can use the same type of set command format to use this on a large scale, so

[global set doreset true where xmlspawner map == felucca

would unspawn and turn off all spawners in felucca

[global set dorespawn true where xmlspawner map == felucca

would turn them back on and respawn them

[global set running true where xmlspawner map == felucca

would just turn them back on without respawning
 

ArteGordon

Wanderer
updated to version 2.60

from the changelog

Version 2.60
updated 9/15/04
- modified the way in which COLLECT and GIVE type quests work with playermade quests. The items collected or given will now be returned to the quest creator and placed into the specified return container (or the creators backpack if nothing is specified). This allows resource contract type quests to be made, in which players offer rewards in return for certain goods.
For example constructing a quest with this objective
COLLECT,goldingot,100
would create a basic contract for 100 gold ingots.
COLLECT,greatercurepotion,100
would create a basic contract for 100 greater cure potions.

- added a button to [xmlfind to hide valid internal map items/mobs. By selecting this button along with the internal map button you can search for all probable invalid internal map items/mobs. The selection criteria for valid entries are based on the internalitems/internalmobiles scripts by Fury. Note, like those scripts, this will not hide items/mobs that might have been intentionally put on the internal map due to custom scripts, so use caution, although in all likelihood they were put there unintentionally and can be safely deleted.

- added a button to [xmlfind to select all entries. This button is in the upper right corner of the [xmlfind gump, just to the left of the
select-displayed button. When checked, it will select all of the entries found in the search (not just the ones currently displayed). The entries can then either be deleted, reset, or respawned by selected the corresponding buttons along the bottom of the gump. Note that individual entries cannot be toggled when the select-all option is enabled.

- changed the questnote to bring up the quest status gump directly on double click. The original questnote with the more RP-friendly scroll gump is still available as OriginalQuestNote.

- some cosmetic changes to the way in which quest gumps are brought up from the questbook to reduce overlap and ease quest browsing.

- enforced culture invariance in specification of floating point numbers when used to specify occurrence probabilities with the keywords ADD, EQUIP, SAY, MSG, TAKE, and TAKEBYTYPE. Only decimal point separator formats are now allowed. This was to avoid ambiguity in the culture-dependent use of commas as both an argument separator and a decimal separator. (thanks to Brennan for pointing this out).

- item and mobile deletion calls in [xmlfind now have their exceptions trapped since some objects may not delete gracefully (those with a null map are particularly error-prone).
 

ArteGordon

Wanderer
a quick update to version 2.60a

if you have already downloaded v2.60, only XmlSpawner2-v260a-2of2.zip needs to be downloaded for the update.

from the changelog

Version 2.60a
updated 9/16/04

- modified the playermade quest reward system to prevent certain possible minor player exploits such as using containers set as reward items to carry items, or to automatically return items to a remote return container.

- fixed playermade quests to correctly reflect the weight of the items added as rewards. Playermade quests will now have the weight of the reward items that they contain. This is to prevent exploits involving use of playerquests as weight-free containers.
Non-playermade quests are still weightless.

- reward weight is also now reported in the questgump.
 

ArteGordon

Wanderer
another quick update to version 2.60b

if you have already downloaded v2.60 or v2.60a, only xmlSpawner2-v260b-2of2.zip needs to be downloaded for the update.


Version 2.60b
updated 9/17/04

- disabled the ability to open and view attached quest rewards. I've discovered some additional problems involving players weight improperly including the weight of quest rewards so I have disabled this feature for now. I've come to the conclusion that I'm going to have to rework these quest items as containers instead of arbitrary items such as the questnote to properly support this ability, so perhaps we will see it reemerge in the next release or two.
 

ArteGordon

Wanderer
updated to version 2.61

- note that some of the scripts have been shifted between a few of the .zip files due to size limitations.
- this is basically the container solution that I mentioned in the previous post

from the changelog

Version 2.61
updated 9/18/04
- added the new XmlQuestHolder class that is intended to replace the XmlQuestToken. Both are supported but the XmlQuestHolder is preferred. It has the same functionality but supports display of quest rewards. It also resolves all weight issues and possible exploits that were addressed in the previous updates.

- added the new QuestHolder item that is intended to replace the QuestNote. It has the same functionality but supports display of quest rewards.
It also resolves all weight issues and possible exploits that were addressed in the previous updates. The questnote is still supported but the questholder is preferred. The questholder takes the form of a book rather than the scroll of the questnote.

- the xmlquestmaker stone for playermade quests now hands out questholders instead of questnotes.

- updated the .xml examples boboquest.xml and questbook.xml to use the new questholder item.
 

ArteGordon

Wanderer
updated to version 2.62

from the changelog

Version 2.62
updated 9/21/04
- added some automatic syntax checking on questholder quest objectives to flag incorrect formatting or item/mob types that are not recognized. Any resulting error status information is displayed at the bottom of the quest gump when it is opened.

- added the Status property to the XmlQuestHolder class that contains any error status information that might have been generated due to improper objective specification, testing, or reward generation. Note that opening up the quest gump will run the syntax check that will overwrite any current status information, so check the Status property manually by doing a [props if you want to avoid that.

- modified the quest objective descriptions in the quest gump for questholder items. They are a bit more descriptive now and include type information when it is specified. e.g. specifying the objective KILLNAMED,Sniveler,balron,5 will be described as "Kill 5 balron(s) named Sniveler", while the objective KILLNAMED,Bobo will be described as "Kill 1 mob(s) named Bobo".

- the .xml examples that referred to questnotes have been modified to refer to questholders.

- some minor changes to the properties displayed on mouseover.

- added support for the OnSpawned() method that can be defined in any mobile or item class and will be invoked when that item/mobile is spawned and placed in the world but before any spawnentry modifications are applied. This allows individual objects to script in actions that they wish to occur at spawn time that require knowledge of the object's map and location.

- added support for the HoldSmartSpawning property that can be defined in any mobile or item class and will be tested when the spawner attempts to inactivate when SmartSpawning is set. This allows individual items/mobiles to define conditions under which smartspawning is suppressed on the spawners that spawned them.

Note, you dont HAVE to add the OnSpawned() method or the HoldSmartSpawning property to anything if you dont want to. The spawner will still work just fine. They are both completely optional.


- Below is an example of this new functionality used with Wyatts paragon system (paragon setting code taken from Wyatt's modified spawner in his paragon system).
Add this to BaseCreature.cs to support paragon spawning and combined paragon/smartspawning without any modification to the spawner code.
Also note, that by overriding this method in any mob, you can determine whether they can become paragon or not, or even the chance of becoming paragon.

Code:
	// ARTEGORDONMOD
        // added support for the OnSpawned() method that is invoked after the creature is spawned and placed
        // added support for the HoldSmartSpawning property that can suppress smartspawning inactivation for a spawner when true

        public virtual bool HoldSmartSpawning
        {
            get{
		// dont do smartspawning inactivation if the spawner has a paragon on it
                if(Paragon) return true;
                return false;
            }
        }

        public virtual void OnSpawned()
        {
        
        /*+Wyatt+*/
		        if ( 0.05 >= Utility.RandomDouble() && this.Map == Map.Ilshenar && !SpellHelper.IsTown( this.Location, this ) )
				{
				    if ( !( this is BaseEscortable || this is BaseVendor ) )
 			 	       this.Paragon = true;
				}
        /*-Wyatt-*/
            
        }
 

Fluke

Wanderer
One mistake here:
Code:
 public virtual void OnSpawned()
        {
        
        /*+Wyatt+*/
		        if ( 0.05 >= Utility.RandomDouble() && [COLOR=Navy]this.Map == Map.Felucca[/COLOR] && !SpellHelper.IsTown( this.Location, this ) )
				{
				    if ( !( this is BaseEscortable || this is BaseVendor ) )
 			 	       this.Paragon = true;
				}
        /*-Wyatt-*/
            
        }
this code will spawn paragons in Felucca, OSI says Paragons are only in Ilshenar.
:)
 

ArteGordon

Wanderer
Fluke said:
One mistake here:
Code:
 public virtual void OnSpawned()
        {
        
        /*+Wyatt+*/
		        if ( 0.05 >= Utility.RandomDouble() && [COLOR=Navy]this.Map == Map.Felucca[/COLOR] && !SpellHelper.IsTown( this.Location, this ) )
				{
				    if ( !( this is BaseEscortable || this is BaseVendor ) )
 			 	       this.Paragon = true;
				}
        /*-Wyatt-*/
            
        }
this code will spawn paragons in Felucca, OSI says Paragons are only in Ilshenar.
:)

lol, yeah sorry. I was just testing it out in green acres so I forgot to change that. Thanks!
 

ArteGordon

Wanderer
I should just point out that you dont HAVE to add the OnSpawned() method or the HoldSmartSpawning property to anything if you dont want to. The spawner will still work just fine. It is completely optional.
 

Solinari555

Wanderer
Whoa now...

Wow, great script, but it is WAAAY to complex. I might suggest if you come out with a 3.0, make just one [xml command that opens up the xml menu, and maybe make the rest of the stuff less complex... Also, make it to where you can link up multiple spawners into one big web of them.
 

ArteGordon

Wanderer
just take it slowly. All you really need to know to get started is

[add xmlspawner

and double click.

and from there it can be just a simple as the distro spawner, just with a lot more possibilities.

As for having one interface that lets you access many spawners, thats basically one of the things that I use [xmlfind for. You can have it search for spawners based on location, spawn entries, and many other factors (both distro and xmlspawners can be searched in this way), sort them, then you can open their gumps, change their props, go to their spawns, etc.
 

ArteGordon

Wanderer
updated to 2.62a

- sorry, I just discovered that I forgot to update one of the files in the new distribution. The file is XmlQuestToken.cs and the .zip file is XmlSpawner2-v262-2of2.zip

If you have already downloaded the most recent package, you only need to update that file.
 

jaynigs

Wanderer
Hi arte, i have a question for you please :) if you wouldnt mind answering it.

Ive had reports from players that things were spawning in their house, the house in question was close to and in the range of the spawner, but im not sure if it simply wandered in there or not.

My question is, can this happen with the xmlspawner, or are there checks in place to prevent this from happening.

Thanks for your time...
 

ArteGordon

Wanderer
updated to version 2.63

from the changelog

Version 2.63
updated 9/26/04
- added some additional error logging for the .msf import function [xmlimportmsf. Details are now logged in badimport.log

- optimized the OnSpawned() and HoldSmartSpawning function support.

- modified spawn placement so that mobs will no longer be able to spawn in restricted regions such as private houses (thanks to jaynigs for pointing this out)
 

Morgan

Sorceror
RunUo 1.0RC0
Xmlspawner ver. 2.63

Error:
System.NullReferenceException: Odwołanie do obiektu nie zostało ustawione na wyst±pienie obiektu.
(Refference to an object has not been set for appearing of an object)
at Server.Mobiles.XmlSpawnerGump.OnResponse(NetState state, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 
Top