Modding and Scripting additions in 0.4

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Modding and Scripting additions in 0.4

Post 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.

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: Modding and Scripting additions in 0.4

Post 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
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

Post Reply

Return to “Modding discussion”