How to make an alias change after looking at the object [SOLVED]

pinku
26 Feb 2017, 12:56

Hey there, I just started using Quest yesterday, so this is probably a stupid question...

I can't figure out how to make the alias of a door change after looking at it. It has a plate attached that says 'Tower', so after having the player read it, I want the alias of the door to change from 'Door 1' to 'Tower door'.

I tried this using a flag, but it didn't work. It would probably be better to use the door attributes, but I can't figure out how to do that.

Help would be much appreciated! I use the desktop version btw.


TinFoilMkIV
26 Feb 2017, 14:13

Assuming your 'Door 1' is an exit, then you want to select the exit object itself (not the room it's in), and at the bottom of the first tab labelled 'exit' there is a section for a look description. There's a dropdown menu for the description type, you want to select 'run script'. This lets you run code when the player looks at the exit. For the actual description you'll want to include a show message command to have the game show the actual description, and then after that you can change the exit's alias
ie:

//in the description script
msg ("The door has a plate attached that says 'Tower'")
this.alias = "Tower door"

You can specifically write out which exit is having it's alias changed but 'this' is a special object reference that says 'whatever object holds this code' and is generally easier and won't have issues if for whatever reason you change the object name of the door.

If your door is in fact not an exit type object, the process is actually exactly the same however the description section is under the 'setup' tab.


pinku
26 Feb 2017, 14:24

Thank you so much!!! That did it :)


TinFoilMkIV
26 Feb 2017, 16:02

Your welcome, glad to help.