Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Eventing or scripting weight based inventory

I am using RPG Maker XP. I have searched for a weight based inventory script like the ones in Fallout 3 and Oblivion but could not find one. I am currently trying to event it but I keep hitting roadblocks. I have a total weight variable, and variables for each weapon that add to the total when a pickup is activated (simply using the event to increase weapon/item/armor by 1 wouldn't let me trigger it so I made pickups). I made a very long common event called update weight that has a conditional branch to check if each weapon/item/armor is in the inventory and increase the total weight by the item's variable and set the elses to set the respective item variables to 0. Then I put a set total weight to 0 at the top so the number would not multiply every time the weight is updated. I was planning to put a update weight common event on all the pickups and pretty much everywhere items may change such as shops and storage units. The problem is that say I pickup a kinfe that weigghs 1. Then I pickup another knife, then my total weight would be updated to 2. If I put 1 knife in a storage unit or sell 1 knife, my total weight still reads 2. One way to fix this would be to unstack items such as weapons and armor so they take up separate slots in the inventory but I don't know how to do that. Then I tried using a Custom Event Trigger script found here,
http://forum.chaos-project.com/index.php?topic=6893.0

This would simplify things if I could get the variables to vary when the increase/decrease item event is used, this would eliminate my pickups.

If you know where I can get a weight based inventory script, how to unstack items in the inventory, or can explain how to event this system, I would appreciate it. Thank you.
 
This would be sooooooooooooooo much easier with a script. I took a look & found container scripts, inventory scripts. but nothing weight based.

There are 3 places where you gain/lose stuff. Event command, Shop, and Battle (Treasure, Item use)

What do you want to happen in a shop when the party's capacity is full? (or would be overfull if item is purchased)
What do you want to happen at the end of battle when the party's capacity is full?
Do you need the party's current burden / capacity to be displayed anywhere?
Will capacity be a fixed #, or will it change as party members join/leave? (more people can carry more stuff. Could be strength based???)
Do you want to include Equipped equipment in the current burden? (if not, a person wielding a knife should not be able to swap for an axe)
Is selling the only way to lose an item? Alternatives would be "Drop Item" (it just disappears) or "Store Item" (in a chest or safe place)

stuff to think about.

Did you check out the Diablo style inventory & the Diablo starter kit?
 
Thanks for the Diablo starter kit idea. I downloaded and installed the inventory portion of the script and it works fine so far. I've been looking at the script and can't figure out how to edit the amount of squares each item takes up. I would also like it if you could unstack weapons and armor so their stack limit is 1, so if you pickup a second, it takes up another section of the inventory. I took it straight from the demo so all the default sizes are in there. I attached the script to this post

[pastebin]428[/pastebin]



This is my first time attaching a script so I hope it worked. I would also like to know how to change the maximum inventory size, and if possible have some way for the character's strength to effect the carry capacity.

I agree, the way I was trying to do it early would have been a major headache, but I think I revised it enough so it would work... just be impractical.

*Update*

Okay, I have been playing around with the script more. It seems that all weapons are set to 1 by 3 in the grid inventory, armors set to 2 by 3 and I assume items set to 1 by 1. Luckily the weapons and armors are unstacked so that solves that problem. I would like to edit each weapon and armor to take up a certain amount of spaces in the inventory. A pistol would take up 2 by 2, a rocket llauncher would take up 2 by 4, and a medkit would take up 1 by 1, but I don't know how to do this. I'll continue to work on it. Thanks.
 
I still can't figure out how to edit this script so different items take up different amounts of squares in the inventory. I would greatly appreciate it if someone could tell me how to do this. Thank you.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top