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!

[1.0] Spawner2

David

Moderate
[1.0] Spawner2

Summary:
This is a Release 1.0 version of the standard spawner modified to include a SpawnRange property.

Description:
The HomeRange property still determines how far a creature may wander from the spawner as in the distribution spawner. However that property no longer affects where the creature actually spawns. Now SpawnRange determines how far from the spawner the creature or item will first appear. This is usefull for spawning a creature in a long narrow space such as a hallway or a river. The SpawnRange can be set small with a large HomeRange and the creature will spawn within the narrow confins yet may still wander the entire length of the space.

1.0 Notes:
This is a direct replacement for the 1.0 distribution spawner or the Beta36 Spawner2. All versioning updates are handled already.
This script was written for RunUO 1.0. Moving from Archives to Submissions on 05/06/06.

Installation:
This is a replacement for the Spawner.cs file in Scripts\Misc. That file should be renamed to Spawner.org when this is installed.
 

Attachments

  • Spawner2.zip
    3.6 KB · Views: 418

David

Moderate
I'm sorry, but I'm not familiar with that quest. Unless the description says use Spawner2, my guess would be no it is not....

(edit: Well, actually I guess it is. However this file is included with the quest download. :) )
 

nerun

Sorceror
Could you update it for the 1.0 RC0? I ask that because my spawns system depends of that script. In spite of me to have added another property (SpawnID), I still need the spawnrange. And the new version altered the original script. Could you update his/her script?

PS.: you can just update Spawner.cs (1.0 RC0) with SpawnRange, i can update myself your version with SpawnID after.
 

David

Moderate
nerun said:
Could you update it for the 1.0 RC0? I ask that because my spawns system depends of that script. In spite of me to have added another property (SpawnID), I still need the spawnrange. And the new version altered the original script. Could you update his/her script?

PS.: you can just update Spawner.cs (1.0 RC0) with SpawnRange, i can update myself your version with SpawnID after.

Sure, I should have done that already--sorry. I will update it tonight.
 

lover1973

Wanderer
Great job!

well, I just want to ask.... how to use it , just delete the original one(spawner.cs), then put this one in??
 

David

Moderate
Basicly, yes. I would suggest renaming the original, or moving it to to a folder away from the Scripts folder. Any existing spawners will be updated with the default SpawnRange of 4.
 

David

Moderate
Fixed a minor bug which resulted in unreachable code.

If you are currently using this spawner there is no need to download the corrected version. Only the first restart after upgrading from a distro spawner was affected.

For the curious or anal, at the end of the Deserialize method is this code
Code:
			break;
		}
	
		m_SpawnRange = ( version <= 2 ? m_HomeRange : m_SpawnRange ); //fix SpawnRange until first Deserialize of ver 3
	}
}
change that to
Code:
			break;
		}
	}

	m_SpawnRange = ( version <= 2 ? m_HomeRange : m_SpawnRange ); //fix SpawnRange until first Deserialize of ver 3
}
 

nerun

Sorceror
Good job.

Suggestion: it would be better than you added the version of the script to each updating in it. For instance: version 04.21.2004 (release date) or v2.1, v2.2 etc. And put in the top of scripts too:
/ / version 04.21.2004 or // release 04.21.2004 or //v2.1
etc.

I say it because the script i had was 1.0 RC0 too, but do not have the line m_SpawnRange = ( version <= 2 ? m_HomeRange : m_SpawnRange ); in Deserialize, then i suppose you release at least 3 versions after RunUO 1.0 RC0. And with a version number, is easier identify and update scripts.

But thx by your awesome script! ;)
 

David

Moderate
That line reflects a change in how I handle converting from a distro spawner. There was no change in functionality, only a little cleaner code. I was pretty sure I did that at the same time I updated the script for 1.0 RC0. But yes, I can add a date or version.

The versioning in the script mirrors the distro version of the spawner.
 
Top