Listener for a changing table cell value
GreenHavenGames
Member Posts: 62
I need a way to listen for a change in a table cell value. It needs to be always on and do this simultaneously for 20 goals across 20 scenes.
What I need to do is display all goal's progress on a single sign, if that goal is being done. However, I don't want to display all goals at the same time, and instead need to figure out a method for getting the sign to change every time a goal is being met that is different than the one that they were previously meeting. (i.e., if they're now picking apples, but before they were making clouds rain, I need to show the progress towards the apple goal when they're picking apples and show the raincloud progress when they're making clouds rain)
Any suggestions?
Comments
@GreenHavenGames
You can use a game level attribute to control the current action, eg. game.CurrentAction
As the user starts to perform an action, assign the associated number to it.
If picking apples: game.CurrentAction = 1
If making it rain: game.CurrentAction = 2
etc.
You progress bar can now visually change according to the state of the game.CurrentAction attribute. The value can be picked from the corresponding table row by a constrain behavior, also according to the game.CurrentAction
tableCellValue( game.T_ProgressTable, game.CurrentAction, 1)
This is assuming that the progress for each action will be stored in the appropriate table rows.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Thanks Hopscotch! Something very close to this is what we have now.
However, one of the goals has 1100 instance actors (55 on 20 scenes) that can make a certain game goal table cell +1. My sign then needs to listen for a change of that table cell in order to change "game.CurrentAction" to equal to 1. Then if a different goal is met the sign will change to that "game.CurrentAction" equals 2 and then back if 1 is true again.
Does that make sense?
@GreenHavenGames , no I don't quite understand.
The 55 actors per scene, are these like plots of land like in a farmville game?
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Is this something that could be done with the Replicate behavior? Think of an apple symbol or a colored square (for a status bar) that gets duplicated the number of times for that particular goal. So if the "A" below is an apple image and you are on part 4 of 20 for that goal (sorry if I'm confusing your terms/setup), the player would see:
AAAA
And the code for the apple symbol actor would just be Replicate [copies: tableCellValue(tableName,row,col)] [direction: 0] [size: self.Size.Width]
...where the tableCellValue would be equal to 4. If you don't want a particular goal to display then you could either hide it when the tableCellValue equals 20 or you could change the tableCellValue to 21 (21 of out 20 would signify completed and hidden) and hide it when the value is 21.
Just some ideas... hope that's helpful.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User