Page 1 of 1

Modding and Scripting additions in 0.4

Posted: Tue May 07, 2013 9:01 pm
by kovarex
Modding
Both of these changes are done in backwards compatible way (uses default fallbacks).
Mod versions are now in format x.y.z
Mods can have dependencies.
More info at https://forums.factorio.com/wiki/inde ... g_overview.

Scripting
Mainly gui elements https://forums.factorio.com/wiki/inde ... GuiElement
Way to make particle/projectile/resource, change amount of resource etc, more here: https://forums.factorio.com/wiki/inde ... ua_objects
You can use the new market (https://forums.factorio.com/wiki/index.php/Lua/Market) entity to offer way to buy items/effects in some custom scenarios.
You can create those flying-texts by script (https://forums.factorio.com/wiki/inde ... FlyingText), this is good for stuff that would be too annoying to write in console.
The onchunkgenerated event.
The game.getrandomnumber was removed, and math.random can be used (it uses our generator instead, you can use all the 3 ways of calling it specified in lua)
If you had some questions, or I forgot to describe something on the wiki, let me please now.

Re: Modding and Scripting additions in 0.4

Posted: Wed May 08, 2013 8:25 am
by rk84
First function for multiplayer :lol:

Code: Select all

function talk(line, colour) --colour as optional
	if colour == nil then
		game.createentity({name="flying-text", position=game.player.character.position, text=line})
	else
		game.createentity({name="flying-text", position=game.player.character.position, text=line, color=colour})
	end
end