Display time when displaying information from tables

Hey everyone! I have a question about displaying information from tables. I followed the guide by tshirtbooth on the videos can I can get my table to display the value every second as it should. The problem is that the table value displays for like a micro second then disappears. Since it refreshes every second the game looks like it can give someone a seizure. I tried increasing the time on the timer i.e. 3 seconds instead of 1, but then it just blinks on the screen for a microsecond, disappears, then nothing is displayed for the other 2.9 seconds.

How can I make the text display of my table value stay displayed for the full duration of the timer?

Thanks!

Dan

Best Answer

  • tatiangtatiang Posts: 11,949
    edited February 2014 Accepted Answer
    It helps explain what you're building... but did my demo work for you?

    Changing an integer attribute every x seconds shouldn't cause a flicker unless the values the attribute is retrieving are changing at the same time. So if you're updating a table and then drawing values from that table simultaneously, you may have problems where the data won't show up briefly.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm not sure which video you're referring to but can you explain what it is you're trying to do? Are you trying to make table values to appear for a certain amount of time and then disappear? Are you cycling through table cells?

    How do you have your timer and rule set up? Is it like this:

    Timer for 3 seconds
         DisplayText [expression]

    What is the rule condition for the timer? Did you check run to completion?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • dkatz621dkatz621 Member Posts: 9
    It's the video about "the power of tables" where he makes the actors generate random words each second just to show what you can do with tables. I used that as the backbone for my setup.
    I made an actor, let call it X.
    I gave that actor an attribute call it Xdisplay.

    I then created a timer on the actor:
    Every 3 seconds:

    Change attribute: set self.Xdisplay to: tableCellValue( blah blah)

    Display Text:
    display self.Xdisplay in size 30 verdana red color

    I then put actor X on the scene and hit preview.

    I tried both clicking and unclicking the run to completion box and it did not seem to change anything.

    The correct values are displayed, but they literally show for a microsecond and then disappear.

    In the game i want to display a number value that changes in real time that people will have to react to. For example, a stock price that changes every second. It goes from 50 to 49 to 48 to 52 but all between 45 and 55. I want the display to show the price of the stock as it changes every second. I made a table with the values 45 to 55 in a column and told the attribute to pull a random value from the cell in that specific column.

    The setup runs correctly, displaying the values in the one column, but it just appears and instantly disappears no matter how long i make the cycles. I want the original value to stay displayed until a new value is generated.

    Does this make more sense? Sorry for the long explanation.
    Dan
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Dan,

    Long explanations are very helpful when it comes to figuring things out on the forums. I'm curious why you're putting your values in a table if it's literally a selection from 45 to 55. I would think it would be easier to do Change Attribute self.Xdisplay to random(45,55), but perhaps you aren't including every value in that range.

    Anyway, let me make you a demo...

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    Here you go.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • dkatz621dkatz621 Member Posts: 9
    Thanks! I appreciate the help. The game is more complicated then the 10 numbers.

    The number that is being pulled from a set is based on 4 or 5 other game attributes which are linked.

    The number is also paired with another number that changes in the same direction but is different.

    Sort of like, let's keep going with the stock example.

    You have game attributes of news, earnings, debts, hirings, and firings about the company.

    Each of these attributes will affect the price of the stock to a certain degree

    Drastic changes in any will drive the price to another grouping like 35-45, 45-55, 55-65, but minor changes, unless in every category, will keep the price in that range. I just don't want the price to stay stuck at 47. I want the price to be in the range of 45-55 until enough has changed to bump it into a new category, i.e. a new column in the table.

    In terms of the second variable, imagine you can buy the stock from Bob or Joe. The stock prices on the whole move in the same direction, but Bob may offer a slightly better price. I therefore want the same price groupings for the stocks, but their reaction to either news or earnings may differ slightly.

    Does this help?

    Dan

  • dkatz621dkatz621 Member Posts: 9
    I am now at work, so i will not be able to test it until tomorrow :(. Thank you for the demo, i will try it as soon as I can and get back to you asap.

    Dan
  • dkatz621dkatz621 Member Posts: 9
    Your example works! You use a different scheme than the video slightly, I'm going to change my code to emulate yours and we will see if it still works. Thank you so much!
  • dkatz621dkatz621 Member Posts: 9
    I figured out what the problem was! In your example, you put the display text attribute outside of the timer i.e. independent of. In my code I had it inside the timer. Man, the smallest things.....

    Thanks!

    Dan
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're welcome! :)

    The Display Text behavior constrains (constantly updates) the expression value so there isn't a need to use a separate timer or constrain behavior with it.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.