|
||
|
|||||||
| RunUO Post Archive The Archvie |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Germany (american though)
Age: 32
Posts: 957
|
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. |
|
|
|
|
|
#4 (permalink) | |
|
Moderate
Join Date: Nov 2002
Location: USA
Posts: 6,598
|
Quote:
__________________
David Forum Moderator The RunUO.com Forum Moderator Team Forum Rules and Guidelines RunUO Forum Search Engine Download RunUO 2.0 RC2 |
|
|
|
|
|
|
#5 (permalink) |
|
P3'c Orion Aviator
Join Date: Sep 2004
Age: 30
Posts: 1,272
|
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 |
|
|
|
|
|
#6 (permalink) |
|
Newbie
|
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. |
|
|
|
|
|
#7 (permalink) | |
|
Forum Expert
Join Date: Dec 2002
Posts: 730
|
Quote:
But obviously he would have to know how to mess with the core, and if he doesn't he would probably messing it up. |
|
|
|
|
|
|
#9 (permalink) |
|
Forum Expert
Join Date: Apr 2003
Age: 28
Posts: 395
|
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 |
|
|
|
|
|
#10 (permalink) |
|
Forum Expert
Join Date: Apr 2003
Age: 28
Posts: 395
|
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 |
|
|
|
|
|
#11 (permalink) |
|
Forum Expert
Join Date: Dec 2002
Posts: 730
|
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. |
|
|
|
|
|
#12 (permalink) |
|
P3'c Orion Aviator
Join Date: Sep 2004
Age: 30
Posts: 1,272
|
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?
|
|
|
|
|
|
#13 (permalink) |
|
Forum Expert
Join Date: Dec 2002
Posts: 730
|
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.
|
|
|
|
|
|
#14 (permalink) |
|
Join Date: Oct 2002
Age: 22
Posts: 4,689
|
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. |
|
|
|
|
|
#15 (permalink) | |
|
Forum Expert
Join Date: Dec 2002
Posts: 730
|
Quote:
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|