This system will allow you to add inventory to your project that holds up to 24 objects of various types at the same time. And also create your own objects, with customizable effects. Inventory can save items between levels, and it also works with a standard system for saving and loading.
The system includes:
Inventory script.
The script of the item.
Script zone victory with saving inventory.
The script of the victory zone, if you have the required number of items.
Three examples of the item.
(Examples of items are in the databank folder)
The system does not include:
Sounds.
!Update 12/11/20
Item Creator can now be used to create items. For more details, see paragraph 2.2 (Program Item Creator is not part of this product and is not required for its performance).
!Update
"InventoryItems" folder moved from "GameGuru \ Files" to "GameGuru \ Files \ databank"
1) How to add inventory to level:
Add any entity to the level.
Set the dialogue script (stv233_inventory_system) in the Main property.
Set the Static Mod property to No.
Set the Always active property to Yes.
After starting, press the B key to open or close the inventory.
You can also set sounds for inventory to the corresponding property of this entity:
Sound0 - Opening inventory
Sound1 - Closing inventory
Sound2 - Switching between cells
Sound3 - Using the item
Sound4 - Deleting an item
2) How to create an item, and add it to the level:
In GameGuru \ Files \
databank, create a folder and name it InventoryItems.
In GameGuru \ Files \
databank \ InventoryItems, create a folder and name it what you want to name the item.
Inside this folder, create the init.dat file.
Complete the file as follows:
ItemEffect = * Item effect number *
EffectCount = * Number of effect of the item *
Image = * Item Image *
CanUsed = * Can an item be used *
CanDeleted = * Can I delete an item *
The "ItemEffect" property indicates the number of the effect that will be applied after its use.
The system includes 5 standard effects:
1 - Add health
2 - Add lives
3 - Set health
4 - Set lives
5 - Cause damage to the player
You can independently add a new effect in the ItemEffect function of the stv233_inventory_system file using the template proposed there.
The "EffectCount" property indicates the number of effects that will be applied after using the item.
The property "Image" indicates the relative path to the image of the subject.
The "CanUsed" property indicates whether this item can be used. (1 - yes, 0 - no)
The "CanDeleted" property indicates whether it is possible to delete this item. (1 - yes, 0 - no)
In the same folder, create the des.dat file.
Write a description of the subject in it.
In GameGuru, add inventory to the level, as described in paragraph 1.
Add any entity to the level.
In the Name property, specify the name of the item, the same as in the name of the folder.
In the Main property, set the item script (stv233_inventory_system_pickuppable).
In the Strength property, set the number of items to be obtained.
Set the Static Mod property to No.
Set the Always active property to No.
You can also specify sounds in the corresponding fields of this entity.
Sound0 - Upon receipt of the item.
Sound1 - Failure if inventory is full.
2.2 ) How to create an item using Item Creator:
To create items for this inventory system, you can use the
Item Creator program (
Program Item Creator is not part of this product and is not required for its performance).
Launch Item Creator and select "New Simple inventory system project". In the window that opens, enter a name and select a place where the project with your items will be stored, then click "Save". After that you will get into the project management form. To create an item, click the "Create new item" button in the upper left corner, then fill in all the necessary information about the item in the window that opens and click "OK".
The item you just created will appear on the right side of the project management form. Click the "Export" button located on the right of your item. Select the "GameGuru \ Files \ databank \ InventoryItems" folder and click "OK". Your item is now ready for use in the engine.
3) Victory, if the item is in the inventory.
In the Main property of the winzone, install the winzone_if_item_is_in_stock script.
Set the Name property according to the following pattern:
Item Name|Minimum required quantity.
4) Saving inventory between levels.
In the Main property of the victory zone at the first level, install the winzone_is script
At the second level, create an inventory in as in paragraph 1.
Name property of the entity on which the inventory is installed, change to Load.
please assist
for the Init.dat and the Des.dat?
Thanks!
PS. I got the script to work, only the filepath for the image causes a problem.
Does the image filepath need the .png at the end? Here, an example file would be great!