Jump to content
The simFlight Network Forums

Incompatibility between 2 lua scripts - hidBravoButtons


roland_lfor
 Share

Recommended Posts

Hi,

I've open a Beta phase for my RAAS lua project on Avsim forum.

It appears that RAAS lua script execution is blocked if hidBravoButtons is active at the same time.

I have no clue of what I'm supposed to modify to grant compatibility with other lua scripts, any tips?

For your information, here is the Avsim thread:

https://www.avsim.com/forums/topic/615876-runway-awareness-and-advisory-system-raas-beta-test/?do=findComment&comment=4733509

Thanks

Link to comment
Share on other sites

  • roland_lfor changed the title to Incompatibility between 2 lua scripts - hidBravoButtons
43 minutes ago, roland_lfor said:

It appears that RAAS lua script execution is blocked if hidBravoButtons is active at the same time.

Maybe its using the same virtual flags? You can change the offset/flags used in one of the scripts so that they don't clash.
However, you don't need to use the hidBravoButtons lua script any more, nor the Alpha script. These scripts were needed to recognise the buttons with ids > 31. However, FSUIPC7 now recognises up to 128 buttons natively, and has done now for a long time (since v7.2.0 I think). I suggest you remove the hidBravo/Alpha scripts, and update your assignments to use the actual button numbers rather then the virtual buttons/flags that those scripts use.

John

Link to comment
Share on other sites

9 minutes ago, John Dowson said:

Maybe its using the same virtual flags? You can change the offset/flags used in one of the scripts so that they don't clash.

Sorry, I don't see what "virtual flag" means in lua scripts.

 

Quote

I suggest you remove the hidBravo/Alpha scripts, and update your assignments to use the actual button numbers rather then the virtual buttons/flags that those scripts use.

Ok, I'll copy your explanation to the Beta user who is using it, thanks.

Link to comment
Share on other sites

John,

A user has the same issue - RAAS script starts but seems frozen after - however he doesn't use hidBravoButtons or Alpha scripts.

Symptoms are:

- RAAS starts ("test Ok" annoucement is played correctly). This correspond to the initialization of my program

- No other annoucements are heard, making the user think the program does not work.

As after initialization, my program starts an infinite while true do / end loop, paused using ipc.sleep(Timer) call, I believe that ipc.sleep() never returns for some reason.

I don't have the issue myself so I can't put some debug trace to understand.

 

Any help or advice is welcome

Thanks

Link to comment
Share on other sites

Get the user to set logging for Lua Plugins and take a look at his log.

7 minutes ago, roland_lfor said:

I believe that ipc.sleep() never returns for some reason.

I don't see how this can occur, or what would be causing it if this was the reason. The logging should tell.

John

Link to comment
Share on other sites

John, 

I don't know if you will trust me, but the issue on my script is caused by the "Lua Plugins" log option itself.

My understanding is that your logging capacity is overflown during my RegionalRwy() search function, as it goes through the 90 000 lines of R4.csv.

Funny to see that the debugging tool is causing the issue!

Link to comment
Share on other sites

49 minutes ago, roland_lfor said:

I don't know if you will trust me, but the issue on my script is caused by the "Lua Plugins" log option itself.

But I thought it was working for you, but wasn't working for another user who didn't have Lua Plugins log option activated, so how can this be the issue?

50 minutes ago, roland_lfor said:

My understanding is that your logging capacity is overflown during my RegionalRwy() search function, as it goes through the 90 000 lines of R4.csv.

Maybe something is overflowing, I don't know. Maybe continual logging is having an affect - I have noticed this in MSFS with other logging on occasion. I can take a look at some point but not for the next few days (re-organising my office at the moment...).

52 minutes ago, roland_lfor said:

Funny to see that the debugging tool is causing the issue!

But how can it be if the user had an issue before he activated lua plugin logging? Or are you saying that he already had Lua Plugin logging activated, and it works for him when this is disabled? if thats the case, then there probably isn't an issue - just get him to disable the lua plugun logging!

 

Link to comment
Share on other sites

It seems that when Lua Plugin is enabled, but Log lua separately is Disabled then the overflow occurs (and lua script exits).

If both are enabled the issue is gone. (I have to verify myself)

Actually I'm not sure if that user had Lua Plugin ON since the beginning, but I guess yes.

Link to comment
Share on other sites

22 minutes ago, roland_lfor said:

It seems that when Lua Plugin is enabled, but Log lua separately is Disabled then the overflow occurs (and lua script exits).

If both are enabled the issue is gone. (I have to verify myself)

Ok. I will check this at some point, but it will be low priority.

23 minutes ago, roland_lfor said:

Actually I'm not sure if that user had Lua Plugin ON since the beginning, but I guess yes.

Maybe check, otherwise the user's issue is somewhere else....

Link to comment
Share on other sites

He has just disabled the Lua Plugin log option, and for the first time RAAS worked on his side , without any code change on my side.

I replicated on my computer that once Lua Plugins log is enabled, RAAS is exiting during runway parsing loop. (I never used this log option during devpt).

Nothing urgent 🙂

Link to comment
Share on other sites

Ok. I suspect that its too much logging not giving other threads time to react, or maybe a threading issue when multiple threads are logging and one (the lua thread) is hogging the log - I have noticed strange behavior on other occasions when logging is being thrashed. I'll take a look when I get time (as I've been meaning to try the RAAS  script anyway), but I'm not sure if I can do anything, except maybe throttle the logging.... I can also add a note to the documentation to the effect that if you are logging lua plugins and this logs fast and/or produces a large log, then you should also enable Log Lua Separately.

John

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
 Share

×
×
  • 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.