Page 1 of 3

Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Sat Feb 04, 2017 2:44 pm
by RalleYTN
Hey Factorio Community!
I'm currently working on an IDE for mod creators.
The target of the software is to make it as easy as possible to create mods for Factorio.
I will use this topic as a little dev-blog and changelog.
Once I finished version 0.1.0 of the Factorio Mod Creator Studio I will create a GitHub repo so others can help the development.
(It's developed in Java with an extension of the Swing libraries called WebLAF)

The layout of the software is based on big IDEs like Eclipse or NetBeans.
It will contain "forms" with fixed fields for technologies, items, entities etc.
To that it will have a Lua Editor with auto-completion.
You will be able to export the mod as a ZIP with a simple click on the "Export" button.
On top of that it will have project management.

This is my progress so far:

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Sat Feb 04, 2017 9:55 pm
by RalleYTN
I already set up the basics for the Lua Editor.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Sat Feb 04, 2017 10:01 pm
by RalleYTN
You already want to help the development of Factorio Mod Creator Studio?
Nice! I have a problem which you can probably solve.
For the Lua Editor I use a Java library called RSyntaxTextArea.
I have no possibility to check for Lua syntax errors yet. the library has no built in parser for Lua.
BUT it has an abstract interface which can be implemented to write your own parser.
If you want to help the development, write a parser for Lua 5.2 and attach it to this topic.
If you give me a name I can add it to the contributors list.

Links:
https://www.lua.org/manual/5.2/manual.html
https://github.com/bobbylight/RSyntaxTextArea

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Sun Feb 05, 2017 1:39 pm
by RalleYTN
I now have a working tab system and started the item editor.
the editors will always have one properties tab and a source tab. the properties tab will have forms, fields, checkboxes etc. and the source tab will be the location where you can edit the source code of the prototype that you are currently editing.
I also embedded the LUaGameScript class now in the auto completion.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Sun Feb 05, 2017 3:44 pm
by RalleYTN
The basis for the project management is now implemented.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Mon Feb 06, 2017 6:55 pm
by RalleYTN
So. Today I replaced the old "New"-Dialog system with a wizard system.
What now happens when someone clicks on the "New"-button is that a wizard selection is opened in which you define of what you want something new.
After you selcted the wizard you want it pops up.
The first and currently only wizard is the "New Project"-wizard.
It is an improved version of the "New Mod"-Dialog.
if you type in the project name it automatically fills out the mod name and mod title fields. To that it also removes all invalid characters from the mod name automatically.
The most recent game version will be set as the target game version automatically.
And it will automatically fill out the Author field with your system user name.
I also plan on adding a second page for the wizard in which you can set the dependencies of the mod.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Mon Feb 06, 2017 8:18 pm
by RalleYTN
Ok I now have implemented the basis for the dependency page in the "New Project"-wizard.
I also forgot to include a screenshot of the wizard selection so I include it here.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 7:13 am
by RalleYTN
Just found this tool through the Development Tools forum: http://draeton.github.io/stitches/
I will probably implement something like this into FMCS.
Now I ask you if a sprite sheet generator tool should have any special features?

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 7:40 am
by RalleYTN
This will be the GitHub-Repo in which the code for the Factorio Mod Creator Studio can be found after I finished the alpha 0.1.0 version of the software.
https://github.com/RalleYTN/Factorio-Mod-Creator-Studio

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 5:13 pm
by RalleYTN
The dependencies are now fully functional.
I made sure that you can't add mods with invalid characters in the name or duplicate mods.
also you cannot edit or delete the base mod dependency. you can change the version of the base mod dependency through the target game field on the firt tab of the "New Project"-wizard.

Next thing I will do is making the wizard in itself functional. so creating a project file and register it in the project tree on the left.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 7:24 pm
by prg
RalleYTN wrote:also you cannot edit or delete the base mod dependency.
Mods are not required to depend on the base mod. You can make a total conversion if you want to.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 8:18 pm
by RalleYTN
prg wrote:
RalleYTN wrote:also you cannot edit or delete the base mod dependency.
Mods are not required to depend on the base mod. You can make a total conversion if you want to.
what can I understand under a "total conversion"?

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 8:26 pm
by prg
RalleYTN wrote:what can I understand under a "total conversion"?
https://en.wikipedia.org/wiki/Mod_%28vi ... conversion

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Tue Feb 07, 2017 8:32 pm
by RalleYTN
prg wrote:
RalleYTN wrote:what can I understand under a "total conversion"?
https://en.wikipedia.org/wiki/Mod_%28vi ... conversion
OK. I will find another solution then.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Wed Feb 08, 2017 12:25 pm
by RalleYTN
prg wrote:
RalleYTN wrote:also you cannot edit or delete the base mod dependency.
Mods are not required to depend on the base mod. You can make a total conversion if you want to.
I think I found a not-complex solution.
a simple checkbox.
checked = like it is now
unchecked = no base mod dependency

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Wed Feb 08, 2017 5:22 pm
by RalleYTN
K. Added the checkbox
now to the project management

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Wed Feb 08, 2017 8:32 pm
by RalleYTN
The "New Project" Wizard is now fully functional.
Project files are created by clicking on the finish button and automatically loaded on startup.
Now I will clean the code a bit and start documenting it to this point. (It already gets pretty messy)

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Thu Feb 09, 2017 6:58 am
by RalleYTN
OK I thought about the custom libraries.
I think I know how I will do that.

Step 1: Pack all the LUA files into a ZIP.
Step 2: Create an autocomplete definition for FMCS(not needed but you wont get auto completion otherwise)

The definition is a JSON file with the name "autocomplete.json".
It contains an array with objects that are built like this:

Classes:

Code: Select all

{
    "type":"class",
    "name":"name of the class",
    "short_description":"little gray text at the right side of the name",
    "summary":"Big HTML formatted text that goes into detail"
}
Functions:

Code: Select all

{
    "type":"function",
    "name":"name of the function",
    "summary":"Big HTML formatted text that goes into detail"
    "return_type":"type that this function returns (table, int, uint, etc.)",
    "return_value_description":"Description for the returned value",
    "defined_in":"class in which this function is defined in or 'null'"
    "heads": [
        [
            {
                "type":"Type of the parameter value",
                "name":"Parameter name"
                "description":"Parameter description"
            },
           ...
        ],
        ...
    ]
}
Variables:

Code: Select all

{
    "type":"var",
    "name":"Name of the variable",
    "description":"Variable description",
    "return_type":"Type of the variable (table, int, etc.)",
    "defined_in":"Class in which this variable is defined in"
}
Shorthand Completion (like "sysout" in eclipse)

Code: Select all

{
    "type":"shorthand",
    "input_text":"text you have to type",
    "replacement_text":"The template",
    "short_description":"Text shown at the right side of the input_text",
    "summary":"Big HTML formatted text that goes into detail."
}
Step 3: Put the autocomplete.json into the ZIP file too.
Step 4: Open the "New Custom Library"-wizard and select the ZIP.
Step 5: done!

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Thu Feb 09, 2017 7:16 pm
by RalleYTN
So I cleaned the code of the wizard system a bit and abstracted many parts out to do much of the stuff automatically.
For example I can now connect the "Finish" button to textfields. if one of the textfields is empty the button is disabled.
Now with the new wizard system I re-did the "New Project"-wizard.

Re: Factorio Mod Creator Studio [IN DEVELOPMENT]

Posted: Thu Feb 09, 2017 10:25 pm
by RalleYTN
OK. now I have improved the tree system.
I dont have to check every node for what it is just to assign an icon anymore. I just extended the responsible class and added a parameter "iconName".
with this parameter the node searches its icon by itself.

I also implemented the settings now.
not much until now, but at least the window now remembers the state it was left in.
so if you maximize it and leave, it will start up maximized. it also remebers the exact width and height.

Now I only have to clean the old Dialogs and UI elements. Then redo the lua editor and afterwards document the code.
then I will continue with the big things. next will be adding custom Lua libraries. the biggest problem with them was the auto completion stuff. but I think I solved it with the method I proposed earlier today. I will create the files for the standard Lua libraries and Factorio API myself. maybe even the file of the stdlib-0.8.0.