Page 1 of 1

Triggers for custom maps

Posted: Sun Aug 18, 2013 3:33 pm
by Sirre
Hey guys!

I've been playing Factorio for quite awhile now, but just recently started playing around with the Map Editor.
I was making a map and placed several enemy bases, but these are quite idle when playing the map (except for when you go near them). Thus, I am wondering how to make triggers that will make them attack my base, just like they do in the campaign maps. (I.e. with certain intervals, and with increasing numbers)

Thanks in advance!

Best Regards,
Sirre

Re: Triggers for custom maps

Posted: Sun Aug 18, 2013 3:56 pm
by kovarex
Hello,

the attacking is controlled by the lua script and has to be scripted manually.
If you know lua programming, (or you would like to know), you can take a look to the script of the campaigns level to see

Anyway, in 0.7, we plan that the attacks would be triggered by pollution that the factory generates rather then by the script.

Re: Triggers for custom maps

Posted: Sun Aug 18, 2013 6:22 pm
by Sirre
Thanks for your relpy!

Unfortunately I'm not used to lua programming (I have however worked with programming before, such as C++ and Java), but is it the control.lua file that you are referring to? Should I simply create a file like that in the map folder for my custom map?

I looked on the code for one of the campaign maps, but there were quite alot of lines, I'm not sure what's the least amount of code I need for just making them attack...
kovarex wrote:Anyway, in 0.7, we plan that the attacks would be triggered by pollution that the factory generates rather then by the script.
That sounds interesting! But is 0.7 planned to be released soon? Or should I try to make them attack me by lua code while I wait for 0.7?

Re: Triggers for custom maps

Posted: Sun Aug 18, 2013 10:19 pm
by grobyc
Copy "control.lua" from any savegame to savegame from your map.