Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 01-12-2005, 06:49 AM   #1 (permalink)
Forum Expert
 
Join Date: Oct 2002
Location: Germany (american though)
Age: 32
Posts: 957
Default a custom string, int, bool value in items.

Just suggesting a generic string, generic int, and generic bool property that gets serialized and deserialized for all items.

The purpose would be to allow a little more flexibility when creating custom scripts that interact with items.

More of a "feature" for developers than anything else.


**Edit**
or a generic array. less work.
Jarrod is offline   Reply With Quote
Old 01-12-2005, 09:44 AM   #2 (permalink)
P3'c Orion Aviator
 
Join Date: Sep 2004
Age: 30
Posts: 1,272
Default

but we dont have access to the core, (yet)
sirens song is offline   Reply With Quote
Old 01-12-2005, 10:36 AM   #3 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

That will be pretty easy to do with opensource, so hold on for a few days
Atomic is offline   Reply With Quote
Old 01-12-2005, 09:18 PM   #4 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

Quote:
Originally Posted by Jarrod
Just suggesting a generic string, generic int, and generic bool property that gets serialized and deserialized for all items.
I have to agree with the others, this would add 6 or so bytes to the world save for every single item thus increasing the size of the saves and the time required. I agree that Serializing values is one of the many stumbling blocks for new scripters, but it is one that must become understood if the scripter is to get past using templates. It is better that they come to understand it early, rather than add overhead like that.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 01-12-2005, 10:35 PM   #5 (permalink)
P3'c Orion Aviator
 
Join Date: Sep 2004
Age: 30
Posts: 1,272
Default

Well, the problem is not serializing items, it is custom scripting in reguards to all objects in the class item. Jarrod had a great idea for a vendor system that doesnt involve venders, rather "locking down" items and setting a price. It would be great if every item had an int that could be used for price, or whatever, so the name isnt cluttered with strings we have to parse.If there is a better way to do this than parsing strings, or adding a variable, please educate us.
-Jamie
sirens song is offline   Reply With Quote
Old 01-13-2005, 05:18 AM   #6 (permalink)
Newbie
 
Join Date: Dec 2004
Location: UK
Age: 44
Posts: 10
Send a message via Yahoo to jpmythic
Default



I agree with most that if it isn't being used, then why add it?
The smaller an object is the better. I can understand wanting it for
a specialized instance like this, but it would not be good for the generic
users. If they don't use, then why clutter the Object up with unused
data.

I myself prefer requiring a Vendor to sell items. I can see why some
don't want vendors as they do cost to run. My solution is a commission
based vendor system:
Small Base Fee if no sales.
Or a 3% commission on sales in each pay period.

This reduces the basic cost of a vendor that sits around without sales
yet still matains the role-playing aspect. Very active vendors will cost
more then vendors originally cost, but then you are also making alot
of cash as well, so it evens out over time.

This setup only adds to Vendor objects. I need more data on certain Objects,
then I add the data to those objects only. Much cleaner format and coding style in my opinion.

What would work better is a way to Add an extra property to an Objects List that show on SingleClicks. I've had to do some work
arounds for some of my custom objects and it's a bit of a pain.
Rather then have that Property there already, making it possible
to add more properties would be a better solution. A bit like the Flags
used on some objects. If the flag shows no data, then it isn't saved.
This would make it possible to Add more data to objects that need it
but not have it on ALL objects.

I'm still learning the apsects of some of the code in RunUO and this
was initially a problem figuring out how to modifiy the Displayed properties. One area of hassle is the fact that the Client will control
what is displayed unless you specifically take control of what is sent to
the client. If it receives just the Object Type, it will default to the Basic
Information it has on that object. So you have to force it to display
what you want. That is not a RunUO issue, but more of a Client issue.
The only true fix being to modify the client which I won't do.

Adding an easier way to modify those properties would do it. That would reduce the overall cost in Data storage for all users, while giving you access to modifiying any object easily.

Just my small two cents worth.
jpmythic is offline   Reply With Quote
Old 01-13-2005, 12:08 PM   #7 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

Quote:
Originally Posted by David
I have to agree with the others, this would add 6 or so bytes to the world save for every single item thus increasing the size of the saves and the time required. I agree that Serializing values is one of the many stumbling blocks for new scripters, but it is one that must become understood if the scripter is to get past using templates. It is better that they come to understand it early, rather than add overhead like that.
That's why I said it's better if he adds it on his core, as it will be good for him but not for others But obviously he would have to know how to mess with the core, and if he doesn't he would probably messing it up.
Atomic is offline   Reply With Quote
Old 01-13-2005, 12:57 PM   #8 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

