Using Display text to display a variable attribute in one state

Hey everyone! I've been at this for over an hour now and am at my wits end. The problem I am having is this:

I am trying to create an actor that when touch is pressed displays a game variable, lets call this variable price.

Now, price changes every few seconds, but I want the price that is displayed to remain the price that was there when the player hit the button.

All of my attempts at using boolean attributes, separate actors, etc have failed. I either create a display text that instantly goes away. Or, the display text says, but continues to update the price in real time.

What can be done?

Dan

Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    edited February 2014 Accepted Answer

    @dkatz621

    Hi Dan, make another real attribute, let's call this ShowPrice

    So in the button you press, put your Display Text behaviour, with ShowPrice (selected via the expression editor, as you know, I'm sure).

    --now add

    Rule: when touch is pressed
    Change Attribute scene.ShowPrice to scene.variable price

    Edit: ah, you figured it out yourself, great!

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

  • dkatz621dkatz621 Member Posts: 9
    Huzzah! I figured it out. I made a self attribute that pulls the state at that time and added it to the original display text. Now it only shows the number when touch is pressed. Man, it seems so obvious when you figure it out.....
Sign In or Register to comment.