Factorio Mod Creator Studio [IN DEVELOPMENT]
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Anyone here who knows a good JavaScript to Lua Converter for Java..... or as command line tool?
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
OK. for the ones who are not willing to learn Lua but already know JavaScript(for example me... but i'm willing to learn Lua), I present you a solution.
I will allow both Lua and JavaScript(not for browsers and with much less features, basically only the things that lua has.... but I may implement switch-case at a later point).
So this:
Is equal to this:
WARNING!: I can not garantuee that the code conversion(JavaScript -> Lua) will be perfect in the first alpha versions.
I will allow both Lua and JavaScript(not for browsers and with much less features, basically only the things that lua has.... but I may implement switch-case at a later point).
So this:
Code: Select all
script.on_event(defines.events.on_entity_died, function(event) {
var recently_deceased_entity = event.entity;
var time_of_death = event.tick
for(player in game.players) {
player.print("Let it be known that " + recently_deceased_entity.name +
" died a tragic death on tick " + time_of_death);
}
});
Code: Select all
script.on_event(defines.events.on_entity_died, function(event)
local recently_deceased_entity = event.entity
local time_of_death = event.tick
for _, player in pairs(game.players) do
player.print("Let it be known that " .. recently_deceased_entity.name ..
" died a tragic death on tick " .. time_of_death)
end
end)
Last edited by RalleYTN on Fri Feb 10, 2017 11:38 am, edited 1 time in total.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Another example:
Lua:
JavaScript:
Lua:
Code: Select all
data:extend({
{
type = "item",
name = "bomber",
icon = "__BomberTutorial__/graphics/icon_bomber.png",
flags = { "goes-to-quickbar" },
subgroup = "ammo",
place_result="bomber",
stack_size= 1,
}
})
Code: Select all
data:extend([
{
type:"item",
name:"bomber",
icon:"__BomberTutorial__/graphics/icon_bomber.png",
flags: [
"goes-to-quickbar"
],
subgroup:"ammo",
place_result:"bomber",
stack_size:1
}
]);
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I added a language selection to the "New Project"-wizard. Depending on what you choose you will code in only that language.
You may notice that the JavaScript says "FMCS Edition". This just means that it isn't the default ECMAScript you would encounter in web or some servers.
It is basically just Lua with curly-brackets-syntax and some syntactic features like "continue" or at a later version "switch-case".
It can access all Lua functions and has no functions on its own. If you have some self-written libraries in Lua you can still import them into your project and acces all of its functions from JavaScript.
You may notice that the JavaScript says "FMCS Edition". This just means that it isn't the default ECMAScript you would encounter in web or some servers.
It is basically just Lua with curly-brackets-syntax and some syntactic features like "continue" or at a later version "switch-case".
It can access all Lua functions and has no functions on its own. If you have some self-written libraries in Lua you can still import them into your project and acces all of its functions from JavaScript.
- Attachments
-
- fmcs-016.jpg (108.31 KiB) Viewed 12500 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
For everyone interested: I pushed the first source code to the github repo.
https://github.com/RalleYTN/Factorio-Mod-Creator-Studio
https://github.com/RalleYTN/Factorio-Mod-Creator-Studio
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I implemented a really primitive LuaParser now which allows me to highlight errors in the syntax.
- Attachments
-
- ergebnis.jpg (54.6 KiB) Viewed 12408 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
It's looking like you're trying to bump this topic and get it to the current new/active thread listing on the main forums page, don't do that. Currently there are 26 posts to this topic, 24 are from you. If you make a daily report that's fine, but don't publish your progress every few hours just to get more visitors.
See my answer below.
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Well, they do seem like legitimate development reports to me...daniel34 wrote:You've been replying 6 times today already to this topic, without any other user replying inbetween.
It's looking like you're trying to bump this topic and get it to the current new/active thread listing on the main forums page, don't do that. Currently there are 26 posts to this topic, 24 are from you. If you make a daily report that's fine, but don't publish your progress every few hours just to get more visitors.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I agree, don't censor the reports.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Does anyone seriously look at the view couter? It may as well not be there.
I just drop by to see how it's going, and leave. No need to post anything.
I just drop by to see how it's going, and leave. No need to post anything.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I'm sorry if that came on rude, but on the Steam forums (where I also moderate) we don't like repeated bumps to existing posts, and even on this forums repeat posts (3-4 posts in a row) have been reprimanded in the past. I do like this project and where it is going, and RalleYTN is showing new ideas (a difference from the usual bump posts), so I agree with you all and I'm sorry I did write my last post so harsh, you (RalleYTN) are free to continue posting your development reports if the community likes them.
My only issue is that apart from prq (who gave him some hints) none of you acknowledged his work by posting and my thought was you're not interested in it. Imagine a thread where 24 of 26 posts (within one week) are OP's posts - you'd check that out. That's what I did and I apparently came to the wrong conclusion. I'm sorry. Please continue writing your development reports for us, I can't wait to see the finished product.
My only issue is that apart from prq (who gave him some hints) none of you acknowledged his work by posting and my thought was you're not interested in it. Imagine a thread where 24 of 26 posts (within one week) are OP's posts - you'd check that out. That's what I did and I apparently came to the wrong conclusion. I'm sorry. Please continue writing your development reports for us, I can't wait to see the finished product.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I'm not trying to bump. Everytime I make a goal I just say: "look! I made dis!"daniel34 wrote:I'm sorry if that came on rude, but on the Steam forums (where I also moderate) we don't like repeated bumps to existing posts, and even on this forums repeat posts (3-4 posts in a row) have been reprimanded in the past. I do like this project and where it is going, and RalleYTN is showing new ideas (a difference from the usual bump posts), so I agree with you all and I'm sorry I did write my last post so harsh, you (RalleYTN) are free to continue posting your development reports if the community likes them.
My only issue is that apart from prq (who gave him some hints) none of you acknowledged his work by posting and my thought was you're not interested in it. Imagine a thread where 24 of 26 posts (within one week) are OP's posts - you'd check that out. That's what I did and I apparently came to the wrong conclusion. I'm sorry. Please continue writing your development reports for us, I can't wait to see the finished product.
sometimes I ask questions or just talk about what wanders my mind. but its always on topic.
I'm happy to see that people actually replyied to this topic.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
So. I tuned the Lua Parser a bit. I am now able to to through Lua code step by step (meaning getting exact locations of functions or if blocks in code). That allows me to check if a function was already declared somewhere else and then mark every new declaration as error. It also allows me to reverse engineer already existing mods into a project file.
I found out how to change the editor theme in RSyntaxTextArea(also found arround 25 other customization options). So It will be possible to set the theme to an editor that you like. Eclipse or VS for example.
Since all the themes get loaded at the beginning and alot of images and later all the auto-completions the start up will be slower. To prevent the user from thinking that nothing happened after starting the application I now show a small splash screen.
I found out how to change the editor theme in RSyntaxTextArea(also found arround 25 other customization options). So It will be possible to set the theme to an editor that you like. Eclipse or VS for example.
Since all the themes get loaded at the beginning and alot of images and later all the auto-completions the start up will be slower. To prevent the user from thinking that nothing happened after starting the application I now show a small splash screen.
- Attachments
-
- fmcs-theme-vs.jpg (45.27 KiB) Viewed 12166 times
-
- fmcs-theme-eclipse.jpg (39.65 KiB) Viewed 12166 times
-
- fmcs-theme-dark.jpg (37.56 KiB) Viewed 12166 times
-
- fmcs-theme-default.jpg (43.35 KiB) Viewed 12166 times
-
- splash.jpg (668.26 KiB) Viewed 12166 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Added spell checking for comments and code folding for Lua block comments(the other stuff doesn't work yet).
PS: ignore tha fact that some of the text is german. some of the UI elements auto-translate to your system language.
PS: ignore tha fact that some of the text is german. some of the UI elements auto-translate to your system language.
- Attachments
-
- spellcheck.jpg (103.13 KiB) Viewed 12160 times
-
- folding.jpg (104.62 KiB) Viewed 12160 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I re-did the menus and converted the button bar to a bar of sub tool bars. this allows you to move some of the button groups arround or detach them completely from the menu bar.
- Attachments
-
- fmcs-toolbars.jpg (61.29 KiB) Viewed 12146 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Seems I can't use LuaJ. It throws the weirdest error messages at me, has big problems with comments, marks the wrong code(usually comments) as error and so on.
that means that I will probably sit at least 3 weeks on writing my own parser.
except someone here has a good Lua 5.2 parser which can be embedded into Java....
seriously, if you have one, give it to me... you save me weeks.
that means that I will probably sit at least 3 weeks on writing my own parser.
except someone here has a good Lua 5.2 parser which can be embedded into Java....
seriously, if you have one, give it to me... you save me weeks.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Current status on the JavaScript to Lua translator:
JavaScript
Resulting Lua Code:
I know it's not correct right now but at least the biggest part is translated.
I will probably have to write a small definition of JavaScript(FMCS Edition) as it too different from normal JavaScript.
JavaScript
Code: Select all
// Line Comment
// Line Comment
var globalVariable = "hi";
function myFunction() { // Line Comment
/**
Block Comment
with
more
lines
*/
var hello = "Hello";
hello = null;
hello = undefined;
if(hello != undefined && hello !== undefined) {
for(var index = 0; index < 10; index++) {
print('Hi');
}
do {
} while(something);
}
}
Code: Select all
-- Line Comment
-- Line Comment
globalVariable = "hi";
function myFunction() -- Line Comment
--[[*
Block Comment
with
more
lines
]]--
local hello = "Hello";
hello = nil;
hello = nil;
if(hello ~= nil and hello ~= nil) then
for(local index = 0; index < 10; index++) {
print('Hi');
}
repeat
until(something);
}
end
I know it's not correct right now but at least the biggest part is translated.
I will probably have to write a small definition of JavaScript(FMCS Edition) as it too different from normal JavaScript.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Custom Libraries are now also shown in the tree. And with them all their child elements.
- Attachments
-
- fmcs-libs.jpg (96.7 KiB) Viewed 12066 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
Hmmm...
- Attachments
-
- 1jj9pw.jpg (55.02 KiB) Viewed 12047 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.
Re: Factorio Mod Creator Studio [IN DEVELOPMENT]
I MADE IT!!!
I made the first big step towards a functional editor.
It is now possible to open things in the project tree with double click!!!
...
...
But it's currently only possible for elements inside of custom libraries
...
And only if these elements are either .lua or .js files.
...
BUT I CAN OPEN THEM!!!
I made the first big step towards a functional editor.
It is now possible to open things in the project tree with double click!!!
...
...
But it's currently only possible for elements inside of custom libraries
...
And only if these elements are either .lua or .js files.
...
BUT I CAN OPEN THEM!!!
- Attachments
-
- fmcs-big-progress.jpg (252.43 KiB) Viewed 12035 times
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: viewtopic.php?f=137&t=40830.
Follow the development here: viewtopic.php?f=137&t=40830.