Author Topic: [XP] Item Weight  (Read 8296 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Item Weight
« on: April 16, 2012, 01:13:11 AM »
Item Weight
Authors: ForeverZer0
Version: 1.0
Type: Item/Equipment Add-On
Key Term: Player / Party / Troop Add-on

Introduction

This system provides your game with an inventory "weight" feature. Every item and piece of equipment can be configured with an individual weight that provides a different dynamic to collecting items, since the player will have to manage their inventories instead of just collecting everything in sight. Settings for can be made for managing it on a "per actor basis", and various states can be applied when a character/party is "overweight".

Features

  • States can be applied to the whole party or individual actor basis
  • Every item, weapon, and armor can have a unique weight
  • Unlimited number of states
  • Can us a dynamic weight capacity that grows with actor power, or static capacity that you can control yourself via simple script calls
  • Automatic setting of game variables that are equal to the party's current weight and total capacity
  • Configurable modifier that allows for defining the rate of dynamic weight capacity based off actor strength
  • Automatic adding of weight to item descriptions if desired so that the player is always aware of each item's weight
  • Configuration for allowing or not items to be picked up by party or equipped by actors if weight would exceed capacity

Screenshots

None.

Demo

None.

Script

(click to show/hide)


Add-Ons

These are some add-ons to the system to either augment the script, or fix conflicts with other scripts. Unless otherwise instructed, these add-ons will all be placed under the main script in the editor.

Default Shop System Fix
This add-on will prevent the purchasing of items that would put the party overweight when OVERWEIGHT_PARTY is false. It also adds a nice display to the shop screen that will show the player the weight/capacity ratio of the selected quantity.

(click to show/hide)
(click to show/hide)

Default Menu Display
Adds a display to the default menu system that shows the weight/capacity of each actor.

(click to show/hide)
(click to show/hide)

Simple HUD
This is a simple HUD that can be displayed on the screen in the location of your choice. It can either be as a small window, or simple text on the screen. The font can also be changed as desired, and there is a script call for hiding/showing it.

(click to show/hide)
(click to show/hide)
(click to show/hide)


Instructions

Simple configuration, which can be found in the script.

Compatibility

Possible compatibility issues with actor equipping issues in custom menu systems. (See script for explanation)
If you have a problem with a custom CMS, make a post about it and see if it can be fixed, which should be quite simple.

Credits and Thanks

  • ForeverZer0, for the script
  • Bigfoot, for requesting it

Author's Notes

Please report any issues/bugs you may come across so they can be addressed.
Enjoy! Main
« Last Edit: April 16, 2012, 09:52:27 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #1 on: April 16, 2012, 01:30:13 AM »
Thank you so much!  I tried testing it out, but got a syntaxerror on line 535.  Not sure why, that's the end of the script.  I'll try going back into it and read the directions more thoroughly.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Item Weight
« Reply #2 on: April 16, 2012, 01:33:18 AM »
Let me check, I might have had some paste get cut off.

EDIT:
I didn't get a syntax error, make sure you copy the whole script and none gets cutoff.

After you open the spoiler, use the "Select" word at the top of the code field and hit Ctrl + C to make sure you get it all.
« Last Edit: April 16, 2012, 01:36:16 AM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #3 on: April 16, 2012, 01:41:02 AM »
The "select" code didn't seem to work.  But I made sure it was all copied properly and still got the same error.  IDK

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Item Weight
« Reply #4 on: April 16, 2012, 01:52:13 AM »
I dunno, might be issue with your browser.
Here's a pastebin with it.

http://pastebin.com/PFKbfHUG
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #5 on: April 16, 2012, 02:05:15 AM »
Ah, that seemed to work.  Thanks again!  You're the master!

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: [XP] Item Weight
« Reply #6 on: April 16, 2012, 07:45:10 AM »
let us know how this turns our bigfoot. this script sounds promising!

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #7 on: April 16, 2012, 08:33:26 AM »
I did some testing with it and found it to be exactly what I needed except for the fact that you can't tell how much the character is carrying or how much he can carry.  Some sort of display would be very useful.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Item Weight
« Reply #8 on: April 16, 2012, 08:53:34 AM »
i tested this as it sounds very useful, and i found a glitch, if the player is shopping and exceeds the the weight limit and gaining items when over encumbered is false then it still takes your money :P @ bigfoot your menu would need editing to show the weight variables value, wouldnt be hard to implement into it 

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #9 on: April 16, 2012, 11:19:20 AM »
Yeah, but perhaps there'd be a way to make a meter on the map.  Like a HUD.  I've seen it on other scripts.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: [XP] Item Weight
« Reply #10 on: April 16, 2012, 12:11:46 PM »
for the purpose of your game, having the display on the map would probably be useful. given other scenarios, perhaps a display in the menu would be more appropriate. either way, this is a thumbs up script.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Item Weight
« Reply #11 on: April 16, 2012, 06:44:40 PM »
Here is the catch with both of those problems. I can make a few quick fixes and they will be fixed, but so long only as you are are using the default shop and menu systems. I'll make them, but they are gonna be add-ons instead of integrated into the script, that way the script will still be easier to integrate into other systems.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Futendra

  • Guest
Re: [XP] Item Weight
« Reply #12 on: April 16, 2012, 07:10:24 PM »
When this is fully debugged, I will sure use this for my game! I was already thinking of a way to realisticly limit items (I grabbed an actual item limiter but it is kinda weird that 100 guns weighing probably like 10 kilo each is the limit. Neither is having only 10 potions.)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Item Weight
« Reply #13 on: April 16, 2012, 07:56:28 PM »
I added the fix for the default shop system. It will prevent purchasing of items that will put you overweight when OVERWEIGHT_PARTY is false, and adds a display to the shop menu.

EDIT:
I also added an addon to have each actor's weight displayed on the menu screen.
« Last Edit: April 16, 2012, 08:37:01 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Futendra

  • Guest
Re: [XP] Item Weight
« Reply #14 on: April 16, 2012, 08:45:01 PM »
Could you put the window to show the Weight of Actor 1 here (the code) so I can add it to a CMS?

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Item Weight
« Reply #15 on: April 16, 2012, 08:54:00 PM »
Take a look at the Menu addon above. I actually made an extension method to Window_Base called "draw_actor_weight", which works the exact same as all the default RGSS ones like "draw_actor_level", "draw_actor_hp", etc. It should be exactly what you are looking for.

EDIT:
Alrighty, I added a simple HUD add-on. Its pretty basic, but should suit most people's needs.
« Last Edit: April 16, 2012, 09:53:49 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Bigfoot

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Item Weight
« Reply #16 on: April 16, 2012, 10:07:06 PM »
Oh man, this is so great!  Thanks again!

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Item Weight
« Reply #17 on: July 30, 2018, 05:55:53 AM »
I know that this is necroposting but no one else has mentioned this but apparently, I use Stormtronics CMS and this may or may not have anything to do with the issue I'm having but if I go over my weight limit, the states won't apply like they should. Also, when browsing through my inventory, I will see how much any other item weighs except for weapons.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3206
  • LV: 387
  • Gender: Male
  • Choco Octo <3
    • View Profile
Re: [XP] Item Weight
« Reply #18 on: July 30, 2018, 06:53:14 AM »
I downloaded the Stormtronics demo and threw this script right below it. States are applied when I either go into battle or change someone's equipment (but not right at the start of loading the game). I used Venom (state ID 3) to test this. Note that a State with a Restriction of 0 does not visually appear in the UI by default.

Regarding the weapons, I see the weight values in its description just fine. I think you're using some other script that is conflicting then.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Item Weight
« Reply #19 on: July 30, 2018, 07:09:19 AM »
Ah, so that was the problem. Normally I thought the status effects would go right into play when the weight reaches the limit. I know, been playing too much Elder Scrolls lol.

All good to know, thank you.