Revealing a name and adding it to a description.
DarksDaemon
07 Dec 2012, 22:47I'm wondering if it's possible and how I would have a room description that changes after a player has looked at an object.
i.e.
Look
There is a large anvil with a goblin hard at work.
Look at goblin
The goblin is wearing a name-tag, it reads 'Murray'
Look
There is a large anvil Murray is hard at work.
i.e.
Look
There is a large anvil with a goblin hard at work.
Look at goblin
The goblin is wearing a name-tag, it reads 'Murray'
Look
There is a large anvil Murray is hard at work.
sgreig
08 Dec 2012, 04:04There would be two steps to accomplishing this. Firstly, you'd want to have a script that sets a flag when the player looks at the goblin. For example, goblin.lookedAt = true or something like that.
Next, you'd want to change the room description from text to script, and have a script something similar to the following:
Obviously you would need to change it to reflect the names of the objects in your game, but that should give you a good jumping off point. If you need more help with it, let us know.
Next, you'd want to change the room description from text to script, and have a script something similar to the following:
if (goblin.lookedAt = true) {
msg("There is a large anvil. Murray is hard at work.")
}
else {
msg("There is a large anvil with a goblin hard at work.")
}
Obviously you would need to change it to reflect the names of the objects in your game, but that should give you a good jumping off point. If you need more help with it, let us know.

DarksDaemon
08 Dec 2012, 20:01Thanks for the quick concise answer, I've got it running now, I missed the parts about flags in the tutorials and the wiki search didn't really help at all.
Thanks again.
Thanks again.
sgreig
10 Dec 2012, 09:37Glad I could be of assistance. 
