Dynamically change scanner color?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Dynamically change scanner color?

Post 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
Sword, thy name is Cobra. And Cobra has fangs!
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Don't forget blue (for those lucky people that have a certain special device on board!)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Post 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.
Sword, thy name is Cobra. And Cobra has fangs!
User avatar
Corny
---- E L I T E ----
---- E L I T E ----
Posts: 363
Joined: Sun Dec 20, 2009 11:50 am
Location: (northern) Germany

Post by Corny »

JeffBTX wrote:
Blue? Special device?
:?
(status "blue"?)
Cloaking device?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

yep!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JeffBTX
---- E L I T E ----
---- E L I T E ----
Posts: 366
Joined: Sun Dec 27, 2009 2:23 pm
Location: Abilene Texas

Post 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.
Sword, thy name is Cobra. And Cobra has fangs!
Post Reply