Ravenwolfe

Moderator
I've never been a fan of putting a lot of thing in players backpacks. However, i want to use a token system to reward players for certain things. So my idea is to add a new property on playermobile called tokens and have certain action increase the value and decrease the value when the spend the token (using a token stone).

However, everyone i have seen uses an object in the players pack. So my question is, is there a reason not to have the value stored on playermobile? Is it simply that people dont like playermobile edits or does this increase load on the server or something?

I know nothing about server memory usage and such, but it seems to me that a value stored on PM would be less drag on the server then the items would or am i mistaken?
 
You could also try using XmlAttachments, then increase or decrease the value on the attachment. With XmlQuestNPCs (and their quests) you're basically completely setup to do all that from the get go, no playermobile edits required if you have all of the XmlSpawner package installed already.
 
Well @Insanity would be a better one for a full fledged demo of the CustomsFramework but over the past for weeks I have been is Luke to his Obi :p so ill whip something up.[DOUBLEPOST=1379179610,1379179114][/DOUBLEPOST]Here is a good demo of CustomFrameworks using points like you were looking for. This is a PreRelease of a system I have on my server. Its a self res system for players.

Overview
  • Players can buy, find, or Donate for After Grave Point Deeds
  • Aftergrave Point deeds add points to the character used in the self res and corpse find commands.
  • Players can use [resme to res them selfs if they cant find a healer, This command will use Aftergrave points if any are or 5000 gold (Amount modifiable in core)
  • Players can use [getcorpse to find their most recent corpse. This command will use Aftergrave points if any are available or 5000 gold (Amount modifiable in core. )
This is a good example of how to use the CustomFrameworks for things that effect a mobile. No playermobile changes required.

RoninGT[DOUBLEPOST=1379179739][/DOUBLEPOST]I have been converting most of my scripts over to support the CustomsFramework built into ServUO comes in very handy.

RoninGT
 

Attachments

  • FS - Self Res System (PreRelease).zip
    8.7 KB · Views: 13
Meh, I started to write a demo...but then I didn't see the point. There are 3 systems in use built into ServUO that are great "demos" of it in action and how to use it properly. Now that doesn't mean I'm against teaching people how to use it. I believe a How-To/Tutorial would be a better solution to explaining how to use the framework. Than a simple demo core/module, as it won't help explain all that much to the average joe.

So...I believe I'll get to work on a basic Tutorial, using the Token part as a example.

As for the answer to your original question. The reason that most people don't store the info directly on the PlayerMobile is because they try to avoid distro edits. Distro edits make it that much harder to share systems, and harder to install on someone that doesn't know C# very well. The biggest fear is adding something that needs to be serialized, as most people fear messiing with Mobile/Item serialization. As it is indeed easy to mess it up and wipe a lot of stuff.

But as mentioned. The CustomsFramework is a great solution to your problem. You could maintain and serialize the data outside of any item/mobile class. Saving you from doing distro edits, or possibly messing up serialization. While also link the data to a mobile/item for easy access to the data.

@RoninGT's example above is a good starting point. You can also view the Toolbar system, food system, or slayer title system, found within the Customs folder of ServUO. They all heavily rely on the CustomsFramework.
 
Great stuff, you guys are brilliant! I can't believe I didn't think of an XMLattachment after I used to be a tester years ago for ArteGordon!

I've never had a clue what the CustomFramework stuff does, so thank you both, I will look at the example and I would love to see a tutorial on it!!

My plan is to have people gain tokens for claiming corpses (kinda like the old [grab command) which helps clean up the server, for trashing items they dont need, for killing another player (part of a meaningful pvp system I'm working on), and for staff rewards to be given out at events and such.
 
There's the trash for tokens backpack you can get with Daat99's token system. You could also use that code as a basis for using an Xmlattachment. :)
 
Ok, I looked over the scripts and I think I get mostly what happens but I am still a bit confused. Its clear that there is something called a "module" that is linked to a player and holds the value for the "aftergrave points". There also appears to be a "core" that controls the system. I get what the commands do and everything. What I don't understand is where the values are actually stored. Something has to be holding the values for each and every character. Is this in a file on the server? Is it in memory?

You have to forgive me, I have no training in programming and I am totally self taught.
 
Sorry for the late reply my PC went poof :(

In BaseModule there is a value LinkedMobile. This saves the player, or creature that the module is linked too and the Module its self saves all the values you want to attach to the mobile.

Hope this helps

RoninGT
 
It is there are multi ways of doing it if you ever seen my bounty hunter system it has its own save system that does not require pm edits only diff is that CustomsFramework is built into the core


Sent from my iPhone using Tapatalk - now Free
 
Yeah, seems like a good way to do it. It has the benefits of using xmlattachments but you dont have to edit the scripts to add the attachments like you do with xml (such as adding attachments in charactercreation).
I cant wait to see a tutorial on this!
 
Is that how you add attachments for Xml Raven? You should have a spawner or XmlQuestNPC do it. So much easier and if your attachment follows a basic structure of one of the pre-made attachments it's super easy. Sorry, I didn't mean to sound like any other way is stupid or anything.
 
Well, it depends. I've had spawners do it, deeds do it, or do a global command to do it. But in the case of a token system that will be added to all playermobiles, its best to do it at character creation so that future players have it when they start.
 
Back