Difference between revisions of "Script - Journal/Fluff Viewer"
(First bit of documentation for this too...) |
(Adding command briefing feature) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
*tables/ | *tables/ | ||
**axui-sct.tbm | **axui-sct.tbm | ||
− | ** | + | **barracks-lcl.tbm |
+ | **imonitor-sct.tbm | ||
**journal-sct.tbm | **journal-sct.tbm | ||
**parsecfg-sct.tbm | **parsecfg-sct.tbm | ||
− | ** | + | **zLoadFirst-sct.tbm (written by Nuke) |
==Demonstration Files:== | ==Demonstration Files:== | ||
Line 30: | Line 31: | ||
*fiction/ | *fiction/ | ||
**surrender.txt | **surrender.txt | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=Configuration Files= | =Configuration Files= | ||
All configuration files must be in /config/ | All configuration files must be in /config/ | ||
+ | |||
+ | ==Interface Monitor== | ||
+ | |||
+ | imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]]. | ||
==Journal Config File== | ==Journal Config File== | ||
Line 82: | Line 68: | ||
====Visible==== | ====Visible==== | ||
Boolean, is this entry visible by default? | Boolean, is this entry visible by default? | ||
+ | ====Font==== | ||
+ | ''Optional.'' Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified. | ||
====Title==== | ====Title==== | ||
String, this is what will be displayed on the selection list box near the bottom | String, this is what will be displayed on the selection list box near the bottom | ||
Line 87: | Line 75: | ||
Your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n | Your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n | ||
====File==== | ====File==== | ||
− | A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for | + | A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for Text. There's no need for \n escape sequences in the txt file. |
Line 99: | Line 87: | ||
====Title==== | ====Title==== | ||
String, this is what will be displayed on the selection list box near the bottom | String, this is what will be displayed on the selection list box near the bottom | ||
+ | ====Font==== | ||
+ | ''Optional.'' Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified. | ||
+ | ====CaptionFont==== | ||
+ | ''Optional.'' Same as font, only for the text under the image | ||
====Text==== | ====Text==== | ||
String, your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n | String, your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n | ||
Line 106: | Line 98: | ||
Filename, image that will be displayed to the left of the text. | Filename, image that will be displayed to the left of the text. | ||
====FullImage==== | ====FullImage==== | ||
− | Filename, if this is present, a zoom icon will appear on the Image's top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional. | + | ''Optional.'' Filename, if this is present, a zoom icon will appear on the Image's top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional. |
====Caption==== | ====Caption==== | ||
String, this is what will be displayed underneath the image | String, this is what will be displayed underneath the image | ||
Line 118: | Line 110: | ||
====Visible==== | ====Visible==== | ||
Boolean, is this entry visible by default? | Boolean, is this entry visible by default? | ||
+ | ====Font==== | ||
+ | ''Optional.'' Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified. | ||
====Title==== | ====Title==== | ||
String, this is what will be displayed under the thumbnailed image | String, this is what will be displayed under the thumbnailed image | ||
====Image==== | ====Image==== | ||
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image. | Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image. | ||
− | + | ||
− | |||
==Generated Files== | ==Generated Files== | ||
Just for reference, you don't need to make these. | Just for reference, you don't need to make these. | ||
Line 141: | Line 134: | ||
===Notification File=== | ===Notification File=== | ||
− | Generated a new entry | + | Generated when a new entry is added |
+ | |||
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav | Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav | ||
− | |||
=FRED Functions= | =FRED Functions= | ||
Line 171: | Line 164: | ||
Deletes all the sav files, basically reverting everything back to defaults | Deletes all the sav files, basically reverting everything back to defaults | ||
+ | |||
+ | =Command Briefing Buttons= | ||
+ | |||
+ | If imonitor-sct.tbm is present, a button will appear on the command briefing screen that allows you go to to the journal screen. A "New!" notification is also displayed if a new entry has been added. |
Latest revision as of 15:51, 22 June 2014
The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.
This page will assist modders to install it, configure it, and use it.
Contents
Download Link
LINK!
Required Files:
- interface/
- 2_Journal
- axui_close (+ c and h variants)
- axui_left (+ c and h variants)
- axui_right (+ c and h variants)
- axui_zoomin (+ c and h variants)
- cb_sidetab (+ c and h variants)
- tables/
- axui-sct.tbm
- barracks-lcl.tbm
- imonitor-sct.tbm
- journal-sct.tbm
- parsecfg-sct.tbm
- zLoadFirst-sct.tbm (written by Nuke)
Demonstration Files:
- config/
- journal_diary.cfg
- journal_FreeSpace2_config.cfg
- journal_people.cfg
- journal_photo.cfg
- fiction/
- surrender.txt
Configuration Files
All configuration files must be in /config/
Interface Monitor
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in Script - Interface Monitor.
Journal Config File
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg
journal_FreeSpace2_config.cfg
If no valid config file is available for a campaign, the journal will be empty
Index
Number, start at 1 and go up, journal supports up to 3
Name
String, this is what the label by the tab will be
Style
String, valid options: FullText, ImageText, Thumbnails, descriptions below
RevSort
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.
File
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won't see them in a VP file!
Content Files
FullText Type
Good for lots of words. No Images.
Index
Enter a number or leave it blank, the script isn't picky here. It just needs to know to start here.
Visible
Boolean, is this entry visible by default?
Font
Optional. Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.
Title
String, this is what will be displayed on the selection list box near the bottom
Text
Your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n
File
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for Text. There's no need for \n escape sequences in the txt file.
ImageText Type
Good for showing an image + caption plus more words. Good for pilot profiles.
Index
Enter a number or leave it blank, the script isn't picky here. It just needs to know to start here.
Visible
Boolean, is this entry visible by default?
Title
String, this is what will be displayed on the selection list box near the bottom
Font
Optional. Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.
CaptionFont
Optional. Same as font, only for the text under the image
Text
String, your wall of text. Note that normal line breaks won't work here. If you need a line break, use the escape sequence \n
File
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There's no need for \n escape sequences in the txt file.
Image
Filename, image that will be displayed to the left of the text.
FullImage
Optional. Filename, if this is present, a zoom icon will appear on the Image's top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.
Caption
String, this is what will be displayed underneath the image
Thumbnails
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.
Index
Enter a number or leave it blank, the script isn't picky here. It just needs to know to start here.
Visible
Boolean, is this entry visible by default?
Font
Optional. Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.
Title
String, this is what will be displayed under the thumbnailed image
Image
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.
Generated Files
Just for reference, you don't need to make these.
Save File
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav
Eg: FreeSpace2_Holley.1.sav
Index
(blank)
Visible
Boolean, is this visible?
Read
Boolean, was this read?
Title
Title of entry
Notification File
Generated when a new entry is added
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav
FRED Functions
Use with the script-eval sexp
journal set visible
jsv('tab name', 'entry title')
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file
eg: jsv('Contacts', 'Misuzu Stella')
journal set invisible
jsi('tab name', 'entry title')
Makes a visible entry invisible (effectively hiding it).
journal reset progress
Journal:ResetProgress()
Deletes all the sav files, basically reverting everything back to defaults
Command Briefing Buttons
If imonitor-sct.tbm is present, a button will appear on the command briefing screen that allows you go to to the journal screen. A "New!" notification is also displayed if a new entry has been added.