FOnline: Reloaded

General => Tools and Modifications => Topic started by: Wizard on July 17, 2015, 08:25:41 pm

Title: GUI Theme Maker
Post by: Wizard on July 17, 2015, 08:25:41 pm
I'm writing an application to automatically write faction.ini/default.ini in intrface\ folder by dragging PNGs and FRMs visually in a desktop window. Basically got an ini reader/writer and the basic dragging of pixmaps on the screen. Only thing remaining is interpretting the parameters within the ini files. A couple things i've noticed,

The first word, the one that begins with a capital letter, denotes which interface category a parameter belongs to, ie, IntMain, IntAim both belong to the main game interface because they are prefixed with *Int*.

  * .*Pic     = filename to PNG or FRM
  * .*PicDn = filename to PNG or FRM while *button* is activated
  * .*X        = X coordinate
  * .*Y        = Y coordinate
  * .*StepX = X pixels, draw image denoted by another variable at a space of N pixels towards the X direction, ie, horizontally
  * .*StepY = same as StepX, except Y direction, ie, vertically
  * .*

What is, OffsX and OffsY? Are there any tips as to how to interpret the parameters within the ini files?
Or should I manually map them all to mean things?

How do you, the FOnline developers extend the game interface? Is that possible through Angel Script? If that's true then I would assume that you are responsible for the naming conventions of these parameters within the ini files. Can you elaborate to me or give me a lookup table for their meanings?
Title: Re: GUI Theme Maker
Post by: drot on July 18, 2015, 07:45:14 am
You should ask these kinds of questions on fodev.net (not trying to be rude but you will get more help there).
Title: Re: GUI Theme Maker
Post by: Wizard on July 18, 2015, 08:29:17 am
TNX. That's not rude to me.
Title: Re: GUI Theme Maker
Post by: BeheGrzmotPL on July 18, 2015, 08:22:52 pm
Hello,
a month ago I also started a similar project, but recently I had no time to finish it.
When I'm done - I share in the forum.
http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331 (http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331)

What language are you going to write your program? I write in JavaScript.
Title: Re: GUI Theme Maker
Post by: Wizard on July 19, 2015, 08:57:40 am
Hello,
a month ago I also started a similar project, but recently I had no time to finish it.
When I'm done - I share in the forum.
http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331 (http://forum.fonline-reloaded.net/index.php?topic=5992.msg61331#msg61331)

What language are you going to write your program? I write in JavaScript.

Really? Coincidence :)
Unfortunately I don't understand Russian, so I cannot read that post you linked.
I am writing in C, desktop App. I am having trouble interpretting the INI, without a reference to the meanings of the individual variables within it, I cannot for certain make a stable application without very time consuming trial and error first.

I would propose that we merge our code into a repository, but I don't think JavaScript and C would be very compatible.
Title: Re: GUI Theme Maker
Post by: BeheGrzmotPL on July 19, 2015, 02:15:29 pm
Hehe, this is the Polish language - easy to distinguish, because it is not written in the Cyrillic alphabet ;) 
I recommend using Google Translate, and the best of Google Chrome browser, which automatically translates the whole page. I know English on an average level, so as I write a longer story, I am using the translator and possibly introduce its own amendments.



As for the program:

INI file is a plain text file with a different extension. Just save all the data as a text file - permanent element names and values ​​of the variables, you can add the #comments.

Names of elements easily decipher. File name, the coordinates of the upper left and lower right corner of the element, the same text, I'm just not sure what it is OffsX and OffsY but also some coordinates, so come out later what is it.

Now I concentrated on the technical part of the program - I mean the general appearance and the ability to move objects with the mouse. All files FRM I converted to PNG and FOFRM (animation of the sequence of PNG files).

Unfortunately, over the last month I did not do anything because I was busy with another project.



It seems to me that the only thing that might be useful to you from my program, and even - may be exactly identical allowing any time to edit the data in my or your program - is a database.

I write database using JSON language that is compatible with many other programming languages and can transfer data between them.

