Oolite Bulletins

For information and discussion about Oolite.
It is currently Fri Dec 15, 2017 7:49 pm

All times are UTC




Post new topic  Reply to topic  [ 17 posts ]  Go to page 1 2 Next
Author Message
 Post subject: Scriptable pause?
PostPosted: Sun Jul 16, 2017 7:37 am 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Mon Oct 23, 2017 6:29 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6246
Location: Aboard the Pitviper S.E. "Blackwidow"
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?

_________________
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


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Thu Oct 26, 2017 5:05 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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).


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Fri Oct 27, 2017 1:22 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6246
Location: Aboard the Pitviper S.E. "Blackwidow"
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.

_________________
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


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Oct 29, 2017 6:56 pm 
Offline
Commodore
Commodore
User avatar

Joined: Sun Jan 08, 2006 7:32 pm
Posts: 148
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Oct 29, 2017 7:56 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Fri Nov 03, 2017 2:31 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sat Nov 04, 2017 10:07 pm 
Offline
Commodore
Commodore
User avatar

Joined: Sun Jan 08, 2006 7:32 pm
Posts: 148
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 05, 2017 12:16 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 1840
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
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.

_________________
My OXP's


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 05, 2017 4:48 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6246
Location: Aboard the Pitviper S.E. "Blackwidow"
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!")

_________________
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


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 05, 2017 9:35 am 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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).


Last edited by Astrobe on Sun Nov 19, 2017 2:35 pm, edited 1 time in total.

Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 05, 2017 9:45 am 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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:


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 05, 2017 6:18 pm 
Offline
Commodore
Commodore
User avatar

Joined: Sun Jan 08, 2006 7:32 pm
Posts: 148
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.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Nov 19, 2017 2:34 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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'.


Top
   
 Post subject: Re: Scriptable pause?
PostPosted: Sun Dec 03, 2017 12:48 pm 
Offline
---- E L I T E ----
---- E L I T E ----

Joined: Sun Jul 21, 2013 12:26 pm
Posts: 563
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?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 17 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: fraterchaos and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Limited