How to combine variable with text in a Display Text-actor?

Danneman101Danneman101 Member Posts: 59
edited January 2012 in Working with GS (Mac)
One thing I never figured out is how to combine text with variables in a single Display Text-actor. Is it possible, or do you have to make various Display Text-actors to get that working?

Comments

  • ultimaultima Member, PRO Posts: 1,207
    use search function of the forum...
    ok here is it again, in the display text box type in
    "quote your text"..game.attribute

    quote whatever text you want to display, follow by two dots to connect to attributes...
  • Danneman101Danneman101 Member Posts: 59
    Thanks, wow, that was some weird syntax. One thing to mention is that you need to press Alt+Space to get Space, and use escape sequences for things like a new row:
    http://itee.uq.edu.au/~comp2303/Leslie_C_ref/C/FUNCTIONS/escape.html
  • LBGLBG Member Posts: 277
    I was just trying to debug my project and was looking for this info. I can get the syntax to work for real and integer attributes but I get an invalid expression for booleans. Any idea why?

    Cheers,


    LBG
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    in Display Text: syntax is how the phrase is worded: the order of the text you want displayed

    in the expressionEditor
    1.  what text you want … 
       text is processed by the computer as a string of letters
          so you type in " to begin the string — the computer knows what follows is the letters
          at the end of your text — it is a good idea to type in some null letters(spaces [option+space])
             to separate text that follows
          when all you letters/punctuation/number(string#)/nulls are typed —
             you let the computer know the string is done with "

    2. to tell the computer there is more in this display of text — you type in: ..

    3. the text value of the attribute you want displayed
          in GS the attributes are separate entities; you merely select them from the list!
    and, of course you decide the order of the text

    this works great with tables! under function select TableCellValue(whatTable,whatRow,whatCol)

    @LBG … mine too! … when asking for the value of one boolean to display: works fine …
    when combined with "text" (or "commands"): InvalidExpression
    and, thought, in the Webinar, one of the frameSets appeared to show a list of booleans and their state!

    try for weird: in DT behavior: exp: "\nselectedAttribute" … needs the quotes
    this displays: vars['game.attributes.id#'] and what use is that … they're all in the XML assets which display cleanly in Safari

    @};- MH
Sign In or Register to comment.