If you can give me a few reasons to why it's bad programming I will be willing to accept your opinion
Atomic is offline   Reply With Quote
Old 01-13-2005, 05:13 PM   #9 (permalink)
Forum Expert
 
Dracolique's Avatar
 
Join Date: Apr 2003
Age: 28
Posts: 395
Default

If you look back through this post carefully, Im sure you can figure it out. add 6 bytes to every object in the world. How many objects are on your shard? Im sure it approaches 2 or 3 hundred thousand or more if you have it all spawned and decorated.

thats an extra 2 MB per save. It doesnt sound like much, but it adds up, and its not even needed.
__________________
I reserve the right to be wrong or mistaken about anything at any time, and hereby exercise my constitutional right to never be flamed by anyone :)
http://pix2.hotornot.com/pics/HQ/KY/...RUORSFGBLU.jpg
Dracolique is offline   Reply With Quote
Old 01-13-2005, 06:48 PM   #10 (permalink)
Forum Expert
 
Dracolique's Avatar
 
Join Date: Apr 2003
Age: 28
Posts: 395
Default

I understand that YOUR reason for not liking it is "The principle of it", Phantom.

But he doesnt seem to grasp the incorrectness of it, so I gave him a reason he might be able to understand.
__________________
I reserve the right to be wrong or mistaken about anything at any time, and hereby exercise my constitutional right to never be flamed by anyone :)
http://pix2.hotornot.com/pics/HQ/KY/...RUORSFGBLU.jpg
Dracolique is offline   Reply With Quote
Old 01-13-2005, 07:41 PM   #11 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

I'm not THAT stupid, but in the case someone NEEDS the properties on all items he will have to add the properties, one way or another so there is no point in that argument.

If you need a property on all items the best way to do it is to add to the Item class unless someone here can prove the contrary with a good argument. I'm not trying to start a fight, and I am willing to hear actual good reasons to create an inherited class when it will have the same exact effect of using the parent.
Atomic is offline   Reply With Quote
Old 01-14-2005, 12:15 AM   #12 (permalink)
P3'c Orion Aviator
 
Join Date: Sep 2004
Age: 30
Posts: 1,272
Default

I understand what your saying phantom. I have noticed that C# gives a warning if a variable is not used in a script. (mainly the variable AC in the scripts that aryas script generator produces) So there must be some important reason for not adding things that arent needed I assume, other than the obvious memory issues. Care to enlighten us please?
sirens song is offline   Reply With Quote
Old 01-14-2005, 10:55 AM   #13 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

I wasn't talking about adding an unused variable, but one he needs. It seems you (Phantom) don't really have a reason why it's not good programming, otherwise you would have stated it. And no, I'm not trying to start fights, you are the one who are, I'm being as polite as I can, even with you. But anyways, just forget it. I won't lose more time on this.
Atomic is offline   Reply With Quote
Old 01-14-2005, 11:58 AM   #14 (permalink)
 
Join Date: Oct 2002
Age: 22
Posts: 4,689
Default

If you don't want to edit the core. Make an empty class called BaseItem (put the basic constructor that Item uses, and pass it to the Item Class, don't serialize or deserialize anything). Then make sure all items which derive from Item then derive from BaseItem, and that BaseItem derives from Item.

Load your server... save it and close. Then go back to the BaseItem class and add any serialization and deserialization changes (versioning) with any properties you want all items to have. Load the world, save it.

Your done.. you can access the properties via your BaseItem class and be done with it.

And before you tell me otherwise Phantom.... I have done this, and it works. And it is the only way to serialize properties universally without touching the core.
XxSP1DERxX is offline   Reply With Quote
Old 01-14-2005, 04:21 PM   #15 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

Quote:
Originally Posted by XxSP1DERxX
If you don't want to edit the core. Make an empty class called BaseItem (put the basic constructor that Item uses, and pass it to the Item Class, don't serialize or deserialize anything). Then make sure all items which derive from Item then derive from BaseItem, and that BaseItem derives from Item.

Load your server... save it and close. Then go back to the BaseItem class and add any serialization and deserialization changes (versioning) with any properties you want all items to have. Load the world, save it.

Your done.. you can access the properties via your BaseItem class and be done with it.

And before you tell me otherwise Phantom.... I have done this, and it works. And it is the only way to serialize properties universally without touching the core.
Didn't know you could do that, it's very nice, thanks for teaching me something new
Atomic is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5