Series: Basic inventory system for the Blender Game Engine

Hello everybody.

After many requests in my YouTube channel, I created a series of tutorials on how to create an inventory system for the BGE. Tutorial makes extensive use of Python for BGE and has a little basic modeling.

I was reluctant to make this tutorial, mainly because of the complexity of the task and a language problem, since I’m not a native english speaker and it’s difficult for me to think what and how to say something while at the same time I’m working on Blender.

Anyway, I gave it a try and the result is the following 9-part tutorial :

Part 1, Creating the weapons database
Part 2, Importing the database
Part 3, Creating the dropped weapon items
Part 4, Picking up the dropped weapon items
Part 5, Visualizing the inventory screen
Part 6, Slots that hold multiple units of the same item
Part 7, Equiping inventory items to a character
Part 8, Dropping inventory items on the ground
Part 9, Save and Load System

Tutorial is very long, but I hope it will help people.

You can find the rest of my tutorials on Blender here.

Added part 9 of the tutorial.

All files that were created in this tutorial can be found here.

How about write a book in pdf , it would be better for such complex instructions and I think that such a book is missing here , I divided it into four chapters - 1.fps system 2.rpg system 3.point -click adventure system 4.save -load system .
Year old thread but I think this book is especially needed for those who can not program

I followed it with no problem. You do an excellent job of explaining and I am very grateful you took the time to share this. Thank you sir =)

This was clear, thorough and immensely helpful. Thank you so much!

I can’t open the dowload link… It shows 404

Uploaded the files again.

You can find them here

Hey Pananag,

Thank you for the tutorial, but I’ve got a issue, maybe you know a solution.

1.Everything has been working up to part 4 where I should be able to click items away. I got the weapons to end without clicking, if I moused over they would dissapear, but then I tried to get it so a near sensor would be the sensor.hitobject so my player could just go near them, and I haven’t been able to get nearsensor.hitObject to sense the weapons imported from load library -> weapon.blend. I also haven’t been able to get the logic.mouse.events (in the ‘main’ script, where you should be able to click -> endobject) working, I am using 2.7. I tried bge.events.LEFTMOUSE or whatever and it also didn’t work. I have the player object’s near sensor linked to the camera, which has the python controller with script ‘main’

2.I seem to remember, before I broke it, the weapons had some sort of physics bounds when I was looking at the physics engine, but as of now, they don’t and even if I change the physics in the weapon.blend file (and change it to blender game from blender render) there is no physics on the weapons. Maybe you explain this in a further part, please.

Anyway, you are good at making tutorials – everything has worked at some point or another, until now cause I screwed it up!

Once again, I posted too soon. After hours of stuff not working, I realized the physics just need to be static. I don’t know why I thought I had attempted that unsuccessfully. Also, the collision sensors linked from the player work, and life is beautiful. I thought I was going to have an aneurism. And now I am so happy.

Two things I am interested in knowing –

1: a script which counts the number of slots in the inventory database.csv and prints the number, also saves the number as a variable

2: instancing an object to repeat itself * how many slots are in the inventory database.csv