Creating an object link using an alias

In my game I have a system for random encounters that can spawn after a player has entered a room. When something spawns I want it to print a message which includes an interactive object link using the creature's alias, but I can't figure out how.

As far as I can tell, from searching, the solution should be something along the lines of:

"You can see a {object: " + this.alias + ".}"

or

"You can see a {object: " + this.name + ".}"

But that doesn't work. I've also tried adding "game.text_processor_this = this.alias" to the beginning, but that doesn't seem to help either.

Does anyone know how I can do this?


Ah silly me, I just needed to remove some of the spaces

"You see a {object:"+this.name+"}."


The spaces are irrelevant. It wasn't working because you had .} instead of }. at the end, so the text processor was looking for an object with a . at the end of its name.


Log in to post a reply.

Support

Forums