TableCellValue as Rule condition & having change attribute problem
Hi Guys,
(1) Is it possible to use a TableCellValue as the attribute to be checked with using Rules?
Right now I'm making do with a custom attribute inside an actor that keeps note of the cell value, then this is what I enter inside the Rule's condition. But I find that it'd be easier if I can check for the cell value itself as my game's elements are heavily dependent on the values within my table(s).
(2) Also, when I have an actor with just a Change Attribute behavior, does it always check the attribute? As in at all times, like a listener in programming? I ask because:
- I have an actor's attribute that changes value based on a certain table cell's value.
- Then I have an actor that checks the previous actor's attribute, which determines what it would do (in this case, a change in Display Text).
However the 2nd actor doesn't change immediately. In viewer, after changing the first actor's value, the second actor's Display Text remains the same. Then I refresh viewer and voila, the second actor's Display Text finally changes to the correct one. But it still required a refresh of the viewer![:| :|](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/neutral.png)
Thanks! Any help would be greatly appreciated!
If anyone requests for it, I can write a more in-depth pseudocode of my actors' scenario.
(1) Is it possible to use a TableCellValue as the attribute to be checked with using Rules?
Right now I'm making do with a custom attribute inside an actor that keeps note of the cell value, then this is what I enter inside the Rule's condition. But I find that it'd be easier if I can check for the cell value itself as my game's elements are heavily dependent on the values within my table(s).
(2) Also, when I have an actor with just a Change Attribute behavior, does it always check the attribute? As in at all times, like a listener in programming? I ask because:
- I have an actor's attribute that changes value based on a certain table cell's value.
- Then I have an actor that checks the previous actor's attribute, which determines what it would do (in this case, a change in Display Text).
However the 2nd actor doesn't change immediately. In viewer, after changing the first actor's value, the second actor's Display Text remains the same. Then I refresh viewer and voila, the second actor's Display Text finally changes to the correct one. But it still required a refresh of the viewer
![:| :|](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/neutral.png)
Thanks! Any help would be greatly appreciated!
If anyone requests for it, I can write a more in-depth pseudocode of my actors' scenario.
Comments
The best way around it is like you mentioned, create a new attribute and constrain it to the value of that cell, then you can compare the 2.
To answer part b) change attribute will not always change, you should probably use a constrain attribute instead, depending on the rule you could also use change attribute but the rule that governs it needs to reference something else that changes.
I found a good way to do it (for integers) is if game.x > 0 then change attribute game.y
then it should check each time the number changes.
Thanks for the tut link @JGary321 , although I think the solution there's a bit advanced for my needs
Thanks guys!