Inventory system?
I need an in depth tutorial on A)how to create an inventory system. Even a very simple one. No idea where to start. And B)how to make something on the ground lootable. I tried keyframing it to where the one on the ground loses power and the one in your hand gains power when you click square in the trigger zone but the one on the ground does not disappear even though it has no power running to it. And this also does not make it go into an inventory at all. Just appears in his hand making it very very limited. Please help!! I am so so lost with all these random gadgets and so so few tutorials!
-
B) Have you confirmed that the one on the ground has lost power? Try using playtest mode to see gadgets etc. while you're playing the game. You should be able to tweak the object and see if it's really being powered off or not. https://indreams.me/guide/palette-glossary/assembly/modes/playtest-mode
-
Hey, so say for example you have a sword that you want the user to pick up:
Character's Microchip
1. Add a Tag onto the microchip. Name the tag "SWORD" (i usually use all-caps for this sort of thing but you don't have to).
2. Hook up the Tag output (the one for when the Tag is detected) to an "And" gadget. Hook up the output of the Square button on the Controller to the other input of the And gadget.
3. Add a Variable Modifier to the microchip, set the variable name to something like "CONNIE_HAS_SWORD" (or whatever your character is called), set the operation type to "set", and the operation value to 1.
4. Hook up the output of the And gadget to the power input of the Variable Modifier.
5. Create another Variable Modifier with the same variable name but change the Operation Type to "get". Hook up the "variable value" output of this Variable Modifier to the power port of the Sword object in the character's hand.
Collectable Item's Microchip (the one that will be "collected")
1. Add a Trigger Zone to the Microchip and set the "things to detect" to Tag and setup a zone to detect the tag which is roughly where your character will be when they can collect the object. Set the name of the Tag to detect to "SWORD" (you can use up and down on the d-pad to cycle through Tags already in your scene).
2. Add a Variable to the microchip. Set the Variable name to "CONNIE_HAS_SWORD".
3. Add an "And" gadget to the microchip. Hook up the "Detected" output of the Trigger Zone into the And's first input. Hook up the output from the Variable's "value increased" port into the other input on the And.
4. Add a Destroyer to the microchip and hook up the output of the And gadget to the power port of the Destroyer.
Summary
What you've got now is a Variable called "CONNIE_HAS_SWORD" which by default is set to 0 and therefore does not power-on the sword in the character's hand. When the character moves within the trigger zone and presses square the variable is increased to 1 which powers-on the sword. On the collectible item, the Variable increasing triggers an output which, along with the detection of the character in the trigger zone causes the Destroyer to be activated, deleting the item from the scene.
Next steps
Next you should try repeating the process with more objects / variables.
Also, the Operation Type of a Variable Modifier on your character could be set to "add" instead of "set" to give you a count of the number collected rather than just an on / off. For example, this could be used for ammo.
Once you have multiple objects in your inventory you'll need a way to cycle through the objects you have.
You could use a Selector for this, with each input being the Variable Modifier for that object (ie "CONNIE_HAS_SWORD") and the output going to a different object in the character's hand (ie the Sword) and an input from the user's controller moving the selector on until the selector's output signal is "on" (ie the character has the object in their inventory)
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.