How to refresh room description?
Mareus
01 Jun 2014, 11:12Greetings everyone!
I hope I am not being a pain with all these questions I have, but this is the fastest way to learn in my opinion. I wonder if there is a way to refresh room descriptions? Often, you are faced with long walls of text after you have tried out a bunch of things. I already know about the clear window function, but I wonder if there is a way to refresh the room description so you see the changes you made to the room. For example your room might start with a description:
"You are in a bedroom. You see a chair, a book and a table. You can go north and west."
After I pick up the book, I want the description to refresh and notice the change by automatically writing a new line of text:
"You are in a bedroom. You see a chair and a table. You can go north and west."
I hope I am not being a pain with all these questions I have, but this is the fastest way to learn in my opinion. I wonder if there is a way to refresh room descriptions? Often, you are faced with long walls of text after you have tried out a bunch of things. I already know about the clear window function, but I wonder if there is a way to refresh the room description so you see the changes you made to the room. For example your room might start with a description:
"You are in a bedroom. You see a chair, a book and a table. You can go north and west."
After I pick up the book, I want the description to refresh and notice the change by automatically writing a new line of text:
"You are in a bedroom. You see a chair and a table. You can go north and west."

jaynabonne
01 Jun 2014, 13:36You can call the function ShowRoomDescription. That will invoke the same as if the player typed "look" or had just come into the room.
Mareus
01 Jun 2014, 16:25jaynabonne wrote:You can call the function ShowRoomDescription. That will invoke the same as if the player typed "look" or had just come into the room.
Thanks. It works. What about the alternative solution that would also allow you to add small changes to the first description you made? For example, description1:
You are in a bedroom and the only thing that catches your eye is a book and a table.
You see a book and a table.
Now lets say you broke the table and you take the book.
Des2:
You are in the bedroom and you don't see anything important.
You see some wood remains.

jaynabonne
01 Jun 2014, 16:38You can build some level of variability into your room descriptions with text processor commands:
http://quest5.net/wiki/Text_processor
Something like:
But your question actually has more in it, because what you have is not a simple "if". You list two examples, but there are more cases just for that one room (e.g. what if you take the book but don't break the chair, or break the chair but don't take the book). One such sentence (the latter) would be:
That gets into more algorithmic construction of sentences, something I've worked on and had luck with in some cases but not generalized. You could somewhat handle it by changing the name of the table from "a table" to "some wood remains" or swapping in a wood remains object when the table goes away (that probably makes more sense).
I think you would need to work out all the cases including what the desired text is, and then some code could be written to handle it.
http://quest5.net/wiki/Text_processor
Something like:
{if chair.broken:You see some wood remains.}
But your question actually has more in it, because what you have is not a simple "if". You list two examples, but there are more cases just for that one room (e.g. what if you take the book but don't break the chair, or break the chair but don't take the book). One such sentence (the latter) would be:
You are in a bedroom and the only thing that catches your eye is a book.
You see a book and some wood remains.
That gets into more algorithmic construction of sentences, something I've worked on and had luck with in some cases but not generalized. You could somewhat handle it by changing the name of the table from "a table" to "some wood remains" or swapping in a wood remains object when the table goes away (that probably makes more sense).
I think you would need to work out all the cases including what the desired text is, and then some code could be written to handle it.
Mareus
01 Jun 2014, 16:55jaynabonne wrote:You can build some level of variability into your room descriptions with text processor commands:
http://quest5.net/wiki/Text_processor
Something like:{if chair.broken:You see some wood remains.}
But your question actually has more in it, because what you have is not a simple "if". You list two examples, but there are more cases just for that one room (e.g. what if you take the book but don't break the chair, or break the chair but don't take the book). One such sentence (the latter) would be:You are in a bedroom and the only thing that catches your eye is a book.
You see a book and some wood remains.
That gets into more algorithmic construction of sentences, something I've worked on and had luck with in some cases but not generalized. You could somewhat handle it by changing the name of the table from "a table" to "some wood remains" or swapping in a wood remains object when the table goes away (that probably makes more sense).
I think you would need to work out all the cases including what the desired text is, and then some code could be written to handle it.
Hmm, there is perhaps a way around it so you avoid getting conflicting descriptions. Is there a way to remove the room description once the change occurs? So you would perhaps have something like this - description1:
You are in a bedroom that looks bla bla bla.
You see a bed, book and a table.
Once the change occurs the function ShowRoomDescription kicks in, but one which would first remove the upper sentence:
You see a bed and wooden remains.
How would one achieve that? I think it is a nice compromise.
BTW. I tried your script with an if command and it works. The only downside is that one has to be really careful and plan descriptions for every occasion.
HegemonKhan
02 Jun 2014, 00:49unfortunately, the nuances of descriptor messages~sentences~paragraphs, requires a lot of coding complexity, as those different combinations are quadratic~exponential, they grow really quickly... good coders can probably make some really fancy 'parser' code to handle all the different factors of changes in the descriptions~messages~sentences~paragraphs, but it's still actually a lot of work in code to implement what you want.
computers are stupid, to do something super simple that takes us a few steps, takes computers~coding like 50 or more steps...
for instance:
Simple for us humans to write and understand: 1 line
HK is a male human warrior.
To write in code for a computer~quest to understand, the exact same thing as seen above: 12 lines
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <alias>HK</alias>
-> <attr name="gender_string" type="string">male</attr>
-> <attr name="race" type="string">human</attr>
-> <attr name="class" type="string">warrior</attr>
-> <attr name="character_information" type="script">
->-> msg (player.alias + " is a " + player.gender_string + " " + player.race + " " + player.class + ".")
-> </attr>
-> <attr name="displayverbs" type="listextend">character_information</attr>
</object>
computers are stupid, to do something super simple that takes us a few steps, takes computers~coding like 50 or more steps...
for instance:
Simple for us humans to write and understand: 1 line
HK is a male human warrior.
To write in code for a computer~quest to understand, the exact same thing as seen above: 12 lines
<object name="player">
-> <inherit name="editor_object" />
-> <inherit name="editor_player" />
-> <alias>HK</alias>
-> <attr name="gender_string" type="string">male</attr>
-> <attr name="race" type="string">human</attr>
-> <attr name="class" type="string">warrior</attr>
-> <attr name="character_information" type="script">
->-> msg (player.alias + " is a " + player.gender_string + " " + player.race + " " + player.class + ".")
-> </attr>
-> <attr name="displayverbs" type="listextend">character_information</attr>
</object>
Mareus
02 Jun 2014, 09:12jaynabonne wrote:You can build some level of variability into your room descriptions with text processor commands:
http://quest5.net/wiki/Text_processor
Something like:{if chair.broken:You see some wood remains.}
But your question actually has more in it, because what you have is not a simple "if". You list two examples, but there are more cases just for that one room (e.g. what if you take the book but don't break the chair, or break the chair but don't take the book). One such sentence (the latter) would be:You are in a bedroom and the only thing that catches your eye is a book.
You see a book and some wood remains.
That gets into more algorithmic construction of sentences, something I've worked on and had luck with in some cases but not generalized. You could somewhat handle it by changing the name of the table from "a table" to "some wood remains" or swapping in a wood remains object when the table goes away (that probably makes more sense).
I think you would need to work out all the cases including what the desired text is, and then some code could be written to handle it.
I tried the "if" command and it works. Thanks for your suggestion. I should have figured this out by myself. Of course, with more objects out there, this gets progressively more difficult to code, so I will try to find some way around this.