Jump to content
AVIC411.com

A little help? Trying to do some coding(or statements).


Recommended Posts

Hello, I'm trying to find a better way of hiding the destination miles left/eta/mph box in the lower left hand corner when there isn't a route present. For most of you the current solution seems to be keeping the original box off screen and then setting up your own in the corner with pre inputted variables. It's a clever solution, but I'd like to be able to keep the ability to change those variables from the navigation menu. I currently have this working, however it isn't perfected. I have added the following code to the navigatemap_800_480.ui file.

 

 

 

 

 

 

This by itself caused the graphics to disappear but not the data, I was still seeing 0's even though there wasn't a trip planned. Then I found a post by Stephanie in the blue boxes thread about scripts in the common folder overwriting data in the 800_480 folder so I took a look and found this in navigatemap.ui

 


 

It seemed to be the code for removing the numbers during fullscreencockpit mode, so I tried changing it to this.

 


 

And it worked as I expected, only problem is I disabled it from turning off during the fullscreencockpit mode, does anyone know how to implement an or statement such as.

 

 


Link to post
Share on other sites
So after posting my reply I actual read your post and realized that's not going to do what you want. You definitely need an or operator to accomplish that.

 

Perhaps our friendly neighborhood coder Boris will be able to chime in with the correct syntax? :)

Thanks for trying, I actually tried that once as well. Loaded it up found out it didn't work and then realized that the second else run was turning the numbers back on.

Link to post
Share on other sites
& - And

| - Or

! - Not.

 

So you could either bypass a script and od a visiblemodel = '!vValidRoute&!vFullScreenCockpit' or do something similar in the script.

Thanks for the update, I'm pretty sure I understand what you're saying and I'll give it a go. However if | is or any idea why this didn't work though. I tried it and it hung on startup, same with || as skicrave suggested.

 


Link to post
Share on other sites


 

Because this does not make a correct expression for the FFUI script language. Try

runif !vvalidroute&vFullScreenCockpit

I'll try it when I get home, but considering I want it to do it when either is true, not necessarily both should I try runif !vvalidrout|vFullScreenCockpit?

Link to post
Share on other sites
I'll try it when I get home, but considering I want it to do it when either is true, not necessarily both should I try runif !vvalidrout|vFullScreenCockpit?

 

!vValidRoute|vFullScreenCockpit = (not ValidRoute) OR (FullScreen Cockpit) so this will be true if eithr you have no valid route or full screen cockpit is turned on. Or both. Yes, this is probably what you want.

Link to post
Share on other sites
No luck yet. I tried


and it hung up on startup, same as before.

 

Aha... searching through more skin code,it looks like you only do expressions in models,but not in runif conditions. So something like this might work instead (makes for a bit cleaner code)

vTmp.boolmodel "!vValidRoute|vFullScreenCockpit" ;; Track route and cockpit values
vtmp.dropmodel ;; But we don't need to keep tracking them, so drop model after we got the current value
runif vtmp 0 sc_HideMyScreenElementsOrSomething

Link to post
Share on other sites
Aha... searching through more skin code,it looks like you only do expressions in models,but not in runif conditions. So something like this might work instead (makes for a bit cleaner code)

vTmp.boolmodel "!vValidRoute|vFullScreenCockpit" ;; Track route and cockpit values
vtmp.dropmodel ;; But we don't need to keep tracking them, so drop model after we got the current value
runif vtmp 0 sc_HideMyScreenElementsOrSomething

Interesting, I may have to try and implement that, although I'm pretty happy with functionality at the moment. After testing today I found one small hiccup that I need to fix, the 0's come back after a route ends on it's own. For example I had a route up to get to work, when I arrived at my destination the images turned off but the 0's stayed on the screen until i hit the menu, then the map button. I just need to find a way to rerun the script if you reach a destination.

Link to post
Share on other sites

Just thought I'd give people an update, I've got this mod working 100% now. I've done quite a bit of testing and can't find any situations where it doesn't work as designed. I thought I'd give a rundown of all the changes if anyone wants to implement it into there data.zip. First I edited navigatemap_800_480.ui















 

As you can see I added the navigation.distance_to_manuver.valid variable to the visiblemodel, for the above text and sprites. Next I edited navigatemap.ui I created a new script called sc_frhideri.


It's pretty straight forward, I also tacked on the GPS y value to move the icon up or down depending on whether the route info box is present. Depending on where your GPS icon is you may or may not want to use that last bit of code. Next I had to call the script. I did this in a couple of places, twice in navigatemap.ui


As you can see I once again added my gps y values to sc_FullScreen. I also called for the script sc_frhideri once more in advmenu.ai


With these modifications to your data.zip file the route info box will disappear from the screen unless a route is present, and you still maintain the ability to change what can be seen in the box via the navigation settings menu.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...