Oolite Bulletins
http://bb.aegidian.org/

Scriptable pause?
http://bb.aegidian.org/viewtopic.php?f=6&t=18900
Page 1 of 2

Author:  Astrobe [ Sun Jul 16, 2017 7:37 am ]
Post subject:  Scriptable pause?

I often play Oolite and a game called "IRL" at the same time. Sometimes IRL has time triggered events, like going to the bathroom or feeding the cat, that require you to put on your Oculus Real for a few minutes.
It's always dangerous to let Oolite run for a few minutes because you don't know what will appear at the edge of the scanner next minute, so you have no choice but pause the game.
The ability to pause the game with a script would be useful in these situations. One could do for instance a script that auto-pauses when the condition turns red, or when you are cleared to dock.

Author:  Diziet Sma [ Mon Oct 23, 2017 6:29 am ]
Post subject:  Re: Scriptable pause?

I just came across this.. it seems to have faded with no attention paid, despite a considerable number of views.


So for the record, I'm saying this sounds like an excellent idea.. anyone else want to chip in?

Author:  Astrobe [ Thu Oct 26, 2017 5:05 pm ]
Post subject:  Re: Scriptable pause?

Quote:
I just came across this.. it seems to have faded with no attention paid, despite a considerable number of views.
Well actually, I believe that crawlers from Google etc. artificially increase that count.
Quote:
So for the record, I'm saying this sounds like an excellent idea.. anyone else want to chip in?
The feature is still on my TODO list, together with try to do something about the CPU utilization when the game is paused (~20% here).

Author:  Diziet Sma [ Fri Oct 27, 2017 1:22 am ]
Post subject:  Re: Scriptable pause?

Quote:
Well actually, I believe that crawlers from Google etc. artificially increase that count.

I keep forgetting that on this board, search engine spiders are "registered members".. on most boards they don't increase the view count.

Author:  hoqllnq [ Sun Oct 29, 2017 6:56 pm ]
Post subject:  Re: Scriptable pause?

This is in todays nightly.

It is a new Global method

function pauseGame() : Boolean

It does not pause the game on screens that are can normally not be paused by keyboard: mission screens, long range chart, arrival report, save menu. In those cases, the function returns false. Otherwise it pauses the game and returns true.

There is no protection mechanism like timeout or override (should there be?), so it is up to the OXP dev to make sure you don't get in a pause-loop where the script pauses again immediately after the user un-pauses.

Author:  Astrobe [ Sun Oct 29, 2017 7:56 pm ]
Post subject:  Re: Scriptable pause?

Wow, thanks.

About the protection mechanism, in my humble opinion it's true that a bug in the script could be very annoying, but scripting bugs can ruin the game even with less "imperative" functions anyway.

Author:  Astrobe [ Fri Nov 03, 2017 2:31 pm ]
Post subject:  Re: Scriptable pause?

Here is a bare-bones script (old OXP format, unzip in AddOns folder).

Buy the "Autopause" equipment (only 1Cr - profits will be shared with Hoqllnq, promised), and if you prime that equipment, the game pauses automatically when condition goes red.

BUT: I've observed keyboard malfunctions after un-pausing. First time it apparently switched to mouse control mode (it might just have been my fat fingers though), the next times the "fire laser" key did not work until I switched views. Tested on PC.

Author:  hoqllnq [ Sat Nov 04, 2017 10:07 pm ]
Post subject:  Re: Scriptable pause?

Quote:
keyboard malfunctions
Have you observed any more of those with the patch I gave you
and have you used it enough to confidently say they are gone?
I have tested in different screens and not found issues.
Thanks.

Author:  phkb [ Sun Nov 05, 2017 12:16 am ]
Post subject:  Re: Scriptable pause?

Quote:
Buy the "Autopause" equipment
Kind of breaking the fourth wall here a bit, aren't we? Pausing the game is a meta-command (ie something that the in-game world doesn't understand). But by making it a purchasable item, it's now crossed the boundary between game-world and real-world. Which is a long-winded way of say, I don't think this should be a purchasable item. Although, to be fair, at 1cr it's hardly worth quibbling over, is it? Leave it as it is. :D

