RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Fix: increased backpack limit up to 550 stones

Fix: increased backpack limit up to 550 stones

Hello!

As ML was launched, OSI raised the maximum backpack capacity from 400 to 550 stones (Stratics Forums - View Single Post - Ultima Online Crafter Help Guides, updated 5 February 2009).

This little patch is meant to make player backpack maximum capacity as it is in OSI.

In Server/Items/Container.cs :

Code:
Index: Container.cs
===================================================================
--- Container.cs    (revision 313)
+++ Container.cs    (working copy)
@@ -1385,7 +1385,7 @@
         }
 
         private static int m_GlobalMaxItems = 125;
-        private static int m_GlobalMaxWeight = 400;
+        private static int m_GlobalMaxWeight = 550;
 
         public static int GlobalMaxItems{ get{ return m_GlobalMaxItems; } set{ m_GlobalMaxItems = value; } }
         public static int GlobalMaxWeight{ get{ return m_GlobalMaxWeight; } set{ m_GlobalMaxWeight = value; } }

Thank you :)
 
can do this with out a core mode in containers script in the distro fils by changing the backpacks default weight

just look at how it is done with the strong backpack, and set it up the same using the overrides :)
 
Lord_Greywolf;799489 said:
can do this with out a core mode in containers script in the distro fils by changing the backpacks default weight

just look at how it is done with the strong backpack, and set it up the same using the overrides :)

Yes, it surely will be better, thank you for the hint!
Just give me 2-3 days before I surrender on this ;)

EDIT: oh, it was so damned easy :p

I will post it, although now the thread should be moved in Modification Suggestion now, since a core modify is not required.

In Scripts/Items/Containers/Container.cs
Code:
Index: Container.cs
===================================================================
--- Container.cs    (revision 313)
+++ Container.cs    (working copy)
@@ -189,7 +189,7 @@
             Layer = Layer.Backpack;
             Weight = 3.0;
         }
-
+        public override int DefaultMaxWeight { get { return 550; } }
         public Backpack( Serial serial ) : base( serial )
         {
         }

Thank you :)
 

koluch

Sorceror
Still a bug

Still a core issue(I believe) or every container you put in your backpack goes from 400 to 550 stones when placed in your Backpack, and when removed and placed on the ground goes back to 400 stones.

osd_daedalus;799504 said:
Yes, it surely will be better, thank you for the hint!
Just give me 2-3 days before I surrender on this ;)

EDIT: oh, it was so damned easy :p

I will post it, although now the thread should be moved in Modification Suggestion now, since a core modify is not required.

In Scripts/Items/Containers/Container.cs
Code:
Index: Container.cs
===================================================================
--- Container.cs    (revision 313)
+++ Container.cs    (working copy)
@@ -189,7 +189,7 @@
             Layer = Layer.Backpack;
             Weight = 3.0;
         }
-
+        public override int DefaultMaxWeight { get { return 550; } }
         public Backpack( Serial serial ) : base( serial )
         {
         }

Thank you :)
 
any container does that, even if the containers max weight is set to 10 stones, when placed in pack can hold 400 then once removed back to 10

or worse, lock it down in house, then unlimited weight i do believe

so it is acting just like normal that way

see the pack istself is also helping to support the smaller pack inside of itself (like placing a bag in a box the bag can nold more until taken out of the box, becasue the box adds support)
and that is why they can hold more weight while in the pack :)
 

koluch

Sorceror
Fixed.

Need to make a small change in container.cs in the scripts AND the core.
Makes just the Player Backpack, not the containers inside, 550 stones.Containers placed inside retain their maxdefaultweight.
 
koluch;804438 said:
Fixed.

Need to make a small change in container.cs in the scripts AND the core.
Makes just the Player Backpack, not the containers inside, 550 stones.Containers placed inside retain their maxdefaultweight.

yes, it's already known and fixed. We are awaiting the implementation :)

But you know, when you mess up with the core times are always longer.
 
koluch;804438 said:
Fixed.

Need to make a small change in container.cs in the scripts AND the core.
Makes just the Player Backpack, not the containers inside, 550 stones.Containers placed inside retain their maxdefaultweight.

please alsways post fixes, so others may use them as well
 
Lord_Greywolf;804447 said:
please alsways post fixes, so others may use them as well

yes sorry, it was on UOG-Demise forums, and now it's useless to post it because Mark included it in the last SVN.
I completely forgot about this thread, sorry about :eek:
 
actualy still good to post,
because not every one uses latest svn because their stuff is so customized, it would take weeks to upgrade it
or they have a custom core and do not want to try and merge changes,
or what ever the reason
 
Lord_Greywolf;804671 said:
actualy still good to post,
because not every one uses latest svn because their stuff is so customized, it would take weeks to upgrade it
or they have a custom core and do not want to try and merge changes,
or what ever the reason

You're right, these are unified diffs from svn 313 (before changings to these files) to svn 333 (actual):

In Server/Items/Container.cs:
Code:
Index: Container.cs
===================================================================
--- Container.cs    (revision 330)
+++ Container.cs    (revision 331)
@@ -108,21 +108,14 @@
         {
             get
             {
-                int maxWeight;
-
-                if ( Parent is Container )
+                if ( Parent is Container && ((Container)Parent).MaxWeight == 0 )
                 {
-                    maxWeight = ((Container)Parent).MaxWeight;
-
-                    if ( maxWeight > 0 )
-                        maxWeight = Math.Max( maxWeight, DefaultMaxWeight );
+                    return 0;
                 }
                 else
                 {
-                    maxWeight = DefaultMaxWeight;
+                    return DefaultMaxWeight;
                 }
-
-                return maxWeight;
             }
         }


In Scripts/Items/Containers/Container.cs
Code:
Index: Container.cs
===================================================================
--- Container.cs    (revision 313)
+++ Container.cs    (revision 332)
@@ -190,6 +190,21 @@
             Weight = 3.0;
         }
 
+        public override int DefaultMaxWeight {
+            get {
+                if ( Core.ML ) {
+                    Mobile m = ParentEntity as Mobile;
+                    if ( m != null && m.Player && m.Backpack == this ) {
+                        return 550;
+                    } else {
+                        return base.DefaultMaxWeight;
+                    }
+                } else {
+                    return base.DefaultMaxWeight;
+                }
+            }
+        }
+
         public Backpack( Serial serial ) : base( serial )
         {
         }

This way, only the backpack that does the part of "player backpack", in case ML expansion is activated, will inherit the new 550 weight limit. All other backpacks still have 400 weight limit, unless locked down and secured. Just like OSI. :)
 

Attachments

  • containerpatches.zip
    754 bytes · Views: 11

koluch

Sorceror
koluch;804438 said:
Fixed.

Need to make a small change in container.cs in the scripts AND the core.
Makes just the Player Backpack, not the containers inside, 550 stones.Containers placed inside retain their maxdefaultweight.

Sorry was a fast post, but yes the 333 svn has the fix in.
 
Top