Is there a way to do communication between scenes? I mean,
I have my interface as an overlay in an another scene. Now, there’s this “truck” button, which should make tha player’s factory produce a new unit. Now it seems that I can’t make the button communicate with the factory. I’ve already tried linking, but the button just stays in a position in the air.
Using Global functions with Python, needless to say this requires coding, however it is the best way. Social’s Beginning BGE Python tutorial would be a good place to start.
His host seems to be a little slow today, I’d advise you to take a look at it when it comes back online, in the meantime…
import GameLogic as g # This imports all values you create in the GameLogic module
c = g.getController() # The controller needed in many functions
o = c.getOwner() # Getting values added to items using the BGE UI
g.value = o.value # Turning the "Value" (The bit you rename to whatever you like) into a Global value, this means whatever the local value you set with the BGE value system will become the global code)
import GameLogic as g
c = g.getCurrentController()
o = c.getOwner()
print g.value # Here, after importing the GameLogic, we print the value of "Value" in the Blender console, proving that it has indeed swapped scenes. This second code you should use on your second scene.