I'm designing a mystery game, where you have to solve puzzles by presenting evidence. When you present the right piece of evidence (Items), that puzzle's variable increases by 1. Most puzzles require multiple pieces of evidence, and will only be solved once the variable is high enough. My current idea is that you present all the evidence at once, the game tells you how many pieces were correct (by displaying the variable), but not which ones.
However, there's an obvious flaw here: you could cheese this by just presenting the same piece of evidence multiple times. I want, when the player selects an item, for it to go away from their inventory, and then to be given back to them if they only got a certain number of questions right. Is there a way to do this?
I'm sorry if I didn't explain this well
Usually, games like this just take evidence item away once you present it - not only can you only use each one once, but the player doesn't have a bunch of old, useless evidence clogging up their inventory.
If you want to give evidence back, what you might want to do is have a Switch for each piece of evidence (a switch for "Pipe showed", a switch for "Wig showed", etc.), instead of a single variable for each case - and the way to detect whether all the appropriate evidence has been shown is by nesting conditional branches that check each Switch.
Finally, to answer your question more directly, what you could do is take the items away when presented but also have those same Switches, and then give whatever items the player has presented back to the player if they didn't show enough evidence. For example, if the "Wig showed" switch is ON but the variable isn't high enough, then give the Wig item to the player.
Why don't you just let the player present all the evidence, without taking anything away, and only take it all away when they've provided ALL the right evidence? No messing with switches, variables or items.
You could have two of the same items and when you present an item, it takes it away and gives you the copy. The copy could be programmed to say "I already showed this item" and could be excluded from the variables related to the puzzle.
there's the has item and use conditional branches.. or use switches.. if evidence 1 submitted EVI1 == ON. so that the next time the checking runs it will skip the checking of the evidence and not raise the variable.
You don't need a variable if you let them present everything at once and only proceed when they give you all the correct items at the same time.