My tutorial: http://www.w3schools.com/json/json_files.asp (http://www.w3schools.com/json/json_files.asp)

Your tutorial: https://code.google.com/p/rapidjson/wiki/UserGuide (https://code.google.com/p/rapidjson/wiki/UserGuide)
or http://www.codeproject.com/Tips/805182/A-fast-JSON-parser-loader-for-your-Cplusplus-proje (http://www.codeproject.com/Tips/805182/A-fast-JSON-parser-loader-for-your-Cplusplus-proje)
or another.



I suggest JSON file structure:

Code: (INI file) [Select]
;===============Register Button

LogRegPicDn=MENUDOWN.PNG
LogReg=671 324 760 354
LogRegText=0 0 0 0


Code: (JSON file) [Select]
database([
{

"name":";",
"value":"===============Register Button"
},
{
"name":"LogRegPicDn",
"value":"MENUDOWN.PNG"
},
{
"name":"LogReg",
"value":"671 324 760 354"
},
{
"name":"LogRegText",
"value":"0 0 0 0"
}
]);
Theoretically, I can use simple variables here instead of an array, but the array allows you to upgrade and does not require manual numbering variables.


Coordinates best to save in this way. Before saving you should convert numeric values to string and combine in one word.
Characters = better to add when writing to the INI file.


JSON data file is a text file and can be saved with any extension, for example: .TXT, .JS, .PHP, .JSON, .H, .FONLINE, anything at all ;)


Note: The JSON file could not be any comments.


Note2: I do not know how in C / C++, but in PHP special characters must be written as a string in PHP - that is, the \ should be written as \\, " as \" etc.


Note to the administrator: There is a bug in the WYSIWIG creator, because some spacing between the lines to intercede twice, when I intercede only once.
Title: Re: GUI Theme Maker
Post by: Wizard on July 19, 2015, 07:09:24 pm
AHH, It's Polish :facepalm

It looks interesting. I'm not sure what you're doing with that JSON file, is it to serve as a database for the meanings of the INI variables?

I have a similar thing, I call it descriptions.ini (uses same format as faction.ini/default.ini), but it does nothing but pop up a tooltip to the user.

Currently I am implementing FRM viewer, but I am unsure where I can find the palette file (color.pal) used by FOnline. Do you know?

Did you convert FRM to PNG? Is that done during runtime or prehand using external tools?
Title: Re: GUI Theme Maker
Post by: BeheGrzmotPL on July 19, 2015, 08:27:01 pm
I'm not sure how well I'm doing this because I'm quite a novice programmer :P I do this in the form of a website, because first - that I know how to do, and second - easier to reach a large group of people and do not need to install anything. I can also very easily customize the look with CSS and JS.

