How can I print a value integer in a display text action?

  • #1, by andy-rinaldiTuesday, 18. November 2014, 13:09 10 years ago
    I have a value variable QuizPointsValue as integer. I want print this variable in a display narration text.
    I know that I can print a value string:

    I tried with:

    str_points = getObject("Values[QuizPointsValue]"):setValue(VValueString)
    

    and
    local val_points
    val_points = getObject("Values[QuizPointsValue]"):getInt(VValueInt)
    str_points = val_points:setValue(VValueString)
    

    but both not works.cry

    Thanks.

    Forum Fan

    160 Posts


  • #2, by andy-rinaldiTuesday, 18. November 2014, 13:15 10 years ago
    One more question:
    How can I use the ValueRandom in order to assign it to a variable?
    Thanks.

    Forum Fan

    160 Posts

  • #3, by AlexTuesday, 18. November 2014, 14:37 10 years ago
    both of your examples are invalid syntax. If you want to print the integer value then simply write your text like this:
    current quiz points: <v=QuizPointsValue>
    


    EDIT: the forum doesn't allow me to post the text I actually want... the tag in the text above always gets discarded... sorry. better look into the wiki info here: http://wiki.visionaire-tracker.net/wiki/Displayed_Text

    ValueRandom is only used for the initial random value, if you need a random value during the game then use the action part "set random value".

    Great Poster

    378 Posts

  • #4, by andy-rinaldiTuesday, 18. November 2014, 14:55 10 years ago
    Hi Alex,
    I tried with v= syntax but it not works. Could you please send an email with an example?
    I sent you an email if you forgot my email address... wink

    Forum Fan

    160 Posts

  • #5, by afrlmeTuesday, 18. November 2014, 15:37 10 years ago
    it just requires you to add the name of the value (case sensitive)

    Say I have a value called "money" then to include it in a displayed text I just include:

    < v=money > (without the spaces between < & >

    Imperator

    7278 Posts

  • #6, by andy-rinaldiTuesday, 18. November 2014, 15:54 10 years ago
    Yes, I have the variable QuizPointsValue. I can't write it here in the forum but I tried with < v=QuizPointsValue > (without spaces) but it not works.

    Forum Fan

    160 Posts

  • #7, by andy-rinaldiTuesday, 18. November 2014, 16:03 10 years ago
    ok ok, sorryyyyyyyyyyyyyy. Now it's working. Ehm.... I forgot to call the display text action... roll

    Forum Fan

    160 Posts

  • #8, by afrlmeTuesday, 18. November 2014, 16:21 10 years ago
    hehe grin Ai sus!

    Imperator

    7278 Posts