Page 1 of 1

Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 3:23 am
by silverkitty23
It should be a dirt simple mod, but I don't want to learn Lua just now... the requested mod would do the following things only:

1) change name of tech "Automated Construction" to "Construction Planning"
2) make it cost 100 or 150 red science and NO green science (from 75/75)
3) make it have either no prerequisites or an early prereq like Logistics 1 or Electronics
4) change the cost of blueprints/decon planner from 1 red to 10 green
5) it should not rely on or require any other mod (though I fully intend to use it with the 'Blueprint String' mod) - whether or not you choose to make it compatible with other mod packs like Bob's or whatever is up to you (presumably this wouldn't be too hard, but it depends on how much they changed the resources and tech tree)

That's it. It wouldn't make construction bots earlier or easier - the blueprints would only be for your own planning purposes. You would have to fill them in yourself (or not as you see fit), but at least you could import your blueprint strings and stamp them down to check size/space and plan your early base better.

My apologies if this mod already exists - I did look at *most* of the existing mods already, but I'm sure I missed some.

Using my 30 years of programming experience, 23 of which are professional, I estimate it would take me 2-6 hours to write this mod (since I'd have to learn all the stuff), and I guess it would take Bob about 20 minutes (I'm not tasking Bob to write it, just using him as an example). There's probably(?) no actual coding involved, even, just setting variables (well, probably hash values in existing global variables). But since I don't know which variables/values, I'm up a creek :) I found the docs on which classes and functions exist, but I didn't find a list of existing names of things (like, I could probably figure out how to change some tech in 15-45 minutes, but not how to change a particular existing tech)

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 9:17 am
by prg
Well let's see...
silverkitty23 wrote:1) change name of tech "Automated Construction" to "Construction Planning"
locale/en/en.cfg:

Code: Select all

[technology-name]
automated-construction=Construction planning
silverkitty23 wrote:2) make it cost 100 or 150 red science and NO green science (from 75/75)
data-updates.lua:

Code: Select all

data.raw.technology["automated-construction"].unit={count=100, ingredients={{"science-pack-1", 1}}, time=30}
silverkitty23 wrote:3) make it have either no prerequisites or an early prereq like Logistics 1 or Electronics
data-updates.lua:

Code: Select all

data.raw.technology["automated-construction"].prerequisites={"logistics"}
silverkitty23 wrote:4) change the cost of blueprints/decon planner from 1 red to 10 green
data-updates.lua:

Code: Select all

data.raw.recipe.blueprint.ingredients={{"electronic-circuit", 10}}
silverkitty23 wrote:5) it should not rely on or require any other mod (though I fully intend to use it with the 'Blueprint String' mod) - whether or not you choose to make it compatible with other mod packs like Bob's or whatever is up to you (presumably this wouldn't be too hard, but it depends on how much they changed the resources and tech tree)
This works on its own. Not tested if it breaks other mods.

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 9:44 am
by silverkitty23
You are truly awesome, thanks!

data.raw.recipe.blueprint.ingredients

don't suppose you know the magic name of deconstruction planner that would sub for blueprint in there?
I might hope for "deconstruction-planner" but that would be too easy, no?

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 9:51 am
by prg
That thing is indeed just called deconstruction-planner. But since the name contains a dash, thus rendering it invalid as a Lua identifier, you need to use a different syntax here:

Code: Select all

data.raw.recipe["deconstruction-planner"].ingredients

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 9:59 am
by silverkitty23
Just like javascript. maybe Lua won't be so bad to learn.

Thanks again!

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 10:39 am
by Nebbeh
Nice mod, been searching for something like this! Thanks for the request Silverkitty23 and the mod prg! :D

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 12:34 pm
by ArderBlackard
silverkitty23 wrote:Just like javascript. maybe Lua won't be so bad to learn.
It's much simpler actually. :)

Re: Request for Mod: "Early Blueprints"

Posted: Sat May 14, 2016 12:41 pm
by Sean Mirrsen
Hm. You know, it could be a fun idea to try and make blueprints manually fillable. Click a blueprint ghost, and if you have the requisite item in the inventory you place it down. No robots needed.

...I will feel very silly if that's already how it works. >_>