Page 1 of 1

Custom Campaigns

Posted: Tue Feb 27, 2018 10:24 pm
by xZippy
TL:DR

Add a way for custom campaigns to be made in-game.

What?

Something that can be included in the map editor. Add triggers, inventory counters, etc. so people can make their challenges and campaigns. Maybe even custom campaigns can include the need for more than one player.

Why?

Pretty obvious, so players can experience challenges other people made... Not too far off of what Super Mario Maker, RPG Maker or Adventure Mode in Minecraft is all about. I didn't see any suggestion like this when searching. Half the time searching gave me strange PHP errors.

Re: Custom Campaigns

Posted: Tue Feb 27, 2018 11:48 pm
by QGamer
It is actually possible to make your own scenarios! You can attach lua code to the maps you make. If you open the folder of a scenario you've made, you can see "blueprint.dat" which contains the map itself. If you create a file called "control.lua" and place it in the same folder, the code in that file will be executed when running the scenario. If you can mod with lua and reverse-engineer the already existing campaigns, you should be able to do everything with your scenario that the devs can do.

I'm also 99% sure that if you copy the folder structure used in the base game campaigns, you can make your scenario into a campaign and it will show under the "campaigns" tab (on the new game screen), although I haven't tried it myself.

You can share your scenario with others by making it part of a mod and putting it on the mod portal.

Re: Custom Campaigns

Posted: Wed Feb 28, 2018 12:32 am
by xZippy
That's not very user-friendly if people need to use lua. I meant something that's much more GUI based so almost anyone could get the hang of it.

Re: Custom Campaigns

Posted: Wed Feb 28, 2018 10:39 am
by Deadly-Bagel
Problem with making things GUI-based is restrictions, scripting is infinitely more flexible than a GUI (look at train conditions, and imagine if they could be scripted *drools*) - unfortunately simplicity works both ways.

Re: Custom Campaigns

Posted: Thu Mar 01, 2018 2:24 am
by QGamer
Yes, for a GUI to have all of the power that scripting does it would need to be 1000 times as complex as anything else in the game.
If you ask me, learning how to script with lua is worth the thrill of hitting "Start Scenario" and having things work out.

Re: Custom Campaigns

Posted: Thu Mar 01, 2018 12:36 pm
by xZippy
I accept wholeheartedly the problems a new GUI would cause. Is there tutorials on how to make campaigns or is there only general LUA tutorials that I have to cleverly combine?

Re: Custom Campaigns

Posted: Thu Mar 01, 2018 2:21 pm
by Deadly-Bagel
I wasn't really able to find any tutorial that directly walked you through making a scenario. There's plenty of LUA documentation and guides, and I recommend starting with a few basic mods first to get the hang of it, but other than that you just have to try to reverse-engineer the vanilla Campaigns.

I intend to write a campaign in the near future, if someone hasn't by then I might also write a guide.

Re: Custom Campaigns

Posted: Thu Mar 01, 2018 11:36 pm
by QGamer
There are books and online resources you can use to learn the lua language.

Once you do that, you can visit lua-api.factorio.com/ and select the relevant version (which matches the version you play Factorio on). That website explains all of the different things you can do to manipulate & read game objects, GUIs, etc. You need at least a basic understanding of lua first.

As Deadly-Bagel said, one of the best resources you have is to reverse-engineer the campaigns and scenarios that the devs created.