Jump to content
The simFlight Network Forums

Recommended Posts

Posted

FSX Deluxe Ver. 10.0.61637.0

FSUIPC Ver. 4.90

Hi Pete,

I use the ipc.display command extensively in my scripts.

I have looked back through the forums and seen that controlling the colour of the presented text cannot be controlled via any script commands.

I know we can change the colour of the text within the FSUIPC Miscellaneous TAB option “Non-Scrolling FS msgs to be white” and that this then makes all ipc.display messages white.

That is all OK.

However I have just found a little bug that may help you track down a way to switch from red to white programmatically.

I only recently updated FSUIPC to Ver. 4.90 and have only just noticed this little issue.

Prior to this I was on Ver. 4.86, I cannot tell you definitely whether 4.86 had the problem but I certainly did not notice it before.

Anyhow, try these two commands:

ipc.display("Test 123", 16383) (This one displays red)

ipc.display("Test 123", 16384) (This one displays white)

Also if the commands are used sequentially and alternatively you can then make the text flash the two alternate colours of red and white.

Like So:

ipc.display("Test 123", 16383)

ipc.sleep(1000)

ipc.display("Test 123", 16384)

ipc.sleep(1000)

ipc.display("Test 123", 16383)

ipc.sleep(1000)

ipc.display("Test 123", 16384)

ipc.sleep(1000)

And in case you are wanting to know why I would want to display a message for 16384 seconds.

I don’t, it was a mistake I had made in one of my scripts thinking the delay was in milliseconds and I noticed the behaviour, so I thought I would track down the exact cut off figure for you.

An interesting figure it is too !!

Cheers Glenn.

Posted

However I have just found a little bug that may help you track down a way to switch from red to white programmatically.

I only recently updated FSUIPC to Ver. 4.90 and have only just noticed this little issue.

Prior to this I was on Ver. 4.86, I cannot tell you definitely whether 4.86 had the problem but I certainly did not notice it before.

Anyhow, try these two commands:

ipc.display("Test 123", 16383) (This one displays red)

ipc.display("Test 123", 16384) (This one displays white)

This is because the routine used to make the display packs several parameters into one. One of those options is enabled by bit 14, which is 0x4000, or decimal 16384, and that is "white messages".

I suppose i could document this. You don't need a large number of seconds, just add 16384 to the number of seconds.

Regards

Pete

Posted

Thankyou for the reply Pete.

I think it is well worth documenting.

I have on a few occasions wanted to change the Text colour mid script to highlight a message.

So going by your reply if I wanted a Red message for 10 Seconds then it would look like this:

ipc.display("Test 123", 10)

If I wanted a White Message for 10 Seconds then I would do this:

ipc.display("Test 123", 16394) --(16384 + 10)

I am not sure if it is possible but it would be really nice to have a flag that could set the colour in the display function.

Something like:

ipc.display("Test 123",0, 10) --Gives us Red for 10 Seconds

ipc.display("Test 123",1, 10) --Gives us White for 10 Seconds

If that’s not possible then its fine the other way.

It certainly is beneficial to have with the display function I think.

I know I have seen the question asked before about colour changes, so I am not the only one.

Cheers Glenn.

Posted

I am not sure if it is possible but it would be really nice to have a flag that could set the colour in the display function.

Something like:

ipc.display("Test 123",0, 10) --Gives us Red for 10 Seconds

ipc.display("Test 123",1, 10) --Gives us White for 10 Seconds

Of course it is possible. I'll put it on my list.

Regards

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.