Jump to content
The simFlight Network Forums

wish for new function: pause after XX minutes


Recommended Posts

Hello Mr Dowson,

modern Airliners like the MD-11 have a implemented function which pauses the sim short before T/D, because if you do a long haul flight, you can start and the got to bed and sleep well. At the next day you can unpause the sim and make the approach.

Problem with other addons like the B377 is, that they don't have such a function... also they don't have a FMC which calculates the T/D.

My idea is, that you could implement a little function in FSUIPC where you can enter that the sim should pause in XX minutes.

So you can start the flight with the old airliner and estimate that in e.g. about 4 hours the descent have to beginn.

Insert 240 minutes for the pause function and go looking TV...

Is that possible?

What do you think about that?

greetings, guenter

Link to comment
Share on other sites

My idea is, that you could implement a little function in FSUIPC where you can enter that the sim should pause in XX minutes.

So you can start the flight with the old airliner and estimate that in e.g. about 4 hours the descent have to beginn.

Insert 240 minutes for the pause function and go looking TV...

You could do that quite easily with a little Lua plug-in. In fact it was exactly for implementing such little things that I added the Lua interpreter in the first place.

The easiest way to do it would be to simply have a Lua program like this:

time = 0
while time < 240*60 do
   ipc.sleep(1000)  -- do nothing for a second
   time = time + 1  -- count the second
end
ipc.writeUW(0x0262, 1) -- set Pause

Save that in the FS modules folder as, say "Wait240.lua", and then you can assign a key or button to "Lua Wait240". When used it will do nothing for 240 minutes then set the Pause.

Of course you can make it much cleverer than that if you like. You could read the FS time offset and have it pausing after an elapsed time in FS rather than in real time. And you could either supply the period, in minutes, as the Parameter to the Lua plug-in, or even use the "ipc.ask" function to ask the user for the time value.

Going further, of course, you could read the user aircraft's position and when the distance from a defined point is reached, set the pause then. The permutations are almost endless, and all with a few relatively easy lines in a text file.

Regards

Pete

Link to comment
Share on other sites

Hello Pete,

thanks for the ideas...

In my low level Lua knomledge I think the first method would be the easiest.

Thank you very much for that.

And maybe one day you have the passion to implement sth like that as a function in FSUIPC :lol:

günter

Link to comment
Share on other sites

And maybe one day you have the passion to implement sth like that as a function in FSUIPC :lol:

Actually, for most little utility needs like that, I'm more and more inclined to implement them, even provide them, as Lua plug-ins. They are more flexible, easier to amend and understand, more adaptable to individual needs, and actually, for most purposes, more efficient in FS, as they occupy no main thread time -- all Lua plug-ins run in their own threads and in fact, unless very badly written, inflict no measurable penalties on FS, especially in multi-core systems.

Although very few folks are familiar with Lua, and certainly no programmers would seriously use it for main production programs, it is eminently suitable for little plug-ins and is well documented on the Lua sites. I think it is used in many games and simulator programs for exactly the purposes I am proposing for FS/FSUIPC, and also even for main configuration files (CFGs and INIs). In fact if I were starting over with FSUIPC I'd have the main INI file a Lua-based series of declarations, where actual programming bits could also be included (eg for buttons and so on).

As a programming language, whilst it does have some very sophisticated functions, it is also, for small applications, easy and logical to understand. More so than modern Basic in my opinion, and not that far removed for simple logical English.

Regards

Pete

Link to comment
Share on other sites

  • 1 year later...

You could do that quite easily with a little Lua plug-in. In fact it was exactly for implementing such little things that I added the Lua interpreter in the first place.

The easiest way to do it would be to simply have a Lua program like this:

time = 0
while time < 240*60 do
   ipc.sleep(1000)  -- do nothing for a second
   time = time + 1  -- count the second
end
ipc.writeUW(0x0262, 1) -- set Pause

Save that in the FS modules folder as, say "Wait240.lua", and then you can assign a key or button to "Lua Wait240". When used it will do nothing for 240 minutes then set the Pause.

Of course you can make it much cleverer than that if you like. You could read the FS time offset and have it pausing after an elapsed time in FS rather than in real time. And you could either supply the period, in minutes, as the Parameter to the Lua plug-in, or even use the "ipc.ask" function to ask the user for the time value.

Going further, of course, you could read the user aircraft's position and when the distance from a defined point is reached, set the pause then. The permutations are almost endless, and all with a few relatively easy lines in a text file.

Regards

Pete

The xxx miles from destination option would get my vote. I tried looking at that iwillbeback source code but it was pretty much chinese to me.

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

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.