basic inventory script, curious what items people feel need to be useable via the inventory so i can add those?
currently have keys, ammo and health packs (weapons likely wont be added as there's not really a quick way to un-equip a weapon?)
easily set the quantity to add via the name property (also automatically links the icon image via the name)
custom weight limits via entity strength stat so you can easily control how much the player can carry
custom script for doors so it tells you which key it needs and removes key from inventory once unlocked
scroll list of inventory with mouse wheel and highlight an item with the mouse cursor (and use items via left click)
doesnt support multiple levels yet unfortunately due to the save/load system not saving arrays but if ever that gets updated i will add it.
*video will come later as i don't have time to upload it now*
scripts will be uploaded once the settings have been double checked for custom placements etc and when i get some feedback on items.
(you will need to provide your own icons/images of course)
edit;
reworked the door and key system so it's a lot better on inventory space.
edit2
setup; (see pictures)
1. create folder in scriptbank\images\inventory
1.a. create .png files to act as thumbnail icons for the inventory (name these exactly as you want the prompt to appear on screen - capital letters etc)
*note all items in the inventory MUST have an icon or it will crash*
1.b. create a cursor.png file to act as the mouse cursor while using the inventory screen
2. place a static = no and always active = yes item to act as the inventory.lua script holder
2.a. assign a sound for opening & closing the inventory (slot0 = open, slot1 = close)
3. place static = no items with inv_gen_item.lua
3.a. name them in the properties EXACTLY as you named the related .png file in step 1.a. AND add a comma , followed by a value for the quantity
*in the case of ammo you will need to update both the quantity field in the properties panel and add it to the name as above*
3.b. set their strength to the weight of the item (this value will act as a limit for how many items the player can carry, create your own weight values)
3.c. assign the sounds to for picking up the items and using the items (slot0 is used for picking up ammo and keys, slot1 for picking up anything else - this is because items such as health already use slot0 for their default sound --- the free slot will then become the use sound)
4. if you have any keys then assign the respective doors inv_door.lua copy in the name of the key exactly (remember to include the , and the quantity) into the 'usekey' field of the door like normal
4.a. copy the name of the key (without the , and the quantity) into the name of the door so that the prompt will show which key it requires.
ingame;
press i during game to toggle the inventory.
keys must be examined (clicked) before they can be used to open doors, they will automatically be removed once they have unlocked the last door they are used for.
*note there is currently no limit on HP or ammo usage*