[Solved] Why can't I display a Real Number?
loganobarr
Member Posts: 12
I have a table that has 5 rows and four columns, in each cell there is a different number(Real Numbers). I also have an attribute that is a real number. the attribute equals TableCellValue(game.Table, random(1, 5), random(1, 4))
Now I want do display it on an actor so I have the actor have a display function on it. the function reads Display game.Attribute
But It only displays a zero and I cant figure out why
Best Answer
-
tatiang Posts: 11,949
@loganobarr said:
I feel like a fool, the problem was that I had the change attribute on the wall, but I did not have the wall present in the scene...Then it's an easy fix!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
In your TableCellValue expression make sure that you are selecting game.Table from the attribute browser instead of typing its name in. The same goes for game.Attribute in the Display Text behavior. Is the attribute a real type as well as the table cells?
Also pay attention to the order of your rules. Is it possible you are setting the cell value after you are changing the attribute?
If you're still stuck, upload screenshots of your rules to a file-sharing service and post the links here.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
https://www.dropbox.com/s/pnb7a3rjfiq5nub/Screenshot 2015-10-16 19.56.13.png?dl=0
https://www.dropbox.com/s/5bkdgahx8kre9yp/Screenshot 2015-10-16 19.56.27.png?dl=0
https://www.dropbox.com/s/c8v5r8qeyy5gu9h/Screenshot 2015-10-16 19.56.43.png?dl=0
https://www.dropbox.com/s/lutl9d1z8ryppmq/Screenshot 2015-10-16 19.56.58.png?dl=0
The attribute is Job type/location and the table is Jobs. the actor is Actor 1
Your rules look correct. Have you verified that the Change Attribute behavior actually occurs? You can do that with a Log Debugging Statement.
Another option is to upload a link to your project file. Sometimes there are more obvious issues that can't be observed through screenshots.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I belive the change attribute is where the problem occurs, but what could cause it to not work?
I feel like a fool, the problem was that I had the change attribute on the wall, but I did not have the wall present in the scene...