Go Back   RunUO - Ultima Online Emulation > RunUO > Modification Suggestions

Modification Suggestions This is where you can suggest a modifcation to RunUO!

Reply
 
Thread Tools Display Modes
Old 01-23-2005, 05:04 AM   #1 (permalink)
 
Join Date: Jan 2005
Age: 28
Posts: 1
Default Dupe command

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.
philadan is offline   Reply With Quote
Old 01-23-2005, 05:19 AM   #2 (permalink)
P3'c Orion Aviator
 
Join Date: Sep 2004
Age: 30
Posts: 1,272
Default

Iv never actually used the dupe command, but I just looked at it and it is a problem in Dupe.cs code. Its probably not a problem with their server. The command just needs to be expanded on.
sirens song is offline   Reply With Quote
Old 01-23-2005, 06:22 AM   #3 (permalink)
 
Join Date: Jul 2004
Age: 32
Posts: 169
Default

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.
paladineD is offline   Reply With Quote
Old 01-23-2005, 08:22 AM   #4 (permalink)
Ronin
 
davidmohara's Avatar
 
Join Date: Nov 2003
Age: 33
Posts: 134
Send a message via ICQ to davidmohara Send a message via MSN to davidmohara
Default

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.
davidmohara is offline   Reply With Quote
Old 01-24-2005, 03:17 AM   #5 (permalink)
 
Join Date: Feb 2003
Posts: 269
Default

Something like [DupeAll, perhaps?
thegrandmystic is offline   Reply With Quote
Old 01-24-2005, 03:24 AM   #6 (permalink)
 
Join Date: Dec 2003
Posts: 1,069
Default

or [DupeWithProps or something.
__________________
HI!
jjarmis is offline   Reply With Quote
Old 01-24-2005, 04:17 AM   #7 (permalink)
Forum Expert
 
A_Li_N's Avatar
 
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
Default

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
A_Li_N is offline   Reply With Quote
Old 01-24-2005, 07:56 AM   #8 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default

What about about duping the AosAttributes with a code similar to the current dupe code and then setting it to the new item?
Atomic is offline   Reply With Quote
Old 01-24-2005, 02:29 PM   #9 (permalink)
Forum Expert
 
A_Li_N's Avatar
 
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
Default

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.
A_Li_N is offline   Reply With Quote
Old 01-28-2005, 01:59 AM   #10 (permalink)
 
Join Date: Nov 2004
Age: 32
Posts: 354
Send a message via ICQ to L0rdDarkScythe Send a message via AIM to L0rdDarkScythe Send a message via MSN to L0rdDarkScythe Send a message via Yahoo to L0rdDarkScythe
Default

why not instead of having to dupe the item just script the item and add it where ever ya wanted to like I do?
L0rdDarkScythe is offline   Reply With Quote
Old 01-28-2005, 02:22 AM   #11 (permalink)
Forum Expert
 
A_Li_N's Avatar
 
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
Default

Quote:
Originally Posted by L0rdDarkScythe
why not instead of having to dupe the item just script the item and add it where ever ya wanted to like I do?
Because a script requires a restart of the server, as well as scripting the item. If you have a custom item in game, and want to make a copy of it to give to another person, it's a hella lot easier to simply do [CDupe and target the item than it is to script the item, get it to the host, restart the server.

And No, I havn't started on this yet. Other projects are taking precidence.
A_Li_N is offline   Reply With Quote
Old 01-28-2005, 12:38 PM   #12 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

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.
XxSP1DERxX is offline   Reply With Quote
Old 01-28-2005, 04:13 PM   #13 (permalink)
Forum Expert
 
A_Li_N's Avatar
 
Join Date: Apr 2004
Location: Another state of mind
Age: 27
Posts: 2,875
Default

Quote:
Originally Posted by XxSP1DERxX
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.
*Notes this down* I'll remember that when I try to work on this Thanks
A_Li_N is offline   Reply With Quote
Old 01-28-2005, 04:34 PM   #14 (permalink)
 
Join Date: Feb 2003
Posts: 269
Default

Quote:
Originally Posted by A_Li_N
*Notes this down* I'll remember that when I try to work on this Thanks
Good luck.
thegrandmystic is offline   Reply With Quote
Old 02-06-2005, 01:17 AM   #15 (permalink)
 
Join Date: Nov 2004
Location: USA
Posts: 129
Default

I'd also like to work on this, but I have little time to devote... I'll post back if I find anything interesting.
Spudz777 is offline   Reply With Quote
Old 04-16-2005, 12:15 PM   #16 (permalink)
Account Terminated
 
Join Date: Dec 2004
Age: 17
Posts: 19
Default

I want to dupe and have it stack. Yeah. That'd be so freaking cool. Instead of like a bagillion seperate thingies. Yeah.
lan_party is offline   Reply With Quote
Old 05-04-2005, 12:13 AM   #17 (permalink)
Forum Expert
 
Join Date: Dec 2003
Location: Sitting in a chair fulfilling my life's goal
Age: 22
Posts: 2,650
Send a message via AIM to Killamus Send a message via MSN to Killamus
Default

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)
I accually think this might work, I just happened to remember something like this in the spellcrafting idea. Of corse, there may or may not be an easyer way to do this.
__________________
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.
Killamus is offline   Reply With Quote
Old 05-04-2005, 12:24 PM   #18 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

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.
XxSP1DERxX is offline   Reply With Quote
Old 05-05-2005, 12:13 AM   #19 (permalink)
Forum Expert
 
Join Date: Dec 2003
Location: Sitting in a chair fulfilling my life's goal
Age: 22
Posts: 2,650
Send a message via AIM to Killamus Send a message via MSN to Killamus
Default

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.
Killamus is offline   Reply With Quote
Old 05-05-2005, 01:21 AM   #20 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

You don't need to, because in C# you can make a PropertyInfo[] of any instance of an object. Right there you have all of the properties. Then you can do what you want with them.
XxSP1DERxX 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