Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello Pete,

I try to generate a little failure generator...

One lua is for the failures, an other is for resetting them

I have a LUA loop ("while") in the failure lua and have get out of this loop.

I found one solution to set a global variable in the loop and change it with the reset lua to get out of the loop.

But I think you will have a better solution.

One idea is, to send a "kill" to the failure lua.

I know about the kill possibility via the FSUIPC menu, but I'd like to have it inside the reset lua

Sth like "ipc.kill("failure.lua") or however this is called or possible....

Or you have an other idea how I can get out of this loop

(the loop controls fuel flow. as the fuel flow is resetting itself you have to permanently send "fuel flow XY". to reset I'd like to cancel this loop as the fuel flow is then restting itself)

Hope you understand!

thanks very much!!!!

guenter

Posted

I have a LUA loop ("while") in the failure lua and have get out of this loop.

I found one solution to set a global variable in the loop and change it with the reset lua to get out of the loop.

Yes, that is an efficient way for separate Lua threads to talk to each other.

But I think you will have a better solution.

One idea is, to send a "kill" to the failure lua.

Well, that's possible, of course, but it isn't really as tidy as having them talk to each other via Global variables.

I know about the kill possibility via the FSUIPC menu, but I'd like to have it inside the reset lua

Sth like "ipc.kill("failure.lua") or however this is called or possible....

It's done by the ipc.macro() function, so:

ipc.macro("LuaKill failure")

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.