Question about object attributes.

I'm working on a text based survival sim and I have a fire pit which is a container in the room.

I am trying to make it so only "wood" can go in the fire pit. I cant script so I'm using the in-game clickable script editor.

I have it setup right now so that under the containers tap there is a script that runs when trying to put an object in the fire pit. It is an if statement that checks to see if "this" object has the attribute of name "pit". If it does then it moves "this" object to object fire pit. Else it just prints a message saying "You decide against putting this in the fire pit."

So I have an object called "wood" and added an attribute called "pit". So...... Shouldn't this in theory check to see if the object added has the attribute, which wood does, and then allow the wood to be placed into the fire pit? Because what keeps happening for me is it always comes up and says "You decide against putting this in the fire pit."

Thank in advance, I hope I made that clear. I'm new here, first time poster. So bare with me. :)

Thanks again!


checks to see if "this" object has the attribute of name "pit".

You want to check if the "object" object has an attribute named "pit", if I'm understanding you correctly.
Within the fire pit's addscript, this and container are both the fire pit, while object is the wood (or other object the player is trying to put in)


Thank you! I figured out what I was doing wrong. Your reply helped me a lot. Thanks again!

Since you helped me there will be a little easter egg hidden somewhere in the game that mentions you. :)


๐Ÿ‘€ ๐ŸŽ๐Ÿ˜


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums