Jump to content

LUA Programming board activated by manual switch not full working.


iasongr

Recommended Posts

Question:

When i activate Programming board by manual switch not full working.

Landing gears works correct. but system.print("text") and  system.showScreen(1) not working.

When i activate the programming board by hand (press F on PB) everything works.

Any idea why, and how to fix it ?

Link to comment
Share on other sites

I was having a similar issue, and I have just resolved it. Maybe this will help you too.

 

When I would apply my code to the PB, I would leave it in a deactivated state. When I activated the PB, the code for its start() would run. Then it would deactivate.

 

So when I went to test my button pressed() event, it would never trigger. And so my system.print() calls that were referenced in the pressed() event of my button could never execute.

Turns out that the PB must be in an active state for the rest of the code to run. So in my case, I had a bit of a misunderstanding in how the code lifecycle of a PB would execute.

So put your PB in active state, and then activate your switch, and then the code you're expecting should run.

Link to comment
Share on other sites

See the codex. Several methods which may affect other players unknowingly are restricted to explicitly starting the PB for security reasons. Imagine someone walking by and PB gets triggered with a detector zone.

Link to comment
Share on other sites

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