Full Version : Hmm Question about 2.0
xmlspawner >>Scripting Support >>Hmm Question about 2.0


<< Prev | Next >>

gizmo- 06-17-2006
Question #1:

In the Scripts/Region/Spawning/

SpawnDefinition.cs
SpawnEntry.cs
SpawnPersistance.cs

Are these really what I think they are, only glanced at them. Seems they allowed for regions to be able to spawn now. Or a built in spawning system. Any ideas if so how to harness this? or is this gonna be added later on into the xml system.


Question #2:

What does everybody think about the new Region setup? Anybody else having a problem trying to tie or make regions since it was revamped? Just curious. Maybe its just me being old and learning slower lol.

LowCastle- 06-17-2006
I read a post on the RunUO forums a couple days ago posted by kmwill. He says that the regions are Read-Only and it was causing problems with his TownHouses scripts. I don't know anything about the regions beyond that.

ArteGordon- 06-17-2006
yeah, it looks like a built-in region spawning system.
I havent had time to look through it carefully and see how it might be used, but there are a number of changes to regions that will probably lead to new features.

Note that the current xmlspawners will already do regional spawning.

gizmo- 06-18-2006
Well kinda dug into this one out of curiosity. Still looking into it. But here is an example.

This is from a britain field from the Data/Regions.xml file


CODE

  <region name="A Wheatfield in Britain 1">
   <rect x="1120" y="1776" width="32" height="32" />
   <go x="1135" y="1791" z="0" />
   <spawning>
    <object id="413" type="FarmableWheat" minSpawnTime="PT10S" maxSpawnTime="PT30S" amount="8" />
   </spawning>
  </region>



Not sure yet what the <object id="xxx" but each region section has its own id.

yew has sheep that auto spawn ect.

Also the commands are [respawnregion and [respawnallregions.

Im gonna run a test <region></region> to see what I cant get to spawn in a general area. But im sure the ID has to be unique. So im gonna run through and find a safe numbe to work with. Im sure a value of 10,000 starting would be sufficant for custom addtions. But ill make sure. Let you know what I come up with. =)

gizmo- 06-18-2006
Okay I added this to the <facet felucca> section of the xml file



CODE

  <region name="Moonglow Bank">
   <rect x="4465" y="1157" z="0" width="13" height="8" />
   <go x="4465" y="1157" z="0" />
   <spawning>
    <object id="10000" type="Banker" minSpawnTime="PT10S" maxSpawnTime="PT30S" amount="1" />
   </spawning>
  </region>




Here is the Region Spawn/Despawn commands

CODE

  CommandSystem.Register( "RespawnAllRegions", AccessLevel.Administrator, new CommandEventHandler( RespawnAllRegions_OnCommand ) );
  CommandSystem.Register( "RespawnRegion", AccessLevel.GameMaster, new CommandEventHandler( RespawnRegion_OnCommand ) );
  CommandSystem.Register( "DelAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( DelAllRegionSpawns_OnCommand ) );
  CommandSystem.Register( "DelRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( DelRegionSpawns_OnCommand ) );
  CommandSystem.Register( "StartAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StartAllRegionSpawns_OnCommand ) );
  CommandSystem.Register( "StartRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StartRegionSpawns_OnCommand ) );
  CommandSystem.Register( "StopAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StopAllRegionSpawns_OnCommand ) );
  CommandSystem.Register( "StopRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StopRegionSpawns_OnCommand ) );



Now when you create a region like I did. You can use these commands.

[RespawnRegion to kick just that region in. and turns on the spawning for this area.
[DelRegionSpawns to remove that spawn of the banker, and it shuts off spawning in this area.

Pretty darn cool if you ask me. But this is what I have tracked down. Could have possible uses. Just wondering on how this might hinder performance? Just thinking at this moment.

ArteGordon- 06-18-2006
note that you can do this kind of region spawning by just setting the xmlspawner RegionName property those region names, like "Moonglow Bank", or "A Wheatfield in Britain 1"