OverlayScene Objects Property

Hi,
I have two scenes, scene1 and scene2. scene2 is an overlay scene. Now I want to get the property of an object of the scene2 from scene1. How do I do it. The object name is e.g. OBRock and it has a property call Mull(boolean). I want to toggle the bool Mull from an object of scene1. Click the object of the scene1 and change the property of the scene2 object.

Thanks in advance
Regards

the direct way is:

something like that, but it is very inflexible


import GameLogic

def change(cont):
  own = cont.owner
  scene = getSceneByName("scene1")
  if scene is None:
    return

  otherObj = scene["OBRock"]
  otherObj["whatever"] = not otherObj["whatever"]

def getSceneByName(sceneName):
  scenes = GameLogic.getSceneList()
  for scene in scenes:
    if scene.name == sceneName:
      return scene  

Another option:
send a message e.g. “changeXYZ”
have a sensor on Rock listening on “changeXYZ”. When receiving such a message toggle the property.

With that it does not matter:

  • who sent the message
  • how many recipients exist

I hope it helps

Thanks for the reply. I tried the message sensors but I could not make it work. Could you kindly explain it a little so that I could get some idea. I must create it using python.

Regards

Could you use globaldict (I think that’s what its called) to communicate properties? I have a similar problem in that I wanted a hud to read the velocity of the player from the main scene to the overlay.

sender:

whatever sensor -> whatever controller -> Message actuator with Subject: mySubject

listener:

message sensor (true pulse!) Subject: mySubject -> whatever controller -> whatever actuator

if you want to send via python: http://www.blender.org/documentation/249PythonDoc/GE/GameLogic-module.html#sendMessage

Thanks for the reply. I understand it and is working now.

Thanks
Regards