HUD problems (scene actuator)

Hi all,

I am trying to transfer my speedbar / speed readout to a HUD using the scene actuator. Now, I cannot get the HUD readouts to sync with the properties they are linked to.

I am guessing that a message needs to be sent from the main scene to the HUD, but how? There are Python scipts that output speed as a float value (that smoothly drives an f-curve for the speed bar) and another that outputs an integer speed plus a kph string at the end (that should output to the text object)- but will logic bricks do it, and how would I connect them in relation to the Python scripts?

Cheers for your thoughts

Paul

Attachments

HUDVIEW.blend (541 KB)

HUDVIEW.blend (459 KB)
I deleted some logic bricks, and i renamed the speed property on the HUD bar to Text so that i could use the same script.
I used two scripts, one that gets the speed and makes it a global property, one that gets the global property and sets it to the speed property

Thanks for that, this global dictionary seems very handy!

How would you keep the kph string at the end of the speed value though? At the minute it just reads the speed.

You could add + ’ KPH’ at the end of the text changing line (where it sets the object’s ‘Text’ property to be the global speed). It probably should look like this:


obj['Text'] = str(logic.speed) + " KPH"

I haven’t looked at the blend file, though, so don’t pay attention to me if I’m wrong.

The problem I have is that I am trying to define a property that is made from an integer and a string. I can get either to work but not both using a defined globalDict, even though I can see the target property in the debug view.

I have tried to make a new script that defines a globalDict for the text value that handles the xxxkph value but I get either -1, 0, 0.0 or nothing! I thought it was just a case of duplicating the xxxkph value.

Attachments

HUDVIEW2.blend (394 KB)

HUDVIEW.blend (398 KB)
try this,

Cheers, agoose77! I did suspect the solution was defining the string and integers separately (as in one of the scripts). One day I will get Python!

Indeed, keep trying!

I’m having the same issue only mine is more difficult to do :confused: I have a solar system with all the planets and buttons and when I click a button I want the camera to move to that planet. I included the blend file. I also have a HUD and the main scene, but I think I need to reverse the process. Can someone help? :slight_smile: