Page 1 of 1

Dynamically change scanner color?

Posted: Sun Jan 10, 2010 7:38 am
by JeffBTX
Strictly speaking, this probably belongs in "Scripters Cove", but there is a specific dialogue there right now and I don't want to interrupt.

I am working on an idea for a new HUD.

I've searched the wiki. "OXP how-tos", "PLIST how-tos", and so forth.

Ok then simple question... is there a way within hud.plist to dynamically change the scanner (radar) color, based on the current status / condition (green, yellow, red)? Docs at the wiki DO imply that plists can act on conditions. I'd rather not use JS if I can help it.

Here is a snippit from a hud.plist:

Code: Select all

		<dict><!-- scanner -->
			<key>alpha</key>
			<real>0.8</real>
			<key>selector</key>
			<string>drawScanner:</string>
			<key>x</key>
			<integer>1</integer>
			<key>y</key>
			<integer>-190</integer>
			<key>height</key>
			<real>62</real>
			<key>width</key>
			<real>182</real>
         		<key>rgb_color</key>
         		<array>
            		<real>0.5</real>
            		<real>1.0</real>
            		<real>0.5</real>
         		</array>
I want to be able to give the last part, the segment
<key>rgb_color</key>
the ability to change between green, yellow, and red based on the current status condition.

- Thanks

Posted: Sun Jan 10, 2010 11:03 am
by Kaks
Don't forget blue (for those lucky people that have a certain special device on board!)

Posted: Sun Jan 10, 2010 11:30 am
by JeffBTX
Blue? Special device?
:?
(status "blue"?)

Anyway... I sifted and sifted through the wiki. I DID find extensive sections on "conditions". Apparantly there is not ONE keyword that extracts the current threat level. There are conditions for the player's legal status, credits, location, etc., everthing under the 2048 suns, but not threat level (at least in the wiki). If it hasn't been done already, perhaps that should be a suggestion, but I am too tired right now to check the SVN changes.

Posted: Sun Jan 10, 2010 12:00 pm
by Corny
JeffBTX wrote:
Blue? Special device?
:?
(status "blue"?)
Cloaking device?

Posted: Sun Jan 10, 2010 12:09 pm
by Kaks
yep!

Posted: Sun Jan 10, 2010 12:23 pm
by JeffBTX
Ah! Didn't know that... I've been so busy "experimenting" that I haven't progressed as far into the game as I should be.

... Probably after I get this hud built.