Add blueprint via mod?

Place to get help with not working mods / modding interface.
Post Reply
deer_buster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Wed Aug 31, 2016 3:35 am
Contact:

Add blueprint via mod?

Post by deer_buster »

I "think" it can be done, but is there any way to provide a specific blueprint to the player via a mod?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Add blueprint via mod?

Post by DaveMcW »

Code: Select all

/c log(serpent.dump(game.player.cursor_stack.get_blueprint_entities()))
This dumps the blueprint source code to your log file. Then you can paste the source code into your mod.

Code: Select all

blueprint.set_blueprint_entities({{entity_number=...)

deer_buster
Fast Inserter
Fast Inserter
Posts: 109
Joined: Wed Aug 31, 2016 3:35 am
Contact:

Re: Add blueprint via mod?

Post by deer_buster »

that will be a huge mess. Can I do something with like a .dat file?

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Add blueprint via mod?

Post by Nexela »

http://lua-api.factorio.com/latest/LuaItemStack.html
import_stack and export_stack

As well as manually building blueprints with set_/get_blueprint_entities()

Post Reply

Return to “Modding help”