i've made a mod that adds magazines that allow you to learn certain unlearnable recipes, and a trait. the code itself is not complicated, as i've essentially ripped off pre-existing code from the base game.
here's the media/scripts item .txt
module MagItems
{
item NutMag
{
Weight = 0.1,
Type = Literature,
DisplayName = The Nutritionist,
Icon = MagazineNutritionist,
TeachedRecipes = Nutritionist,
ReplaceOnUse = NutMag,
}
item BigBookOfBangs
{
Weight = 0.1,
Type = Literature,
DisplayName = Big Book of Bangs,
Icon = MagazineBoom,
TeachedRecipes = Make Flame bomb;Make Aerosol bomb;Make Pipe bomb,
ReplaceOnUse = BigBookOfBangs,
}
}
and here's the media/lua/server distribution file
require 'Items/SuburbsDistributions';
table.insert(SuburbsDistributions["zippeestore"]["shelvesmag"].items, "NutMag");
table.insert(SuburbsDistributions["zippeestore"]["shelvesmag"].items, 0.2);
table.insert(SuburbsDistributions["all"]["postbox"].items, "NutMag");
table.insert(SuburbsDistributions["all"]["postbox"].items, 0.1);
table.insert(SuburbsDistributions["all"]["crate"].items, "NutMag");
table.insert(SuburbsDistributions["all"]["crate"].items, 100);
table.insert(SuburbsDistributions["all"]["crate"].items, "BigBookOfBangs");
table.insert(SuburbsDistributions["all"]["crate"].items, 100);
table.insert(SuburbsDistributions["zippeestore"]["shelvesmag"].items, "BigBookOfBangs");
table.insert(SuburbsDistributions["zippeestore"]["shelvesmag"].items, 0.2);
table.insert(SuburbsDistributions["all"]["postbox"].items, "BigBookOfBangs");
table.insert(SuburbsDistributions["all"]["postbox"].items, 0.1);
like i said, simplicity itself. yet nothing i do makes it work. i made them spawn often in crates for debug purposes. i'd really appreciate some help, i've been working on this for awhile and i'm starting to get pissed off.
More Magazines.zip