Why "numeric expression" will let all boolean be true?
Hello everyone!
I have a question about "numeric expression".
I make a "Table"(3 booleans ), three "lockers" at "Scene_A" and one "Clear Button" at "Scene_B"
I don't know why all booleans will become true when I touch the "Clear Button".
Under only one button circumstances, I just want to let "Locker_2" will be "true" and "Locker_3" keeps "false".
Could anyone tell me why this happened?
Thank you.
↓↓↓My function↓↓↓↓
Table
Boolean:1/0/0
《Scene_A》
Locker_1
If "tableCellValue(game.table, 1, 1)" = 1
Touch is pressed
Do
Change scene to "B"
Locker_2
If "tableCellValue(game.table, 2, 1)" = 1
Touch is pressed
Do
Change scene to "B"
Locker_3
If "tableCellValue(game.table, 3, 1)" = 1
Touch is pressed
Do
Change scene to "B"
《Scene_B》
Clear Button
(Function.1)
If "tableCellValue(game.table, 1, 1)" = 1
Touch is pressed
Do
Change Table Value:
Table:game.Table
Row:2
Column:1
Value:1
Change scene to "A"
(Function.2)
If "tableCellValue(game.table, 2, 1)" = 1
Touch is pressed
Do
Change Table Value:
Table:game.Table
Row:3
Column:1
Value:1
Change scene to "A"
Comments
Is Locker 1 true ?
Yes . . . . so now change Locker 2 to true.
Now Locker 1 and Locker 2 are true.
Is Locker 2 true ?
Yes . . . . so now change Locker 3 to true.
Now Locker 1 and Locker 2 and Locker 3 are true.
I think what you might be wanting to do is:
《Scene_B》
Clear Button
(Function.1)
If Touch is pressed
If "tableCellValue(game.table, 1, 1)" = 1
Do
Change Table Value:
Table:game.Table
Row:2
Column:1
Value:1
Change scene to "A"
Otherwise
(Function.2)
If "tableCellValue(game.table, 2, 1)" = 1
Do
Change Table Value:
Table:game.Table
Row:3
Column:1
Value:1
Change scene to "A"
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
This is why I perfer a step integer, instead of Booleans.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Yup! Either integers or indexes are great for this!
Thank you for all your assistance.
The question has been decided.
Tank you.