But I really like the concept though! I think this can be a really useful tool for players like me who generally run with the sound off, so don't get audible warnings when red alerts take place. Very handy for when I'm on my way to the sun to scoop some fuel, and I run into an angry mob of pirates courtesy of Space Crowds.

Author:  Diziet Sma [ Sun Nov 05, 2017 4:48 am ]
Post subject:  Re: Scriptable pause?

Quote:
Quote:
Buy the "Autopause" equipment
Kind of breaking the fourth wall here a bit, aren't we?

We could always rename it to "Ferris Bueller Equipment", or "Deadpool Device".. :lol: :lol: :lol: :lol:

(or maybe just "Save Ferris!")

Author:  Astrobe [ Sun Nov 05, 2017 9:35 am ]
Post subject:  Re: Scriptable pause?

Quote:
Quote:
Buy the "Autopause" equipment
Kind of breaking the fourth wall here a bit, aren't we? Pausing the game is a meta-command (ie something that the in-game world doesn't understand). But by making it a purchasable item, it's now crossed the boundary between game-world and real-world. Which is a long-winded way of say, I don't think this should be a purchasable item. Although, to be fair, at 1cr it's hardly worth quibbling over, is it? Leave it as it is. :D
Well that was just a quirk-and-dirty job. But equipment items are handy because of the mode switch feature, which would let us have different pause criteria.
Quote:
But I really like the concept though! I think this can be a really useful tool for players like me who generally run with the sound off, so don't get audible warnings when red alerts take place. Very handy for when I'm on my way to the sun to scoop some fuel, and I run into an angry mob of pirates courtesy of Space Crowds.
Someone on IRC called it the "ALT tab" thing (not him but hello, Spalthy876!) so yes, it has more than one uses. The idea of adding mini-games or occupations for when you are masslocked has been discussed several times here; I think this feature partially solves it by letting the player do something else outside of the game - one nice thing about Oolite is that is not too resource-hungry, so you can have other programs running in the background - thus letting us being "productive" while playing. Not the best solution but not a bad one either.

BTW, if someone wants to take over this OXZ, feel free. I have to many things on my todo list already (for instance, I'd like to return to the city lights feature).

Author:  Astrobe [ Sun Nov 05, 2017 9:45 am ]
Post subject:  Re: Scriptable pause?

Quote:
Quote:
keyboard malfunctions
Have you observed any more of those with the patch I gave you
and have you used it enough to confidently say they are gone?
I have tested in different screens and not found issues.
Thanks.
It triggered several times without issues since. If there's still a bug in there it's probably hiding in an edge case, so it shouldn't be critical. so I think the fix can be submitted to trunk. Let the guinea pigs^H^H beta testers to their job :lol:

Author:  hoqllnq [ Sun Nov 05, 2017 6:18 pm ]
Post subject:  Re: Scriptable pause?

I have two alternative fixes:

https://github.com/jobi-wan/oolite/comm ... 177071ea74

https://github.com/jobi-wan/oolite/comm ... c7e22b19d0

Both do essentially the same thing: They move the pause/resume code form pollFlightControls and pollDockedControls to a place where Global pauseGame can use it too.
The first one moves the pause/resume code to a new method in PlayerEntity(Controls) and adds a PlayerEntity method to call it from outside.
The second one moves pause/resume code to Universe pauseGame/resumeGame. I thought this was going to be cleaner but I ended up needing some new methods to restore the saved state. It may still be nicer to have all the pause/resume in Universe pauseGame/resumeGame.

Author:  Astrobe [ Sun Nov 19, 2017 2:34 pm ]
Post subject:  Re: Scriptable pause?

I've updated the auto-pause script/equipment.

Please note that it is now in OXZ format. I can't make it available from the manager yet because I can't require version 1.87 in the manifest.

This version lets you choose between pausing on yellow or red condition with equipment mode key switch 'b'.

Author:  Astrobe [ Sun Dec 03, 2017 12:48 pm ]
Post subject:  Re: Scriptable pause?

FWIW the version I've uploaded a few weeks ago was borken: switching modes didn't work.

Also, who should I talk to in order to have a 1.87 version tag for the manager?

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/