[0.2.10] Modloader

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

[0.2.10] Modloader

Post by ficolas »

Well so I have created a modloader, this is more a concept than a mod, because is very short, to use it, you need to do this to your code:

yourmod.lua

Code: Select all

module(..., package.seeall)
function all()
--your code mod goes here
end
And to make it work, you need to place it in the lualib folder, and edit this file:
modlist.lua

Code: Select all

module(..., package.seeall)
require "nameofyourmod"
function all()
	nameofyourmod.all()
end
And adding more than one mods you can do this

Code: Select all

module(..., package.seeall)
require "nameoffirstmod"
require "nameofsecondmod"
function all()
	nameoffirestmod.all()
	nameofsecondmod.all()
end
I will make a java program (yes java, is the language im better at, but if somebody can add this to his mod manager, it would be better) when my computer is fixed (3 weeks...), and I can have the jdk, because I cant download it in this comp.

Also, I know this will be implemented to the game in future updates, but I wanted to do it :), and I will add "APIs" later for easyer things, like "terraforming" for world generation (clearing a land and placing entities), and other stuff to make some modding things easy, another thing I want to say, is that the devs are making modding really good, so not much "APIs" are needed :)

http://rapidshare.com/files/3283273573/ ... %201.1.rar

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [0.2.10] Modloader

Post by drs9999 »

Did you notice that you didnt included the oninit, onsave and onload functions?

Btw. the CC-Mod already use a similar system.

But yeah a programm that do the copy+paste work etc. for you would be pretty well and a must-have in my opinion.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: [0.2.10] Modloader

Post by ficolas »

why should I include those methods?

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [0.2.10] Modloader

Post by drs9999 »

why not? ;)

So I see no reason why to restrict the functions a mod is able/allowed to use.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: [0.2.10] Modloader

Post by ficolas »

the mod can still use those with if event.name==oninit then etc

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [0.2.10] Modloader

Post by drs9999 »

nope. A quick test with

Code: Select all

game.onevent = function(event)
   if event.name =="oninit" then
	  game.getplayer().insert{name="wooden-chest", count=100}
   end

   if event.name =="onload" then
	  game.getplayer().insert{name="wooden-chest", count=100}
   end
end
Dont give me anything after start or load.

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.2.10] Modloader

Post by slpwnd »

Actually we really want to have this thing in the game sooner than later :) Seeing what kind of crazy mods you guys are doing even with limited options.

At the moment we are working on enhancing the mod support. Mods as packages should make it into the next release. Mod installation will be a breeze afterwards.

Post Reply

Return to “Modding discussion”