Jump to content

double entries in /scripts/*.txt necessary?


The_Real_Al

Recommended Posts

Hello there

 

I'm dabbling a bit with food items and recipes and ran into a quirk i cannot resolve:

 

When i write a recipe using items from the farming.txt they don't show up in the context menu unless i copy that item into my custom txt-file as well. I read somewhere about adding 'imports { farming }' but that did no good.

 

 module TPG{    imports    {        Base, farming    }/** ================================================ **//**             New Food Items                        **//** ================================================ **/    item Pasta    {        Type                =    Food,        DisplayName            =    Dry Pasta,        Weight                =    0.5,        HungerChange        =    -10,        BoredomChange        =    0,        UnhappyChange        =    20,        StressChange        =    0,        ThirstChange        =    20,        Icon                =    Crisps4,    }        item Rice    {        Type                =    Food,        DisplayName            =    Dry Rice,        Weight                =    0.5,        HungerChange        =    -10,        BoredomChange        =    0,        UnhappyChange        =    20,        StressChange        =    0,        ThirstChange        =    20,        Icon                =    Crisps3,    }    item Cream    {        Type                =    Food,          DisplayName            =    Cream,          Weight                =    1.0,        HungerChange        =    -20,        BoredomChange        =    0,        UnhappyChange        =    10,        StressChange        =    0,        ThirstChange        =    10,          DaysFresh             =    8,          DaysTotallyRotten     =    16,        Icon                =    Milk,    }/** ================================================ **//**              Items Pots                            **//** ================================================ **/    item CarbonaraPot    {        DisplayName            =    Gooey Carbonara,        Type                =    Food,        Weight                =    5,        HungerChange        =    -80,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    20,        DangerousUncooked    =    TRUE,        IsCookable            =    TRUE,        MinutesToCook        =    30,        MinutesToBurn        =    60,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Pot,        Icon                =    PotFull,    }    item NapoliPot    {        DisplayName            =    Pasta Napoli,        Type                =    Food,        Weight                =    5,        HungerChange        =    -80,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    20,        DangerousUncooked    =    FALSE,        IsCookable            =    TRUE,        MinutesToCook        =    30,        MinutesToBurn        =    60,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Pot,        Icon                =    PotFull,    }    item MacAndCheesePot    {        DisplayName            =    Mac and Cheese,        Type                =    Food,        Weight                =    5,        HungerChange        =    -80,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    20,        DangerousUncooked    =    FALSE,        IsCookable            =    TRUE,        MinutesToCook        =    20,        MinutesToBurn        =    40,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Pot,        Icon                =    PotFull,    }    item RisottoPot    {        DisplayName            =    Risotto,        Type                =    Food,        Weight                =    5,        HungerChange        =    -80,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    20,        DangerousUncooked    =    FALSE,        IsCookable            =    TRUE,        MinutesToCook        =    30,        MinutesToBurn        =    60,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Pot,        Icon                =    PotFull,    }    /** ================================================ **//**              Items Bowls                        **//** ================================================ **/    item CarbonaraBowl    {        DisplayName            =    Bowl of Carbonara,        Type                =    Food,        Weight                =    1,        HungerChange        =    -20,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    5,        DangerousUncooked    =    TRUE,        IsCookable            =    TRUE,        MinutesToCook        =    25,        MinutesToBurn        =    50,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Bowl,        Icon                =    BowlFull,    }        item NapoliBowl    {        DisplayName            =    Bowl of Napoli,        Type                =    Food,        Weight                =    1,        HungerChange        =    -20,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    5,        DangerousUncooked    =    FALSE,        IsCookable            =    TRUE,        MinutesToCook        =    25,        MinutesToBurn        =    50,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Bowl,        Icon                =    BowlFull,    }    item MacAndCheeseBowl    {        DisplayName            =    Bowl of Mac and Cheese,        Type                =    Food,        Weight                =    1,        HungerChange        =    -20,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    5,        DangerousUncooked    =    TRUE,        IsCookable            =    TRUE,        MinutesToCook        =    25,        MinutesToBurn        =    50,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Bowl,        Icon                =    BowlFull,    }    item RisottoBowl    {        DisplayName            =    Bowl of Risotto,        Type                =    Food,        Weight                =    1,        HungerChange        =    -20,        BoredomChange        =    0,        UnhappyChange        =    0,        StressChange        =    0,        ThirstChange        =    5,        DangerousUncooked    =    TRUE,        IsCookable            =    TRUE,        MinutesToCook        =    25,        MinutesToBurn        =    50,        DaysTotallyRotten    =    4,        DaysFresh            =    2,        ReplaceOnUse        =    Bowl,        Icon                =    BowlFull,    }    /** ================================================ **//**              Recipes Pots                        **//** ================================================ **/    recipe Pasta Carbonara    {        destroy Pot,        Pasta,        Egg,        Cream,        Water    =    2,                Result:CarbonaraPot,        Time:60.0,    }    recipe Pasta Napoli    {        destroy Pot,        Pasta,        Tomato    =    2,        Water    =    3,                Result:NapoliPot,        Time:60.0,    }    recipe Mac and Cheese    {        destroy Pot,        Pasta,        Cheese,        Water    =    2,                Result:MacAndCheesePot,        Time:40.0,    }    recipe Risotto    {        destroy Pot,        Rice,        Butter,        Broccoli/Carrots/Peas,        Water    =    2,                Result:RisottoPot,        Time:60.0,    }/** ================================================ **//**              Recipes Bowls                         **//** ================================================ **/    recipe Serve Bowl of Carbonara    {        CarbonaraPot,        Bowl=4,            Result:CarbonaraBowl=4,        Time:80.0,    }    recipe Serve Bowl of Napoli    {        NapoliPot,        Bowl=4,            Result:NapoliBowl=4,        Time:80.0,    }    recipe Serve Mac and Cheese    {        MacAndCheesePot,        Bowl=4,            Result:MacAndCheeseBowl=4,        Time:80.0,    }    recipe Serve Risotto    {        RisottoPot,        Bowl=4,            Result:RisottoBowl=4,        Time:80.0,    }}

 

 

