can a rule applied to an actor in one scene spawn an actor in another scene?
Leanne
Member Posts: 168
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.
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
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
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
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?
Getting very frustrated!!!
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
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.
you are all geniuses.
thank you.