Page 1 of 1

Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 7:43 am
by mojo2012
Hi guys,

I've been playing aroud with moding for quite some time now. If you get the hang it's quite easy to create basic mods (like new recipes). But it's a very tedious process to find the bits and peaces to make more complex mods.
Most of the documentation (wiki, api docs) only provides minimal and sometimes outdated information.

Also it's very error-prone to develop lua script in a text editor.

My question for the DEV team is: Are you really developing this (the lua script part) in a text editor? If not, why not release those tools?

My wish: At least include some lua script debugging library, so we can use a lua script IDE and connect to the debugger to look into our mod's code.

The best thing would be a graphical mod builder, that allows us add new items/entites etc with a single click - also helping us with intellisense etc. Don't know which field on an entity belongs to what kind of entityTemplate? No problem, the IDE prefills that for you. You just have to fill in the actual data.

I think this would speed up the mod development a lot.

Also - because I was just thinking about it - provide a lot more events and hooks:
* Clicks on a surface (middle, left, right, long, double)
* key strokes (pressed, up, down, hold)
* allow to replace entity windows with a custom gui

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 10:55 am
by ssilk
Hm.

What you suggest is a mod, that can create mods.

What you want is an IDE with LUA-support. I personally use PhpStorm, which has a very fine plugin for lua, which - when added the right includes - becomes quite comfortable. But I'm sure that is also possible with Eclipse etc.

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 3:21 pm
by mojo2012
Hi,

sorry if there was a misunderstanding. No I don't want a mod that creates mod - that makes no sense??

I want a tool, that creates mod for me and a tool (=IDE) that allows me to debug (debug as in real programming languages, like java) the code, that is currently running in factorio.

Let me explain the desired workflow:
I want to fire up the IDE, create new project (=Factorio mod). Right click, new recipe, fill in the details. Click save.
Start factorio, connect the debugger of my IDE, wait till the control.lua kicks in and BAMMM, my IDE stops at the "created player" event, allowing me to inspect variables, modify variable contents etc ...

Well PhPStorm might have nice syntax highlighting - but it surely won't supply the above, right?

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 3:43 pm
by ssilk
mojo2012 wrote:sorry if there was a misunderstanding. No I don't want a mod that creates mod - that makes no sense??
Sorry, it makes very much sense. :)
-> Start game. Open a saved game. Open GUI of mod. If you know the test-mode-mod then like so, but much, much bigger and more comfortable and with the described functionality.

Or think to mod-extension to the built-in map-editor.
Well PhPStorm might have nice syntax highlighting - but it surely won't supply the above, right?
It supplies start/stop and so on. And the problem is also, that Factorio has no Lua-Debugger built in, otherwise I think debugging would be possible. It is still a lot of tweaking needed to make that work.

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 3:58 pm
by jockeril
Ssilk, im interested in trying Phpstorm - can you provide the configuration files you use ?

Maybe a screen shot or two of the integration you made
ssilk wrote:
I personally use PhpStorm, which has a very fine plugin for lua, which - when added the right includes - becomes quite comfortable. But I'm sure that is also possible with Eclipse etc.

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 4:02 pm
by Ranakastrasz
If you are talking about a debugger for ingame usage, letting you follow the script and figure out what variables are set to what, that would be very useful.

Re: Release/Provide MOD IDE

Posted: Mon Jul 04, 2016 4:25 pm
by mojo2012
To be honest I haven't tried the test-mode mod, but it seems more like a map building tool. it maybe about testing your mod, but it doesnt help me build one.

This mod you refer to would have to provide an entire IDE with prjoect support and all in a mod. It would also be fairly complicated to interact.

My idea currently is to build a java based framework, that provides syntax and logic checks and renders to mod/lua code.

the rest would be just the control.lua - when debugging kicks in again ;)

Re: Release/Provide MOD IDE

Posted: Tue Jul 05, 2016 10:02 am
by ssilk
jockeril wrote:Ssilk, im interested in trying Phpstorm - can you provide the configuration files you use ?
Well. That is quite simple till now I just added an include path
/Applications/factorio.app/Contents/data
to the include-paths.
Which looks then through all the provided libs etc. that Factorio will bring.

What would be quite useful would be abstract lua functions heads for each of Factorio functions, so that the IDE can built internal documentation. I don't see a big problem with that: If the can generate the provided doc-html folder, they can also generate lua-function headers, like

Code: Select all

file: LuaSurface.lua

...

---
-- Get the pollution for a given position.
--
-- @param position :: Position
-- @return double
-- @example
-- game.get_surface(1).get_pollution({1,2})
--
function get_pollution(position) {}
... so that when I click in my code on "get_pollution" I come to this function-head.

Maybe there are better methods; I'm not so used to lua, for php this is some kind of standard...

And that is in my opinion an own suggestion.

Re: Release/Provide MOD IDE

Posted: Tue Jul 05, 2016 3:23 pm
by jockeril
ssilk wrote:
jockeril wrote:Ssilk, im interested in trying Phpstorm - can you provide the configuration files you use ?
Well. That is quite simple till now I just added an include path
/Applications/factorio.app/Contents/data
to the include-paths.
Which looks then through all the provided libs etc. that Factorio will bring.

What would be quite useful would be abstract lua functions heads for each of Factorio functions, so that the IDE can built internal documentation. I don't see a big problem with that: If the can generate the provided doc-html folder, they can also generate lua-function headers, like

Code: Select all

file: LuaSurface.lua

...

---
-- Get the pollution for a given position.
--
-- @param position :: Position
-- @return double
-- @example
-- game.get_surface(1).get_pollution({1,2})
--
function get_pollution(position) {}
... so that when I click in my code on "get_pollution" I come to this function-head.

Maybe there are better methods; I'm not so used to lua, for php this is some kind of standard...

And that is in my opinion an own suggestion.
Intresting. I might try it my eclipse setup