Scriptable pause?
Moderators: winston, another_commander
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.
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.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
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?
So for the record, I'm saying this sounds like an excellent idea.. anyone else want to chip in?
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: Scriptable pause?
Well actually, I believe that crawlers from Google etc. artificially increase that count.Diziet Sma wrote: ↑Mon Oct 23, 2017 6:29 amI just came across this.. it seems to have faded with no attention paid, despite a considerable number of views.
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).So for the record, I'm saying this sounds like an excellent idea.. anyone else want to chip in?
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Scriptable pause?
I keep forgetting that on this board, search engine spiders are "registered members".. on most boards they don't increase the view count.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
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.
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.
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.
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.
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.
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.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Scriptable pause?
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.Astrobe wrote:Buy the "Autopause" equipment
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.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Scriptable pause?
We could always rename it to "Ferris Bueller Equipment", or "Deadpool Device"..
(or maybe just "Save Ferris!")
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: Scriptable pause?
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.phkb wrote: ↑Sun Nov 05, 2017 12:16 amKind 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.Astrobe wrote:Buy the "Autopause" equipment
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.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.
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).
Last edited by Astrobe on Sun Nov 19, 2017 2:35 pm, edited 1 time in total.
Re: Scriptable pause?
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
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.
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.
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'.
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'.
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?
Also, who should I talk to in order to have a 1.87 version tag for the manager?