I am attempting to use python to script an inventory system. I have spent the past two days attempting to create something…
Essentially I want an inventory screen to be overlaid when the player hits the TAB button. In the inventory screen are empties. Each empty will have an inventory item plugged into it when it is acquired.
I want to be able to right click on an item with the mouse (already accomplished) and have it disappear from the screen, adding the value to a variable to show up on the inventory screen. However, I am unable to accomplish this. Could someone provide a good tutorial or maybe some scripting for me to check out?
I have looked at both the FPS tutorial/demo where the guns appear, and also at the Monkey Island demo. I was unable to figure either of them out.
I would use an array to keep all the items stored in it… and whenever the user click on an item, I add the ID of that item to the ITEM array, and make the item dissapear from the screen. And when you press TAB (or whatever) make the script automatically assign objects to the empties based on the ITEMs list in the array.
I’m making something… well… I’m doing exactly THAT for my game…
BTW… which Monkey Island demo r u talking about? (deja vu)
The array idea is basically what I am doing. However, my problem is how in the heck to get the objects to propigate the empties on the inventory screen. None of the info I’ve found was very clear on that.
As for the Monkey Island demo it is the one I downloaded from an old message here on the board. It begins in a jail cell and you try to escape.
Ok, so… you say you need some help displaying the ARRAY data. Ok, so i figure you first have to trim some data to display it into the inventory. Say, out of 20 items you just show 10. I don’t exactly remember how to do that, but, well.
Once you get the items you wanted, the script should somehow be linked to the empties, right? And know which empty is where.
So “knowing” that, the script would simply add icons over the empties or replace the empties themselves (if I recall well, when replacing an object it keeps it’s logic bricks… I think it does).
That’s my idea as of now, haven’t had time to work it to blender yet. So, how are you facing this problem for your game? Maybe I just repeated all you tried to do :?
Anyway, glad to be of assistance… if at all!
BTW: I’ve found the MI demo, downloading it right now