Custom Campaigns

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
xZippy
Inserter
Inserter
Posts: 30
Joined: Tue Apr 25, 2017 5:02 pm
Contact:

Custom Campaigns

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

User avatar
QGamer
Fast Inserter
Fast Inserter
Posts: 213
Joined: Fri Apr 14, 2017 9:27 pm
Contact:

Re: Custom Campaigns

Post 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.
"Adam fell that men might be; and men are, that they might have joy."

User avatar
xZippy
Inserter
Inserter
Posts: 30
Joined: Tue Apr 25, 2017 5:02 pm
Contact:

Re: Custom Campaigns

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

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Custom Campaigns

Post 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.
Money might be the root of all evil, but ignorance is the heart.

User avatar
QGamer
Fast Inserter
Fast Inserter
Posts: 213
Joined: Fri Apr 14, 2017 9:27 pm
Contact:

Re: Custom Campaigns

Post 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.
"Adam fell that men might be; and men are, that they might have joy."

User avatar
xZippy
Inserter
Inserter
Posts: 30
Joined: Tue Apr 25, 2017 5:02 pm
Contact:

Re: Custom Campaigns

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

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Custom Campaigns

Post 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.
Money might be the root of all evil, but ignorance is the heart.

User avatar
QGamer
Fast Inserter
Fast Inserter
Posts: 213
Joined: Fri Apr 14, 2017 9:27 pm
Contact:

Re: Custom Campaigns

Post 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.
"Adam fell that men might be; and men are, that they might have joy."

Post Reply

Return to “Ideas and Suggestions”