Triggers for custom maps

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Sirre
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Aug 18, 2013 3:26 pm
Contact:

Triggers for custom maps

Post 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

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Triggers for custom maps

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

Sirre
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Aug 18, 2013 3:26 pm
Contact:

Re: Triggers for custom maps

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

grobyc
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Apr 27, 2013 8:49 am
Contact:

Re: Triggers for custom maps

Post by grobyc »

Copy "control.lua" from any savegame to savegame from your map.

Post Reply

Return to “Gameplay Help”