Making picked up items visible in your inventory
From Platinum Arts Sandbox Free 3D Game Maker
To make items that are picked up visible in your inventory you need to do the following:
- You need a saved map, on which the inventory and items are working.
- Go to "my_stuff/packages/base" folder.
- Create a new text document and rename it to "yourmapname.cfg" (NOTE. The conguration file needs to have exactly same name as the map you want it to work for)
- Open the cfg file. Preferably in ConText or Notepad++, it is possible to do it in notepad, but not recommended.
- Write the following to the cfg file:
items = 0
level_trigger_1 = [ echo "You picked something up!" items = (+ $items 1) ]
newgui main [ guilist [ guilist [ guibutton "Inventory" "showgui inventory" ] guibar guilist [ guibutton "Unload This map´s UI" "newgui main [@main]" ] ] guibar @main ]
newgui inventory [ guibutton "Back" "cleargui 1" guibar guitext (format "You currently carry %1 items with you" $items) ]
The example is made so that you are picking up items, but you can change that and add in stuff.
- Save the cfg file.
- Now when You have set up the Inventory you need to open Sandbox and load the map you made the configuration for.
- Place a mapmodel and select it.
- Press F3
- Set the "trigger type" 12 so the item can be picked up.
- Set the "trigger tag" x (x is the number you wrote in maps cfg (level_trigger_x)) In current example 1
- test the map, If you did everything right you should be able to see how many items (or sth else) you have :)
NOTE: For items to be able to be picked up you need to load the map in Single player, you can do that by typing SP in the console when your map is loaded.