Within my game, the player is able to pick up a number of different objects. When they pick up an object the variable ‘holding’ is set to whatever it is they’re holding. E.g. *set holding "knife"
.
The game also tracks where, in the scene, each object is located. E.g. *set knife "in your hand"
.
The player needs to be able to drop whatever they are holding if they need to pick up something else. So I have implemented a drop trigger which I am trying to use as follows:
*if (drop_trigger) #Drop the ${holding} on the floor.
*set drop_trigger false
You have dropped the ${holding} on the floor.
*set ${holding} "on the floor"
*set holding "empty"
*goto label
I want to be able to translate that the object has gone from the player’s hand to the floor, as well as emptying the hand for the player to pick up a new object. I believe the problem is with *set ${holding}
as it’s coming up as an invalid expression. Is there a better way to go about this?