Difference between revisions of "Mission screen"
Cholmondely (talk | contribs) (→Links: Added another) |
Cholmondely (talk | contribs) (Added note on right alignment) |
||
Line 40: | Line 40: | ||
:Code for [http://www.aegidian.org/bb/viewtopic.php?p=283402#p283402 Colour change] | :Code for [http://www.aegidian.org/bb/viewtopic.php?p=283402#p283402 Colour change] | ||
+ | |||
+ | [[File:First Finance Loan Management.png|right|200px]] | ||
+ | == Alignment == | ||
+ | There is no obvious way to do this, but [[User:Ocz|Ocz]] managed some version of right alignment for his [[First Finance OXP]] | ||
== Backdrop == | == Backdrop == | ||
: This is managed from within the script.js file: | : This is managed from within the script.js file: | ||
background: ""the_file_name_of_the_image_you_want_to_display_must_be_in_the_images_folder.png", | background: ""the_file_name_of_the_image_you_want_to_display_must_be_in_the_images_folder.png", | ||
− | or you can use ''overlay'' instead of ''background'' (less conflicts with other oxp's such as XenonUI which also specify a background) | + | or you can use ''overlay'' instead of ''background'' (less conflicts with other oxp's such as XenonUI which also tend to specify a background) |
=== Problems with Backdrop === | === Problems with Backdrop === |
Revision as of 12:39, 4 December 2022
Mission screens started off as screens which allow the player to interface with NPCs in a mission.oxp but also allow other sorts of "communication" as in the conversation overheard in the bar in the Hints OXP.
They can have backdrops, changes in text and allow choices for the player.
The text can be placed in a descriptions.plist, details about it in a script.js
Contents
Text
- Several spacial characters are used in determining the layout of the text, just as in Wiki.
\" Enables the use of colons. \\n Insert a hard Enter.
In XML:
\n Inserts a hard Enter.
- See Missiontext.plist for more complexity (eg random names, naming current system etc)
- Character '31' (hex:1F, octal:037) is a narrow 'hair-space'. Custom font OXPs should ensure that this character is blank and has the same narrow width as the core font definition, as it is used to allow an equivalent to 'tab stops' in mission text.
% codes
Here are the % codes that can be used inside description strings and what each one does:
Code:
- %H is replaced with <planetName>. If systemName is nil, a planet name is retrieved through -[Universe getSystemName:], treating <seed> as a system seed.
- %I is equivalent to "%H[planetname-derivative-suffix]".
- %N is replaced with a random "alien" name using the planet name digraphs. If used more than once in the same string, it will produce the same name on each occurence.
- %R is like %N but, due to a bug, misses some possibilities. Deprecated.
- %JNNN, where NNN is a three-digit integer, is replaced with the name of system ID NNN in the current galaxy.
- %GNNNNNN, where NNNNNN is a six-digit integer, is replaced with the name of system ID NNN (first triplet) in the specified galaxy (second triplet).
- %% is replaced with %.
- %[ is replaced with [.
- %] is replaced with ].
- From String expansion
Colour
- Choices can be non-yellow (have a look at the various contracts interfaces in 1.77) but there is a more fundamental limitation of the current UI code that all text on a particular line has to be the same colour. Cim (2013)
- Code for Colour change
Alignment
There is no obvious way to do this, but Ocz managed some version of right alignment for his First Finance OXP
Backdrop
- This is managed from within the script.js file:
background: ""the_file_name_of_the_image_you_want_to_display_must_be_in_the_images_folder.png",
or you can use overlay instead of background (less conflicts with other oxp's such as XenonUI which also tend to specify a background)
Problems with Backdrop
These can be prevented from appearing by other oxp's such as XenonUI which also create backdrops for the docked screens.
Using overlay helps, but also see Phkb's comments here (for Dark Side solutions) and here (using Library config).
Exit Screen
To change the "Exit Screen" away from the default, you can use this code
Svengali's Library & CCL
These two oxp's allow for more complex interractions. See the deprecated CCL's never used Cutscene, as well as the current Library OXP's "Music" and "Demos".
Links
- Creating a mission screen for textual messages (2021)
- Changing text colour (2022)
- New Line in mission.runScreen? (2017)
- Tabular text output for MFDs/mission screens (2016)