Weapon Inventory and how to script weapons.

You’re welcome of course.

One thing you could try to really get a “feel” for what happens in this case is make a simple script that is just one cell of your inventory. Put this into a script that you can access through an “inventory API” that does certain things to a cell.

These functions might be:

“Set the type of item”
“Query the type and quantity of item in this cell”
“Add 1 item to this cell.”
“Add N number of items to this cell.”
“Remove N item from this cell.”

Then you can have properties in the cell that say “I can hold only 1 item” or “I can hold up to 30 items” inside a particular cell.

Make some test buttons on a screen to do the above items, and also print out what’s in the cell.

If you get that going you have done a huge amount of the work.

After that you need the aggregate collection of these things. That would have its own API, perhaps things that say:

“Give me a blank cell, I have something for you” (you get a cell, you call the above set type, set quantity)
“Find me a cell with N number of items of type X”

That’s breaking the problem down into steps.

1 Like
Old School RPG Inventory List
Creating a shop and backpack inventory systems
Need some help for item inventory system
Refinery System
"error CS1022: Type or namespace definition, or end-of-file expected" (922309)
Adding Loot Box/Gacha Items to Inventory?
Costmeci / character creation And costum weapons in pixal art 2d top/down.
Best Practices - Data Structures for "Market" System
Customising player characters
Help with a inventory system c#
Inventory UI Hotbar
Object reference not set to an instance of an object (913413)
Array element returning null, but has data is assigned
NullReferenceException: Object reference not set to an instance of an object (933900)
Inventory system: prefab and scriptable object
Getting 'Null Reference' error while working with Array in Unity
Make a 2D character swap mechanic?
I want to create a text based inventory
Feedback on a Shop Script I Wrote
Error CS1061: 'List<GameObject>' does not contain a definition for 'add' - Help
How to add random items to Inventory dynamically?
How to change the image of an instantiated prefab in the UI by mouse click on a game object in the s
look the error is : Assets\scripts\InventorySystem.cs(84,25): error CS0839: Argument missing
Fashion Media App
Compare Tag not working as intended?
How to load scriptable objects during runtime in build
how to deal with equipment (armor, weapon)?
2D non-animated avatar creator?
how can i solve error CS1002
i`m trying to make a inventory i`m trying to make it so i don`t need to drag the slots
Define a Var depending on value from another Var
Issue with toggles in C# Unity
I don't want stacking in my inventory slots
loot system with Scriptable Objects
Scrolling Item Bar like Legends Arceus?
Best practices for holding Inventory UI / GameObjects / etc
Enum & inventory
Help on making an inventory similar to SCP:CB!
I've made an inventory drag and drop screen but when I press play how can I open it and close it
Inventory question (872243)
Script to reference GameObject not working on Mobile test?
Ideas on how to create a WoW-like ability system
Inventory Item Stacking Problem
Any method to hide objects is only affecting the prefabs and not the active instances
Setting the parent of a transform which resides in a Prefab...
Trying to make a Pokemon clone, not sure if my implementation is bad practice?
Help with character creation
How should I Manage my elements?
"Syntax Error, ',' expected" (879702)
Inventory Manager
Need help with Inventory Script
Problem with NullRefrence
How to use all of the items in 1 script
Using a ScriptableObject Based Inventory System and a FSM to Trigger Interactions
Hiding inventory bug
Scripts not awakening on Game Object
How To Set an Object That References It?
Multiple different playable characters
How to equip my character with more than 100 Armor?
How to programmatically set first selected item in Event System?
The logic behind equipping item models
How would you approach the creation of a versatile inventory system similar to Pokémon's?
HELP! How to fetch data from items?
Scriptable Object and Data Base
How to move items around in an inventory
how to make different types of scriptable objects?
How can I call a function from a nearby gameobject's script?
Menu Heavy Game - How to handle the data
Want to use interface for lootable items but don't know where to start
Best inventory system type for end user?(~grid vs list)
Object System / How to manage unique abilities
Hello guys, i need a little help in my code.
How to correctly insert new objects into the script
Checking for Certain Game Objects in a list with a Tag
How to Unhide a sprite and Hide it with the same button?
procedural generated voxel characters?
Move an item to a chest by clicking in its UI
In game computer shop system
Player Inventory Problems
Two Errors and a Warning.
Question on a (more or less) complex inventory/item system
Editor friendly system for item management and creation advice
How do i make an item highlight when i look at it?
Football stadium customisation
SIMPLE displaying static variables workaround
In-game "notifications" by checking if specific bools are true/false
Inventory System for Survival Game
Dealing with multiple types of items for an inventory
Creating a 3D Inventory system with swapping objects.
InventoryCell issue for inventory system
Inventory (Kind of)
Clearing and recreating Lists for Inventory System.
Inventory buttons not working
Instantiating Scriptable Objects
Can't change sprite of game object in script
Change Multiple Character Sprites
Build and run does not the same thing as in the editor
Best approach for multiple inventories dealing with a base Item class?
Vehicle selection menu with multiple cars at once
Creating items with random stats
Inventory Description/Name 2D
Adding face customization features to the game
Action coming off as null
Need help fixing a level system script
Remove item from inventory
Dragging a game object into a UI hotbar slot
GameObject set active not working in shop system
Issues making a daily hat store selector
Inventory Ui not working as expected
Get variable from other script with unknown name
How to make object in Canvas space themself and center on a line
Trying to add coins to user inventory after successful register
I have a problem with my saving & loading system
How can I Write Inventory System?
Trying to update field but unable to?
Inventory Managment/System for a factory game
Why isn't can't I set this bool correctly from an array & for loop?
Bottom left anchor changes child object position?
Elements in list become null after I try to print them
Bugs with character controller and Inventory System
How do a VR program - world building like game or virtual world?
UI click problem
Shared rig between skinnedmeshrenderer mannequin and clothes
How to check for certain words in string?
Sprite Library, Drag and Drop to replace labels sprites
Unity 2d Drag system
Finding all Types of a Class within the Assets
How can i detect the first empty slot in an inventory and allocate an item on it instead
Character changing clothes
Create inventory from folder
How to create a good upgrade system
List Not working
Item still in list after deleting