Game Attributes and Scene Changes - can't see the global attribute change?

JackieMacJackieMac Member Posts: 14
edited November -1 in Working with GS (Mac)
Hello,

Here's the setup:
- I have 2 scenes
- I have a boolean game attribute called "Battle On"

In scene 1, a collision executes a rule that does:
- Change Attribute game.Battle On to 1
- Change Scene to the second scene, "Battle Scene"

In the Battle Scene, I have an actor that watches the "Battle On" game attribute. If it is on, it initializes stuff for the scene.

This actor doesn't see that the Battle On Boolean is true.

I don't have (or don't think I have) a way to monitor attributes. So, I guess I'm not entirely sure Battle On is still true after the scene change.

I guess I have a few questions related to this. :-)

1) Are game attributes global across scenes?
2) Do actors immediately check for attributes changes after a scene changes?
3) Is there a way I can check the value of attributes in the Lua Console?

Thanks!

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Game Attributes are global across scenes.
    I think that it is looking for the event that an attribute changes so on the new scene the event has not occured.
    you can have a display text behavior to show the boolean attribute.
  • JackieMacJackieMac Member Posts: 14
    The Cave Adventure template makes it work somehow. Its doing a fade in transition as it enters the scene, then checks a global variable set by the previous scene.

    I used the Fade In rule in the game I'm working on and it appears to work! My Rule sees the global variable changed by the previous scene. I still don't know why exactly. Perhaps the fade in delays things long enough for my other rules to see the change in the global variable.

    Anyway, just wanted to let you know. :-)
  • BoinkologyBoinkology Member Posts: 7
    Did you set the attribute to "true" or "1"? I think I had a similar problem, but it was because I set the bool using ChangeAttribute to "1" instead of "true" When I get home, I will check my project to see if that was the case.
  • JackieMacJackieMac Member Posts: 14
    Its set to one, which should be the same as true for a boolean attribute, right?

    Boinkology, I'm curious to hear how you do it in your project. Thanks!
Sign In or Register to comment.