more lua functionality for mods

Suggestions that have been added to the game.

Moderator: ickputzdirwech

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

more lua functionality for mods

Post by ficolas »

Lua apis that I think that should be added, because they can be very usefull

Calling a lua event from a .json item definition.

Like for example:
when you use item "gift" the event itemused.gift is called

Code: Select all

if event="itemused.gift" then
    i=math.random(1,3)
    if i==1 then
		game.getplayer().insert{name="iron-plate", count=8}
	elseif i==2 then
		game.getplayer().insert{name="inserter", count=4}
	elseif i==3 then
		game.getplayer().insert{name="alien-artifact", count=2}
	end
end
way of adding drop entities to the map (alredy said to kovarex)
rotation of an entity (alredy said to kovarex)
a function to get the cords of all the entitys with that name in the game (alredy sugested to kovarex)

with those three we can create for example a wood farm, that drops wood like the drill, but with wood, and things like that

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: more lua functionality for mods

Post by ssilk »

Necroing.

Unclear what the state of this is. Are there such lua-methods? Is this even possible? Needed?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: more lua functionality for mods

Post by Rseding91 »

ssilk wrote:Necroing.

Unclear what the state of this is. Are there such lua-methods? Is this even possible? Needed?
Everything requested has been added at some point and now exists in 0.11.22.
If you want to get ahold of me I'm almost always on Discord.

Koub
Global Moderator
Global Moderator
Posts: 7226
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: more lua functionality for mods

Post by Koub »

All right then, moved to implemented.
Koub - Please consider English is not my native language.

Post Reply

Return to “Implemented Suggestions”