|
||
|
|||||||
| Modification Suggestions This is where you can suggest a modifcation to RunUO! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Jan 2005
Age: 28
Posts: 1
|
I'm not much of a C# programmer, and I don't run my own runuo server, however I've noticed a problem GM's are having on a server I play on... it seams the Dupe command there doesnt copy over each attribute of the copied item, only the item id & resist values. Its possible their server has a messed up dupe command, but just in case it hasn't been addressed, I'm throwing it out there.
an admin said they were running runuo 1.0.0 there. |
|
|
|
|
|
#3 (permalink) |
|
Join Date: Jul 2004
Age: 32
Posts: 169
|
I have noticed when using the dupe command it goes by the base of the constructable. I.E say you made some changes to and item like a weapon, when you go to dupe the item usually the changes are dropped cause it looks at the items constructable part of the script and it sees what is actually on it that way. that doesnt mean that some items it will retain some of all of their mods.
But yes its not a real problem with either, it works the way its supposed to. And yes it would be cool to expand on it, but im not that good of a scripter to even try that yet. |
|
|
|
|
|
#4 (permalink) |
|
Ronin
|
I believe that this was on purpose. I recall that they changed this in one of the previous betas because we used to be able to dupe jewelry and it would be an EXACT copy. Now, it's only a copy of the base item. Perhaps we should have an additional command to do exact copying.
|
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
|
If someone can help me figure out the code to access the whole Properties list, I could make this command.
Basically I'd make a 'dupe' of the base item, then assign all of the extra parts that have been changed |
|
|
|
|
|
#9 (permalink) |
|
Forum Expert
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
|
If I did this script, it would include the total range of things in UO. So if you had a Creature with changed stats, you could use the command to make an exact copy of it. Same with armor/weapons/items/etc.
|
|
|
|
|
|
#11 (permalink) | |
|
Forum Expert
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
|
Quote:
And No, I havn't started on this yet. Other projects are taking precidence. |
|
|
|
|
|
|
#12 (permalink) |
|
Join Date: Oct 2002
Age: 23
Posts: 4,689
|
There isn't a real problem with duping items and all of their properties, however it becomes slow if you are copying EVERY SINGLE property of every inhereted class.. and then lets say your making 20 copies of that item.
The real problem with dupe, is the fact that its infeasible to dupe a container and all of its contents, as you can easily slow down a server making 100 copies of a bag with over 200 items in them that have alot of properties. The easiest way to make it do what you want, is to have it copy all properties which have CommandProperty and/or PropertyObject attributes. You can do a loop through all properties, then you can isolate the ones which are settable in-game, and then set them accordingly. |
|
|
|
|
|
#13 (permalink) | |
|
Forum Expert
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
|
Quote:
Thanks |
|
|
|
|
|
|
#17 (permalink) |
|
Forum Expert
|
Why don't you try like
Code:
public override void OnDupe(Item from)
if ( from != BaseJewelry || BaseSheild || BaseArmor )
{
get( from.WeaponAttribute.*insert attribute*;
Repeat
}
else if ( from != BaseWeapon || BaseSheild || BaseArmor )
{
*see above*
}
Else (and you get the idea)
__________________
Procrastinators unite!
Tomorrow. Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders. ![]() |
|
|
|
|
|
#18 (permalink) |
|
Join Date: Oct 2002
Age: 23
Posts: 4,689
|
Thats bad coding practice (to do type checks for no reason).
There are multiple problems with this, where it wouldn't be a problem in C++ for example. Although in C++ you can do this, but I don't know if its possible, or easy in C#. It seems that the best way to do it, is to allocate memory for all of the required items (containers, etc), and their properties. Do a single real dupe with adjacent memory locations. Then clone the memory in a raw fashion and dump it X times. Then after that, assign a valid serial number for each item and container. |
|
|
|
|
|
#19 (permalink) |
|
Forum Expert
|
All those checks where to make sure all the propertys where there. You can simply make it ==, your choice.
__________________
Procrastinators unite!
Tomorrow. Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders. ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|