send interger value from main scene to the hud overlay help!


I dont want to wear out my welcome, this is my second thread in two days, but the last issue was fixed with some quick advice, so I am going to go for 2 for 2

I purchased a py script on the paid work section. (the guy was very helpful and i didnt want to nag him any further about my new problem) Script measures altitude. But I cant figure out how to make that value appear on my hud overlay.

in main scene…

I have a small invisible cube parented to my model. always - python controller -script (works great-gets the altitude from sea level…guy over delivered)

I have some blender text hidden underground below visible it is always copy the result of the altitude cube script.

I have a text plane on my hud overlay that copies the numbers but it refuses to. Some extensive net blender snooping leads me to believe the problem is that they are on different overlays. (text numbers and the text plane) I tried emptys and messages in several configurations to no avail…

I cant move the altitude cube and i cant put the text plane (with my chosen font) parented to the camera in main scene because it looks ghastly.

Im hoping there is a hand slap to the forehead no brainer answer for this - seems intuitive that the overlays shud be easily accessible to each other.

Any insights would be tremendous!

Where is the original value stored? Is it a object property or is it a globalDict() value or such?

  1. Storing original data in bge.logic.globalDict would allow the hud to read the data directly from there.
    No matter the scene.
  2. Otherwise sendMessage(‘update hud value’, ‘str(int_variable)’) could work.

read_variable.blend (506 KB)
Here’s a simple .blend I put up.


why didnt I ask here directly 7 months ago when i started :frowning:

much…much pain lol

I am buying you a beer Mperonen!