Extension to Mission Screen Handling
Moderators: winston, another_commander
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Extension to Mission Screen Handling
This is a simple suggestion to describe but looking at the source code slight more difficult to do.
The suggestion is to add two new options to .runScreen parameters. The first parameter would be called something like "anyKeyPress" (which would be boolean). The second would be "anyKeyPressInstructions" (which would be a string). If anyKeyPress is "true" then "choicesKey" and "initialChoicesKey" would be ignored and instead of "Press Space Commander" at the bottom of the mission screen the "anyKeyPressInstructions" string would appear. Now in the mission screen when a key pressed, this is passed as an object parameter (eg. {shift, ctrl, alt, keyCode} ) to the missionScreen callback function as a second parameter. The choice parameter of the callback would be a default "keyPress"
The aim is allow more interesting and useful mission screen behaviour.
I had a look at doing this myself but I don't yet understand the JS engine interface much.
The suggestion is to add two new options to .runScreen parameters. The first parameter would be called something like "anyKeyPress" (which would be boolean). The second would be "anyKeyPressInstructions" (which would be a string). If anyKeyPress is "true" then "choicesKey" and "initialChoicesKey" would be ignored and instead of "Press Space Commander" at the bottom of the mission screen the "anyKeyPressInstructions" string would appear. Now in the mission screen when a key pressed, this is passed as an object parameter (eg. {shift, ctrl, alt, keyCode} ) to the missionScreen callback function as a second parameter. The choice parameter of the callback would be a default "keyPress"
The aim is allow more interesting and useful mission screen behaviour.
I had a look at doing this myself but I don't yet understand the JS engine interface much.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Extension to Mission Screen Handling
What would that achieve that's not already doable (and is being done hundreds of times each day) by mission choices? Or even by a simple "Press Space"? The player presses either RETURN (in case of a setup with mission choice) or SPACE (in case of the default setup), and "anyKeyPressInstructions" are performed in the script.
There is one really needed improvement to mission screen handling, though: disable the use of F1 to launch in the middle of a mission screen, which regularly results in unsuspecting players getting stuck in the middle of a mission.
There is one really needed improvement to mission screen handling, though: disable the use of F1 to launch in the middle of a mission screen, which regularly results in unsuspecting players getting stuck in the middle of a mission.
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: Extension to Mission Screen Handling
That was very dismissive of you CML. There are plenty that this idea would allow you to do that you can't (or rather can't do easily) using the existing interface. You can not create free text entry for a start. Also you could have say a dynamic menu in the middle of the mission screen and use the arrow keys to scroll through the list on screen. (Remember the choices has to be in the missiontext.plist and are therefore not dynamic.) To do this now I have to have options to scroll up and down in the mission choices which means for one direction (say down) I have to use the arrow key to go to it and then press enter which is a two step process which gets tedious. (For an example of this see my GalCop Rewards' mission screen used for selecting a voucher when you win more than one.) Another idea is this could be use to control a 3D model. These ideas are just for starters but basically you would be able to do a lot more than can be done now. Yes for most uses the current way is perfectly fine but more sophisticated ideas it is not flexible enough.Commander McLane wrote:What would that achieve that's not already doable (and is being done hundreds of times each day) by mission choices? Or even by a simple "Press Space"? The player presses either RETURN (in case of a setup with mission choice) or SPACE (in case of the default setup), and "anyKeyPressInstructions" are performed in the script.
There is one really needed improvement to mission screen handling, though: disable the use of F1 to launch in the middle of a mission screen, which regularly results in unsuspecting players getting stuck in the middle of a mission.
I agree with your point regarding pressing F1 though.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
Re: Extension to Mission Screen Handling
One way to have dynamic texts in mission choices is to use missionVariables. So it's possible, although a bit inconvenient.
And after adding the initialChoicesKey (in trunk) the devteam has done another step. Muchas gracias
I fully agree that more possibilities for missionscreens are highly welcome, e.g. the step from UI to a GUI would make things even more convenient, specially for more complex scenarios
And after adding the initialChoicesKey (in trunk) the devteam has done another step. Muchas gracias
I fully agree that more possibilities for missionscreens are highly welcome, e.g. the step from UI to a GUI would make things even more convenient, specially for more complex scenarios
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Extension to Mission Screen Handling
Sorry, I didn't want to sound dismissive.
in the script and
in missiontext.plist should be perfectly valid. (EDIT: ninja'd by Svengali on this one.)
You can make them dynamic. All you have to do is to put the text in a mission variable, which is how it has been possible forever to display dynamic texts on mission screens. A combination ofPhantorGorth wrote:There are plenty that this idea would allow you to do that you can't (or rather can't do easily) using the existing interface. You can not create free text entry for a start. Also you could have say a dynamic menu in the middle of the mission screen and use the arrow keys to scroll through the list on screen. (Remember the choices has to be in the missiontext.plist and are therefore not dynamic.)
Code: Select all
missionVariables.my_first_choice = "Go up dynamically.";
missionVariables.my_first_choice = "Go down dynamically.";
missionVariables.my_first_choice = "Stay where you are dynamically.";
Code: Select all
"my-mission-choices" = {
"choice_1" = "[mission_my_first_choice]";
"choice_2" = "[mission_my_second_choice]";
"choice_3" = "[mission_my_third_choice]";
};
Options can also be selected directly by double-clicking, so there's no strict need for keypresses at all. (Or is this a Mac-only feature?)PhantorGorth wrote:To do this now I have to have options to scroll up and down in the mission choices which means for one direction (say down) I have to use the arrow key to go to it and then press enter which is a two step process which gets tedious. (For an example of this see my GalCop Rewards' mission screen used for selecting a voucher when you win more than one.)
I'm no expert on this, but wouldn't that require a re-write of how models are displayed on mission screens rather than a new check for keypresses? As far as I know the models are not meant to be controlled anyway. They just spin in front of you. Simple controls (like "increase spin" or "reduce spin") can be implemented as mission choices, but the main point is: does the engine currently allow to apply changes to the spinning models in the first place?PhantorGorth wrote:Another idea is this could be use to control a 3D model.
Re: Extension to Mission Screen Handling
Yes - the mission.displayModel property will get you a standard Ship reference to the model with modifiable position, orientation, etc. Probably helps to setCommander McLane wrote:I'm no expert on this, but wouldn't that require a re-write of how models are displayed on mission screens rather than a new check for keypresses? As far as I know the models are not meant to be controlled anyway. They just spin in front of you. Simple controls (like "increase spin" or "reduce spin") can be implemented as mission choices, but the main point is: does the engine currently allow to apply changes to the spinning models in the first place?
spinModel
to false first, of course.Re: Extension to Mission Screen Handling
It's there on all platforms.Commander McLane wrote:Options can also be selected directly by double-clicking, so there's no strict need for keypresses at all. (Or is this a Mac-only feature?)
Via spinModel:false and framecallback you can do a lot of things. The other option was used in Snoopers (up to 2.2.x) to use a helper entity and "safeScriptActionOnTarget: performTumble" to get a random change.Commander McLane wrote:I'm no expert on this, but wouldn't that require a re-write of how models are displayed on mission screens rather than a new check for keypresses? As far as I know the models are not meant to be controlled anyway. They just spin in front of you. Simple controls (like "increase spin" or "reduce spin") can be implemented as mission choices, but the main point is: does the engine currently allow to apply changes to the spinning models in the first place?
Ninja'd by cim .-)
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: Extension to Mission Screen Handling
Accepted. This might be a cultural difference here.Commander McLane wrote:Sorry, I didn't want to sound dismissive.
I agree this would work under some circumstances but not if the number of entries varies.Commander McLane wrote:You can make them dynamic. All you have to do is to put the text in a mission variable, which is how it has been possible forever to display dynamic texts on mission screens. A combination ofPhantorGorth wrote:There are plenty that this idea would allow you to do that you can't (or rather can't do easily) using the existing interface. You can not create free text entry for a start. Also you could have say a dynamic menu in the middle of the mission screen and use the arrow keys to scroll through the list on screen. (Remember the choices has to be in the missiontext.plist and are therefore not dynamic.)in the script andCode: Select all
missionVariables.my_first_choice = "Go up dynamically."; missionVariables.my_first_choice = "Go down dynamically."; missionVariables.my_first_choice = "Stay where you are dynamically.";
in missiontext.plist should be perfectly valid. (EDIT: ninja'd by Svengali on this one.)Code: Select all
"my-mission-choices" = { "choice_1" = "[mission_my_first_choice]"; "choice_2" = "[mission_my_second_choice]"; "choice_3" = "[mission_my_third_choice]"; };
I vaguely remember that now you've said it. It probably works under all OSs but I tend not to use the mouse when playing Oolite.Commander McLane wrote:Options can also be selected directly by double-clicking, so there's no strict need for keypresses at all. (Or is this a Mac-only feature?)PhantorGorth wrote:To do this now I have to have options to scroll up and down in the mission choices which means for one direction (say down) I have to use the arrow key to go to it and then press enter which is a two step process which gets tedious. (For an example of this see my GalCop Rewards' mission screen used for selecting a voucher when you win more than one.)
Edit. There is. Ninja'd by Svengali.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
Re: Extension to Mission Screen Handling
It's the sort of thing you'd want to write an abstraction layer for once and then go through that, but you could vary the number of entries by having one "generic" choice list set up for each list length, selecting the one you needed for this occasion, and populating the mission variables accordingly.PhantorGorth wrote:I agree this would work under some circumstances but not if the number of entries varies.
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: Extension to Mission Screen Handling
Oh agreed, but is not that convenient, and you have to be careful your set goes up to the maximum you can ever get from your OXP. (Mind too many choices and you start to have problems fitting it all in one screen.)cim wrote:It's the sort of thing you'd want to write an abstraction layer for once and then go through that, but you could vary the number of entries by having one "generic" choice list set up for each list length, selecting the one you needed for this occasion, and populating the mission variables accordingly.PhantorGorth wrote:I agree this would work under some circumstances but not if the number of entries varies.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
Re: Extension to Mission Screen Handling
It would help if there were more options for the mission offering screens though. Although for the most part they tend to serve their purpose it would be good if we could use different coloured text or change the size of text. Or the ability to insert more than one image into the screen. I know this can be achieved with Javascript but if there were more defined options in the code it would mean OXPs like Snoopers wouldn't have to require complex coding, and the script files could be radically reduced.
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- PhantorGorth
- ---- E L I T E ----
- Posts: 647
- Joined: Wed May 20, 2009 6:48 pm
- Location: Somewhere off the top left of Galaxy 1 map
Re: Extension to Mission Screen Handling
That's for another request I think. I am keeping it limited here to the key press idea.Pleb wrote:It would help if there were more options for the mission offering screens though. Although for the most part they tend to serve their purpose it would be good if we could use different coloured text or change the size of text. Or the ability to insert more than one image into the screen. I know this can be achieved with Javascript but if there were more defined options in the code it would mean OXPs like Snoopers wouldn't have to require complex coding, and the script files could be radically reduced.
Chat and relax with other commanders in the [url=irc://irc.oftc.net/oolite]DS's Seedy Space Bar[/url]. The Coolest Bar in the Eight.
Phantor's OXPs: GalCop Rewards and Safe Docking
Phantor's OXPs: GalCop Rewards and Safe Docking
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Extension to Mission Screen Handling
When Griff released his Halloween witch, I played a bit with it to let it fly circles to and from the player on a mission screen with callbacks. So , any animation there is already within the possibilities.Svengali wrote:Via spinModel:false and framecallback you can do a lot of things.Commander McLane wrote:I'm no expert on this, but wouldn't that require a re-write of how models are displayed on mission screens rather than a new check for keypresses? As far as I know the models are not meant to be controlled anyway. They just spin in front of you. Simple controls (like "increase spin" or "reduce spin") can be implemented as mission choices, but the main point is: does the engine currently allow to apply changes to the spinning models in the first place?
UPS-Courier & DeepSpacePirates & others at the box and some older versions