Display time when displaying information from tables
dkatz621
Member Posts: 9
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
How can I make the text display of my table value stay displayed for the full duration of the timer?
Thanks!
Dan
Best Answer
-
tatiang Posts: 11,949It 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
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
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
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
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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
Dan
Thanks!
Dan
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