Set variable as object?

I’m trying to make a container that the player can take stuff out off. I want to create a dynamic system that works for any container and that you can easily change the inventory of any container. This obviously calls for variables so I made a structure variable for checking the inventory of one container with children for each item in the container. I tried setting the string of the variable to the same name as the object and then calling for it when the object is created on the ground next to the player, when the player takes it out of the container, but this doesn’t work for me. Am I doing it wrong? Is there an alternative way to do this? Here are my events:
Sets the string to the name of the objects.

Tries to create an object with the information in the string variable.

1 Like

For this specific situation you can use the action to create objects from name, right under the action to create objects (just put all the possible objects, here the pistol and ammo, in the same group, for example “DropItems”) :slight_smile:
About objects as variables, you can’t do that (you can’t use dynamic strings as objects for other conditions/actions), object groups is the closest workaround, you can launch conditions/actions over entire groups but selecting specific objects through the object name for example.

Ok. I’ll try that out.

EDIT: Lizard gave me further assistance on Discord, because Lizard is a boss.