The recipes show up in the context menu as supposed to except for Pasta and Tomato. As soon as i insert the Tomato-item everything works just fine.

 

On a similar note, Craft Helper only shows the recipe by the same means. Also if i only have the one recipe with Tomato then it works as well.

 

I don't mind having the duplicate entry in the file, yet i'm not sure if it might cause any trouble?

Link to comment
Share on other sites

Yeah that seems odd - I had the same problem but adding the module to my imports seem to fix it.  With items you can reference other modules in the item def it seems, like AmmoType: Base.9mmRounds - but not for recipes.  I don't see anything off with your imports statement though.

Link to comment
Share on other sites

Well, at least i can tell what's not helping. Didn't even occur to me to write it like 'farming.Tomato=2' and - as you said - it didn't work.

Also copying the Pasta-item twice and assigning each recipe its own didn't.

Still, is there a problem with having the same item in different modules as long as the code is the same?

Link to comment
Share on other sites

One of the devs would know much more - the only thing I can think of is that the Inventory might confuse the two.  So if I have "Base.Tomato" and your recipe is looking for "TPG.Tomato" - it might not work.  But if you can add a Base.Tomato to your inventory and your recipe works, that doesn't seem to be the case (and there is a lot of stuff which is based on Type and not a full object name it seems).

 

Only other issue is maintenance, if the base tomato def changes - obviously you'd have to update your txt file.

Link to comment
Share on other sites

Seems like recipes have some serious issues referencing items from any mod other than the base module.

 

I did some testing:

Flagging my module as 'Base' works perfectly.

Flagging it seperately, however, doesn't allow for recipes to contain items from there and another module.

Moreover, it does work with just one recipe in the whole file.

Link to comment
Share on other sites

Seems like recipes have some serious issues referencing items from any mod other than the base module.

 

I did some testing:

Flagging my module as 'Base' works perfectly.

Flagging it seperately, however, doesn't allow for recipes to contain items from there and another module.

Moreover, it does work with just one recipe in the whole file.

 

Guess I should start posting stuff I find out :D, This is what I was talking about about Module Mods and BaseMod Mods in my mod install instructions post, though I never actually fully explained it.. So your problem explains it for us :).

Link to comment
Share on other sites


Maybe something specific to the farming module?

Had this thought as well. Then i tried to make a recipe referencing an item from a test.txt. Didn't work. Could you kindly post that kindling-recipe?

 


Guess I should start posting stuff I find out.

Most definitely.  Now i get quoted in another topic. What an honor.

But apparently this isn't a fixed rule just yet with two exceptions mentioned above.

 

Btw. i'm running your Pickling Mod. Nice job, if a bit xxl for my taste. Had to cut it down to size for personal use. The site mentioned a 'Toots Food Mod' as prerequisite. I'd like to have a look at it but the link was dead. Any chance you could send me those files?

Link to comment
Share on other sites

Okay this doesn't sound like a general scripting problem. I rather think that you have some kind of typo or even some bad formatting of the script file.

 

What editor do you use to edit the script files? Did you copy and paste the files or did you handwrite them?

I suggest that you cut all recipes and paste them one by one, testing the game each time in between.

 

I'm almost 99% sure that your problems will be solved afterwards ;)

Link to comment
Share on other sites

Yeah, so I start SICitems.txt with this:

module SICmod {			imports	    {	        Base,		camping	    }

And then refer to items from Base a la:

	recipe Bait Rat Trap {	        RatTrapEmpty,			keep Cheese/Chocolate/PeanutButter,	        Result:RatTrapBaited,	        Time:40.0	     }

And from camping:

	recipe Make Small Sticks	  {	    	WoodenStick,			keep Saw/Axe,			Result:FireWoodKit,			Time:80.0,	  }

WoodenStick and FireWoodKit are both from the camping txt.

Link to comment
Share on other sites

Alright found it. Wasn't even my code - tailored with Notepad++ - but something in the guts of the gamefolder. Tried it on a fresh install and voilà. I should really keep a diary of things i edit on the fly.

 

Thanks a bunch and sorry for wasting precious time.

Link to comment
Share on other sites

Alright found it. Wasn't even my code - tailored with Notepad++ - but something in the guts of the gamefolder. Tried it on a fresh install and voilà. I should really keep a diary of things i edit on the fly.

 

Thanks a bunch and sorry for wasting precious time.

 

I can't count the amount of times I've had to do this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...