There probably is no dedicated service INI files, so I treat it like any other text file. Reading a file line by line every time would be rather inefficient, especially that manually modified file could vary significantly.
That's why I'm going to use JSON for data storage for the program - will be assigned to all the scripts. To the program in spite of everything I would have to use a lot of variables that store data from an INI file. Instead of creating variables that are encoded in the program, I write data to an external file via JSON and I operate directly on them. If so, I have a working data stored in auxiliary file, and by the way it is possible to easily export them to other programs.
INI file will be generated from scratch after each change. My program is intended to serve creation. At the moment I considered not ready file import options of finished INI files, but it also can be done in the future.
With JSON I will be able to connect this wizard with PHP and create a service similar to www.nitue.net (http://www.nitue.net)

I used to convert this program: http://www.atomicgamer.com/files/95422/titanium-frm-browser-1-3 (http://www.atomicgamer.com/files/95422/titanium-frm-browser-1-3)
It has a file default.pal - this can be helpful.
Title: Re: GUI Theme Maker
Post by: drot on July 20, 2015, 11:58:21 am
Currently I am implementing FRM viewer, but I am unsure where I can find the palette file (color.pal) used by FOnline. Do you know?

It uses the one from master.dat.
Title: Re: GUI Theme Maker
Post by: Wizard on July 21, 2015, 10:43:52 am
TNX. Got the color.pal.

In the JSON file, it seems that you do not plan on reading exisitng INI files? Because what would be the point of a JSON file if that's true? Is this true? Do you plan on only making the application able to write INI files? You can load entire INI files into memory, then process them, that's not inefficient and they are usually not very big. Well, I don't know anything about JavaScript except how it looks like.
Title: Re: GUI Theme Maker
Post by: BeheGrzmotPL on July 21, 2015, 11:04:46 pm
I see it, that in order to load into memory INI, I have to assign data from the INI to variables or arrays, so I can upload them directly to JSON. This allows performing operations on elements - moving, resizing, change image - doing them directly on the plate in JSON, instead of on the virtual array in JS that could be accidentally erased when you refresh the page (F5). In addition, using JSON can transfer data from JS to PHP and vice versa, if needed.

Actually, I could not even use the JSON. Load data into memory, perform operations on them, save to INI, and that's all. However, it seems to me I might come in handy later. If now I do and I do not useful, it's not lose, and how not to do and I will need later on, I'll have to do half of the program from scratch.

I suggested you use it to our programs use the same data, but... actually, I don't know why :P


Changing the subject:

I wonder how to download data from INI intended for other resolution because some of the parameters there do not exist (they are the same as for the primary resolution).


And above all - where to get the missing files FRM. The INI files are entered in many files FRM are not exist in the folder Interface. I unpacked file data/faction.zip and it also did not exist. I downloaded the SDK and there are exactly the same files.
Title: Re: GUI Theme Maker
Post by: drot on July 22, 2015, 08:22:56 am
And above all - where to get the missing files FRM. The INI files are entered in many files FRM are not exist in the folder Interface. I unpacked file data/faction.zip and it also did not exist. I downloaded the SDK and there are exactly the same files.

Sometimes they are assigned dummy values like None.FRM, since if I remember it right you can't leave a value unassigned.
Title: Re: GUI Theme Maker
Post by: Wizard on July 22, 2015, 08:34:00 pm
I got rough FRM viewer. It's because documentation is scarce, and the one I've been reading is thankfully less faulty than correct. Either that or FRMs do not particularly follow their specification (I guess it's reverse engineered, what to expect?). For single frame FRMs, the file header fields report 100% correctly. Though the animations, they tend to have incorrect header fields. However, Width and Height fields have so far always been correct.

Appreciate if anyone got documentation on the FRM file format, otherwise, I'll satisfy with this rough implementation based on: http://falloutmods.wikia.com/wiki/FRM_File_Format (http://falloutmods.wikia.com/wiki/FRM_File_Format)

I can display both static and animated FRMs currently.

Now I move on to .fofrm support, which should be no problem.
Title: Re: GUI Theme Maker
Post by: Wizard on July 22, 2015, 08:35:57 pm
I'll also release source code when I've got atleast a basic working GUI Interface Maker.
Title: Re: GUI Theme Maker
Post by: Wizard on July 22, 2015, 09:16:49 pm
I made a C specific programming mistake in converting 32bit numbers to little endian. That was the reason for FRMs reporting faulty fields. I guess FRM support no longer qualifies as rough :)

Should have said, "either that, or the other thing, or I did a mistake".
Title: Re: GUI Theme Maker
Post by: Wizard on July 25, 2015, 04:50:37 pm
This is what we can do. Assuming the default interface touches every single INI parameter, then extract type + value count for each parameter. Store this in database. Use it as a lookup table. Hardcoding these is not desired.

It is detectable by value, which type one parameter has. A parameter has either string type or integer. If the type is an integer, then it's a coordinate or an offset from a mentioned coordinate.

The first capitalized word of a parameter's name, refers to its interface category, eg, Pip for PipBoy, Log for Login, etc.


(.+Pic|.+PicDn) --> .FRM or .PNG or .FOFRM

(.+OffsX)|(.+OffsY) --> Width/Height offset

(.+X)|(.+Y) --> X / Y coordinate

(.+StepX)|(.+StepY) --> X / Y offset, as in drawing frame(s) by an offset of X,Y each count

.+Max --> total count (IntApMax is the only occurance yet)

.+Text -> rectangle area in which text is displayed


More suffixes will likely turn up.
Those parameters without suffixes specify modifiable rectangles.

My plan is to extract the default interface, generate a lookup table to gain an overview of every single INI parameter and their usages (whether they're string types, etc).

When that is done, I have the first production ready version as FRM, FOFRM and PNG support is implemented. Then it's the application specifics remaining.

FOnline.exe looks up DataFiles.cfg + reads ZIP files, then merges that with subfolders in data\ (art,fonts,etc). Is this correct? When does it read fallout.dat? And does fallout.dat contain any interface elements? Please respond quickly. Thanks
Title: Re: GUI Theme Maker
Post by: drot on July 25, 2015, 05:42:48 pm
And does fallout.dat contain any interface elements? Please respond quickly. Thanks

Yes it does contain interface FRMs like buttons and stuff like that, you can view it with DatExplorer (http://www.nma-fallout.com/downloads.php?do=file&id=94).
Title: Re: GUI Theme Maker
Post by: Wizard on July 25, 2015, 06:27:58 pm
TNX. I have it now.

There are two more questions.


The answers are not essential as I do not think they relate to the interface, atleast not the latter. I am curious about them.

Anyway. Thanks for your replies. I will generate database, attempt to load up the default interface, implement application's interface. Though it would be nice with a reference explaining .FOFNT files and their corresponding .PNGs.
Title: Re: GUI Theme Maker
Post by: drot on July 26, 2015, 09:39:28 pm
Ugh .fofnt, I don't remember if I've ever encountered a more hideous format. Don't know about the .LST files but encounters.dat is used by the Scout perk (it's basically a text file holding an encounter list, that's why you couldn't open it with datexplorer).
Title: Re: GUI Theme Maker
Post by: Koniko on July 27, 2015, 11:16:05 pm
.lst may be list of an objects such as items graphics, scenery etc. Send me what the file contains on PM and I'll tell u. I can't do it myself atm. Just open it with notepad and ctrl A.
Title: Re: GUI Theme Maker
Post by: Wizard on July 28, 2015, 04:26:51 am
You find them in data\faction.zip
Title: Re: GUI Theme Maker
Post by: Koniko on July 30, 2015, 04:12:58 pm
Ah sorry. I was wrong .lsg contained in client folder are params IDs & Reputation/Perks/Misc graphics.
Title: Re: GUI Theme Maker
Post by: Wizard on July 31, 2015, 11:09:38 pm
Ah sorry. I was wrong .lsg contained in client folder are params IDs & Reputation/Perks/Misc graphics.

Do you know how they work?
Title: Re: GUI Theme Maker
Post by: Wipe on August 01, 2015, 05:22:06 pm
.lst files have nothing to do with gui
Title: Re: GUI Theme Maker
Post by: Wizard on August 01, 2015, 08:01:13 pm
.lst files have nothing to do with gui

What is that what they have to do with? As PictureNames.lst seems to be associating numbers with images. INTRFACE.LST lists FRMs, how are they not related to the interface? Are they not used?

Are they obsolete? What is their use?
Title: Re: GUI Theme Maker
Post by: Wipe on August 03, 2015, 01:57:24 am
Some has been required years ago [when SDK was still using Fallout format closely], at least few was never deleted from 2238 .zips when they become obsolete [and that's how Reloaded got them], some are used by client and/or mapper... either way, it's devs not interface makers problem :P
Title: Re: GUI Theme Maker
Post by: BeheGrzmotPL on September 20, 2015, 02:19:43 pm
Are there any progress in your project?
Title: Re: GUI Theme Maker
Post by: Wizard on November 04, 2015, 11:31:15 pm
Are there any progress in your project?

Hey. I've still got the source code, but I've put the project on hold. Am working on something else currently. When done with that, I might continue.