2 FSB files and library books
|FSB files ( files with a .fsb extension )
in Fishsim2 are similar to HTML pages that can be created
for the Internet, however, fsb files can only be
displayed inside Fishsim 2. If you created .gsn files for
Fishsim version 1, the concept is very similar.
Tackle, baits, or venues can contain an fsb file to provide the fishsim angler with more information about the add-on. With tackle and baits, a right click on the tackle screen will display the associated fsb file if one has been created. With venues, the venue info button or peg info button will display the page.
Also the books in the library are just collections of .fsb files linked together, with one fsb file representing a single page of the book.
|Creating a book for the library|
|To create a new book for the library, you
will need to create a new .fsl file in
the BOOKS folder of FS2. .FSL files are,
like many others, text files than can be created and
edited in Windows Notepad. They are arranged in the same
was as other files with a [Book] section ( in square
brackets ) and just four variables ( Title, Author, Date,
and Fsb ).
The Title line contains the title of the book that will appear in the library. The Author contains your name, or the author of the book's name. The Date line contains the date the book was created. The values of these three lines are all displayed on the library page in FS2. The most important line, however is the FSB line, this contains a full path and file name to the first page of the book. An example of the book for the river lot venue is shown below, as a guide :
|FSB files ( help pages )|
|FSB files are very similar to HTML files,
in that they are text files that contain commands that
are used to format the display of a single page. A full
list of the current commands is shown in the table below,
with a more detailed description of each below that.
By far the best way to create FSB file is to look at existing ones and use them as a template to creating new ones ( the old copy and paste again :) ).
IMPORTANT : Before anyone gets really frustrated when creating FSB files, there is a tip that can be used to speed the whole process up by a lot. When you define an FSB file and view it in FS2, you don't need to close FS2 off to make changes and restart. Whilst looking at the page in FS2 press ALT+TAB together on the keyboard to minimise fishsim 2. Then edit the FSB file to make changes, then click on the fishsim icon on the taskbar to restore it and see the changes made. It saves a heck of a lot of time, and makes creating FSB files a lot easier.
Don't be put off by the descriptions below, they probably sound a lot more complicated than they really are, the best way is to look at exisiting FSB files.
|FSB command list|
|Description of each FSB command|
|ADD x y
The ADD command can be used to correctly the page on the screen in FS2. It is normally put at the very start of the text, before anything else is displayed. It contains two values, X and Y. These two values specify the x and y additions that are added to all the x and y values on all lines below the add line. For example, if the line ADD 10 50 was placed at the start of an FSB file, everything displayed would be shifted 10 pixels to the right and 50 pixels down. Negative values can be used to make the additions move left and up.
AREA x y x1 y1 action page
The AREA command is similar to HTML hyperlinks. It can be used to link pages together, or give the reader an area to click to close the page down. The active area is represented by the X, Y, X1, and Y1 values, that define a square region for the reader to click. When the mouse cursor goes over this area, it will change to a hand, indicating it is an area that can be clicked. The action value specifies the action to be taken when this area is clicked. This value can be set to 1 to close the page, 2 for a page to be opened to the right of the book, 3 to be opened to the left of the book. There are a lot actions to come in the future, for example, playing WAV or AVI video files, but for now, it should be set to a value between 1 and 3. The final page value should be set to FSB path and filename to be opened when the area is clicked. If the action value is defined as 1 (close) then [close] should be used for this value.
BEDGE x y x1 y1 col1 col2
This command can be used to place a windows style button edge area on a page. A button is a rectangular area specified by X, Y, X1 and Y1 which consists of two colours, a top and left edge colour, and a bottom and right edged colour. The colours are palette indexes defined with the SETCOL lines. If a lighter colour is used for the first colour specified and a dark colour used for the second, the effect gives a button that appears to come out of the page. In the reverse example, it gives a pressed button effect or indentation in the page.
BOX x y x1 y1 col
The BOX command is used to draw a solid filled box on the page in a single colour. The X, Y, X1 and Y1 values define the rectangular area in pixels and the colour is a colour palette reference specified by a SETCOL line.
This line can be used to change the font of all the text displayed after this line. The font value represents a filename in the FONTS folder of fishsim ( without an extenstion ), for example : TM10, HLV15 etc.. If the FSB file contains any text then, there should at least be one of these lines included at the start.
CHAR x y col
This command can be used to place a single character on the page. It is not often used, as a string line containing just a single character string does the same job. The colour of the displayed character is specified in the third parameter (col) and is a palette index value specified in a SETCOL line.
CONTAINER x y x1 y1
This command is critical to the correct functioning of the page in FS2. There should always be a container line before any display commands in the FSB file. The area the page takes up is defined in the X, Y, X1, and Y1 values. When FS2 displays the page and comes across this line in the source, it stores the screen image in the rectangle specified. When the page is closed or another page opened, this area is replaced back, restoring the screen to the original.
The last line in an FSB file should be END to signify that there is no more commands to come.
GYLINE x y y1 spacing graphic
The GYLINE can be used to place the same graphic multiple times on a page in a single line. It can only be used to draw graphics from top to bottom. The x and y values specify the starting coordinate for the first graphic, the Y1 lines specifies the bottom point for the graphic, and the spacing line specifie how many pixels apart in a Y direction each graphic should be. The graphic value sets the path and filename of the graphic to be displayed. All graphics displayed with the GYLINE, always use the graphic palette index 0 as a mask, which is not displayed.
LINE x y x1 y1 col
The LINE command is used to draw a single line between to points (x,y) to (x1,y1) in the colour index specified. The line is always a single pixel wide.
LINEX x y x1 col
This command can be used to draw a horizontal line across a page from (x,y) to (x1,y), in the colour palette index specified. If horizontal lines are to drawn then it is better and faster to use this command than the LINE command above.
LINEY x y y1 col
This command is identical to the LINEX command above, apart from the line drawn is vertical between the points (x,y) and (x,y1).
The merge command can be used to specify that all images displayed after it are merged with the background. If a line MERGE 1 is specified all the graphics displayed after the line will merge with the background. The line MERGE 0 can be used to turn off the merge effect. If a MERGE 1 line is included in an FSB file, you should always have a MERGE 0 line to turn it off again before the END, otherwise the display in FS2 will be affected after the page is closed.
PIXEL x y col
This is a simple command, that just draws a single pixel on the page in the colour specified. It's not commonly used.
PUTGRAPHIC x y mask graphic
The PUTGRAPHIC command can be used to place a JPG or PCX file onto the page at the (x,y) coordinates specified ( representing the top left of the graphic ). The mask value can be set to either 0 or 1, if set to one FS2 will use the palette index 0 of the image as the mask and not display it. The graphic value is the relative path and filename of the JPG or PCX image to draw.
This can be added to place comments in the FSB source, or more importantly, it can be added to the start of a line to force FS2 to ignore it when reading the FSB source. This can useful, if you want to remove a line without deleting it, just in case.
SETCOL col r g b
Normally the first few lines in an FSB file are SETCOL lines. Each FSB file can have upto unique 256 colours defined for it. To define any one of these colours add a line SETCOL followed by the red, green and blue mixtures. The red, green and blue mixtures can be any values from 0 to 255. All 0's result in black, all 255's result in white. The example below draws a dark green box :
SETCOL 1 0 100 0
In the example, the colour palette index 1 has been defined as a dark green (0 100 0), and a box drawn on the page at coordinates (100,100) -> (200,200) using palette index 1 ( dark green mixture )
SHADOW x y col1 col2 spacing text
The shadow line can be used to draw text on the page with the current set font. The starting position of the text is specified by the X and Y values. The text is drawn in two colours, slightly offset to give a bold or shadow effect. The two colours are specified in the col1 and col2 values and are palette index colours ( see SETCOL ). Finally the text value contains the text to display. The spacing value is normally 1, but it can be set to higher, to space out each character in the string. For example, a spacing value of 2 will put 2 blank pixels between each character in the string.
SPUTGRAPHIC x y scale graphic
The SPUTGRAPHIC is virtually the same as the PUTGRAPHIC command apart from the mask is replaced with a scale value, that can be used to reduce the size of the graphic. No masking of graphics is done with this command. The scale value, for example, if set to 2 will halve the size of the image, if set to 4 will 1/4 the size of the image, 8 will be 1/8th of the image etc..
STRING x y col spacing text
This command is identical to the SHADOW command (above) however, the text is drawn with a single colour instead of two colours. The effect is not bold and a lot lighter.
WALLPAPER x y x1 y1 graphic
The WALLPAPER command can be used to wallpaper a rectangular area on the page. The area is specified by the (x,y)->(x1,y1) values, and the graphic file used to specify the wallpaper is set as the last value.
( There are more commands, but these are not really of use to standalone FSB files, and used by the FS2 program code, a lot more commands can be added to FSB files on request, please email them ).
|Below is an example FSB file from the
river lot book. If you can follow it through with the
descriptions above then FSB files should not be a problem
(c) J.C.Spooner 2001