Heya all,
Another question that's been bugging me for a bit now. I prefer printing messages rather than having expressions when working in Quest, I find them easier - mostly.
One thing I tend to have to use expressions for is CapFirst
as Quest doesn't recognise {CapFirst(player.gender)
} or {CapFirst{player.gender}}
in messages, through my current experience. Has anyone got a way to put this function into a message or am I doomed to expressions forever?
Thanks!
Hello!
UPDATE:
See the answer here: http://textadventures.co.uk/forum/quest/topic/g1u-o_-ldkemnmiifa42aq/capfirst#da1b78ed-c5a1-475d-84b5-d5bd98646a6c
I don't think it matters if it's an expression or a message (but I may be mistaken (if I am, someone will most assuredly swoop in and save the day)).
There is a text processor, which translates code within curly braces { }
.
I think this lists every option available: http://docs.textadventures.co.uk/quest/text_processor.html
NOTE: CapFirst
is not listed. (Sorry!)
Are you only using it for player.gender
? (Or was that just an example?)
You could make an attrbute:
player.capgender = CapFirst(player.gender)
Then, just use that attribute henceforth...
msg (player.capgender)
or
msg ("{player.capgender}")
or
msg ("" + player.capgender + "")
As long as player.capgender
is set up (player.capgender = CapFirst(player.gender)
), these all produce the same output:
Screenshot (GUI):
Script (Code View):
player.capgender = CapFirst(player.gender)
msg (player.capgender)
msg ("{player.capgender}")
msg ("{player.capgender}")
msg ("" + player.capgender + "")
See the answer here: http://textadventures.co.uk/forum/quest/topic/g1u-o_-ldkemnmiifa42aq/capfirst#da1b78ed-c5a1-475d-84b5-d5bd98646a6c
This might help too:
Script: Code View:
msg ("" + CapFirst(player.gender) + " are reading this.")
player.capgender = CapFirst(player.gender)
msg ("{player.capgender} are reading this.")
Yeah, that's a neat idea. I could go the attribute route. It's generally that when I do expressions like that, I tend to just get so many errors about my quotation marks and especially when I'm doing large paragraphs of text where every his/her him/her and he/she needs to be some form of Lilt.possessive
Lilt.gender
etc, plus the other stuff. I think the issue is I'm pretty reliant on the GUI and need to learn to code more. I generally use the messages and rely on the curly brackets a lot for things like font, objects, commands, etc. But it's a good idea, I'll see if I can apply it.
As of 5.7 you can use any Quest code in an expression just by adding an equals sign.
{=CapFirst(player.gender)}
Ah...
I look, but I do not always see...
From the page I linked to in an above post:
"You are in the {eval:player.parent.name}"
-> "You are in the kitchen"
"You are in the {=player.parent.name}"
-> "You are in the kitchen"
"You are in the {=CapFirst(player.parent.name)}"
-> "You are in the Kitchen"
"There are {=ListCount(AllObjects())} objects"
-> "There are 6 objects"
"You look out the window: {=LookOutWindow}"
-> "You look out the window: A figure is moving by the bushes"
And CapFirst is even one of the examples!
<bangs head on keyboard>
It's generally that when I do expressions like that, I tend to just get so many errors about my quotation marks and especially when I'm doing large paragraphs of text where every his/her him/her and he/she needs to be some form of Lilt.possessive Lilt.gender etc, plus the other stuff.
Ha! You and me both!
Welcome to the club!!!