Script - Journal/Fluff Viewer

From FreeSpace Wiki
Revision as of 21:19, 3 May 2014 by Axem (talk | contribs)
Jump to: navigation, search

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.

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
    • journal-lcl.tbm
    • journal-sct.tbm
    • parsecfg-sct.tbm
    • imonitor-sct.tbm

Demonstration Files:

  • config/
    • journal_diary.cfg
    • journal_FreeSpace2_config.cfg
    • journal_people.cfg
    • journal_photo.cfg
  • fiction/
    • surrender.txt
  • interface/
    • cats.jpg
    • crystalpissed.png
    • dawnohho.png
    • dmc.jpg
    • gummybears.jpg
    • Isa.png
    • justicea.png
    • lunahelmetsmile.png
    • M8.jpg
    • M11.png
    • miochan.jpg
    • misuzugrin.png
    • mm6w.png
    • racistyang.jpg
    • tempest.png
    • thumbsup.jpg
    • yesssss.png


Configuration Files

All configuration files must be in /config/

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?

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

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

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?

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