can a rule applied to an actor in one scene spawn an actor in another scene?

LeanneLeanne Member Posts: 168
edited November -1 in Working with GS (Mac)
can a rule applied to an actor in one scene spawn an actor in another scene?

example:
if butterfly is found within the first 2 sec (time rule), 5 stars should appear on the next (victory) scene.

I tried a myriad of the things with no success.

any suggestions would be much appreciated.

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Yes.

    You need to create a game attribute (game.starcount integer)

    In the first scene have a change attribute rule. Change game.starcount to 5

    Then in the next scene have a display text and put the game.starcount in to check. It should display 5
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Leanne, you need a game boolean attribute, called something like ButterWin, left unchecked, i.e false. When the user finds the butterfly within the 2 seconds, Change attribute Butterwin to true.

    In your next scene, you can do one of several things, whichever you think will suit you best, all with the same result:

    a) put an actor outside of your screen area, and in it's Rules put:

    When Butterwin is true
    Spawn Actor 5stars (or whatever you've called it), setting the x and y positions, or

    b) put your 5 stars image off-screen, and in its Rules:

    When Butterwin is true
    Change attribute self.Position.x to....where you want the image x coord. on screen
    Change attribute self.Position.y to....where you want the image y coord. on screen

    c) A third way is to place your stars image in place on the screen, but make its Alpha to 0. Then in its Rules put:
    When Butterwin is true
    Change attribute self.Color.alpha to 1.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • LeanneLeanne Member Posts: 168
  • LeanneLeanne Member Posts: 168
    Thank you.
    I added the boolean attribute, unchecked. In the Butterfly actor, where I have all of my rules of position and time, I added Change attribute and typed in true.
    In the next scene, I have unfilled stars that appear as part of the scene. On the first star (actor) I entered a rule that if the boolean attribute is true, then change image to "filled star."

    nothing happened.

    I'm not sure how this is that different from your instructions (just trying to work with the empty stars).

    when you add a boolean attribute and then you select change attribute inside a rule, should you see a true/false drop down menu, because I had to type it in? is this where i'm going wrong somehow?
  • joshmiller602joshmiller602 Member Posts: 206
    @Leanne Yes you have to type it in on the Change Attribute rule. Make sure the bootlean you are using is a Game Attribute, not a Scene Attribute, as other scenes cannot read those. But what you typed should work. I would try moving the rule to the top of the actor's set of rules (if applicable), or try spawning the stars instead of just doing a change image (Spawn Actor).
  • LeanneLeanne Member Posts: 168
    Thank you for your suggestions. I ensured that it is a game attribute, not a scene attribute. I moved the behavior to the top of the rule and the rule to the top of the list in that actor. I also switched th change imGe to a spAwn actor instead. Unfortunately, I still can't get it to show any stars. I know my rules are fine because the score is changing as it should and displAying in the next scene without a problem. Anyone other troubleshooting tips? I must be missing something.

    Getting very frustrated!!!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    You're using the Attribute Browser to put in your attribute to change? Sorry if this is obvious to you and you have; just a thought...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    you can use 1 for true and 0 for false with booleans. Try that and see what happens.

    I would start with a simple test. In scene one have your rule that causes the boolean to trigger and take out the change scene behavior. Put a display text behavior in a blank attribute and drop it in this first scene to see if the boolean is really being triggered. If it is, then put this blank actor with the display text behavior in the next scene and put your change scene behavior back in. Then test to see if the display text actor shows you "true." If this works then there is something wrong with the rules in the stars themselves.
  • LeanneLeanne Member Posts: 168
    it works, it works, it really works!!!!

    you are all geniuses.
    thank you.
Sign In or Register to comment.