Carry over to other scenes?

(Makin Bacon) #1

Alright, how would i go about like…sending messages to other scenes, etc.

like (im making a game similar to mario party) the main board is one scene, then a minigame is another scene, so lets say player 3 wins the mini game and wins 10 coins. how would i tell the board scene that this has happened so i can update his score n shit

0 Likes

(Mmph!) #2

you need to use a global variable, This is a Programmer only feature, I will never understand why we cant just have a little G tickbox or something.

If the 2 scenes are open at the same time you can press control L to link objects to more than 1 scene.

0 Likes

(C-106 Delta) #3

Or you could have your board scene as a background scene and have all the mini games overlay the background scene.

0 Likes

(Makin Bacon) #4

uhhhhh where can i learn that…?

0 Likes

(OTO) #5

Hello
Use the message sensor and actuator
One ex:
Scene1
Collision Sensor -> AND -> Message Actuator - Subject:fu
Scene2
Message Sensor Subject:fu -> AND -> Property Actuator - Assign -property prop Value:1
It should work…I hope :slight_smile:
Bye

0 Likes

(Makin Bacon) #6

trust me, thats the first thing i tried, but it doesnt carry over to differnt scenes.

0 Likes

(OTO) #7

Trust me, try this little example:
http://otothecleaner.free.fr/downloads/pass_data_between_scenes.blend

Press P, each time the red cube touch the blue cube in scene 1, the
counter , in scene 2, will raise one unit.
Or maybe I’m missing something?!
Bye

0 Likes

(PlantPerson) #8

I think what he’s asking is if a property in scene one has a specific value (say 30) how can he copy that value to a property in scene two, so that it will also equal 30, even if it equaled something other than 29 before. This question is about copying specific values, not just simple scene/scene communication.

0 Likes

(OTO) #9

Ah…
maybe with the Property Actuator’s “copy” function?!

0 Likes

(PlantPerson) #10

I don’t think that works across scenes.

0 Likes

(Makin Bacon) #11

thats odd…it didnt work when i tried it. i must have effed up…does it only work with a scene overlay? like if i had the scene of JUST the box hitting the other box and let it hit 4 times, if i switched to the counter scene, would it say 4?

0 Likes

(OTO) #12

Ah, I guess that you want, let’s say, that your character keeps his score or health
when changing levels/scenes?
Here’s an old blengine’s demo that do that:
http://otothecleaner.free.fr/downloads/healthScenes.blend

0 Likes