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!

Resource icon

ProTag - PlayerMobile Tag-Based Properties 1.2

No permission to download
Introduction

Similar to ArteGordon's XmlAttachment and Tru's PlayerMobile Helper, this is an alternative way to save your custom PlayerMobile properties.

Features

# Plug & Play
# Works out of the box for any script
# In-game manageable
# Easy customization for the tag prefix
# Does not involve Serialize/Deserialize
# Clean Reset/Uninstall

Installation

Just drop it somewhere on your Scripts folder.

In-game Commands

[ProTag
Gets all the custom properties of a targeted PlayerMobile.

[ProTag Set <Property> <Value>
Sets a custom property for a targeted PlayerMobile.

[ProTag Get <Property>
Gets the value of an espefic custom property of a targeted PlayerMobile.

[ProTag Del <Property>
Deletes an espefic custom property of a targeted PlayerMobile.

[ProTag ClearAll
Used to remove all account tags created by the ProTag System. You should use this command before deleting the script, if you are uninstalling. Note that this is the only command case sensitive, for security reasons.

Development Usage

Considering "pm" as a PlayerMobile object and "Max Wisdom" your custom property, you can use ProTag in your script like this:

To set his Max Wisdom to 85:
C#:
 ProTag.Set(pm, "Max Wisdom", "85");

To get his Max Wisdom and store it on a variable:
C#:
 string maxWisdom = ProTag.Get(pm, "Max Wisdom");

To delete his Max Wisdom property.
C#:
 ProTag.Del(pm, "Max Wisdom");

Some Notes

In most cases you won't need to add any "using" statement on your script header to use the ProTags. But if you ever need, just add "using Server;".

Your custom property can have more than one word. When set to the tag name, all blank spaces will be replaced by underscores.

All the properties are stored as String, so when you use ProTag.Get to recover its value, you will need to parse it to your desired type. For example:
C#:
string maxWisdom = ProTag.Get(pm, "Max Wisdom");
int max = int.Parse(maxWisdom);

Comments and suggestions are always welcome!
  • Like
Reactions: ZrnecX and m309
Author
Felladrin
Downloads
50
Views
316
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Felladrin

Latest updates

  1. Get method reverted back to return null if the protag is not set

    To avoid complications when creating scripts based on this, the Get method was set back to...
  2. Added two config options and fixed account check

    Two new options were added in the top of the script. private static bool GetNeverNull = true...
Top