Jump to content
lance789

[HELP] Mod causes multiple problems when testing.

Recommended Posts

Note: I'm kinda allergic to programming of any kind, though Im trying to make this mod regardless.

 

The MOD: feel free to skip this backstory as its not needed for the help request... just gives some context if wanted...
A few years ago (back in PZ build 36 or 38), I started a mod call Extended Foods Mod (EFM) where I add a bunch of new food items and recipes to PZ so perishables didnt go totally unused. I had help from the community here to get what little I had done then and the mod did work, though I only had a small amount of foods added. I had to drop development of the mod due to college cramming, but now that I've successfully graduated, I can return to the mod. 

 

Side Note: 
When I decided to reboot this mod, I followed a YouTube video to do it: 


The ISSUE(S):
So when running my mod, 1 of several things happens. 
When all files (including back up files and archives) are present in topology, the game does launch where I can:

  1. boot to menu
  2. I can select new game
  3. select sandbox (I'm using settings which disables zombies, makes all loot abundant, removes all locks, removes all alarms, removes heli, and food last longer and degrade slower)
  4. select spawn location
  5. choose professions
  6. build survivor
  7. Go into black loading screen.


...however, its when I click to actually play the game that 1 of 2 things happens:

 

a) the game literally freezes the entire computer, never passing the black click to continue screen, which forces me to power cycle the PC.

 

OR

 

b) the game loads into the map, but the nearly all of the UI is gone EXCEPT for the player inventory panel (other containers nor floor inventories can be accessed).

 

 

1 of these 2 things happens even iff I take out all the fluff files like .BACKUP files and .RARs removed. To simply put, I dont know why the code isnt working.

 

TOPOLOGY

ExtendedFoodsMod41
    > media
        > lua
            > server
                > items
                    > TomatoSoupDistributions.lua
        > scripts
            > EFM.TomatoSoup.txt
        > textures
            
    > mod.info
    > EFM_BANNER.png

 

The CODE
Lets start with just these for now:

 

SCRIPTS > EFM.TomatoSoup.txt

/*
CONTENTS
  ITEMS
    PotOfTomatoSoup
    PotOfTastyTomatoSoup
    TomatoSoupBowl
    TastyTomatoSoupBowl
*/

module EFM
{
  import
  {
    Base
  }

  item PotOfTomatoSoup
  {
    HungerChange                  =    -115,
    ThirstChange                  =    -18,
    Weight                        =    2,
    Type                          =    Food,
    IsCookable                    =    TRUE,
    UnhappyChange                  =    30,
    MinutesToBurn                 =    130,
    DisplayName                   =    Pot of Tomato Soup,
    ReplaceOnUse                  =    Pot,
    Icon                          =    PotFull,
    MinutesToCook                  =    40,
        DaysTotallyRotten          =    6,
        DaysFresh               = 3,
        CustomContextMenu       = Drink,
    CustomEatSound              = EatingSoup,
        Carbohydrates           = 110,
        Proteins                = 12,
        Lipids                  = 0.1,
        Calories                = 600,
        StaticModel             = CookingPot,
        GoodHot                 = true,
        BadCold                 = true,
        WorldStaticModel        = CookingPotSoup_Ground,
        EatType                 = Pot,
        CookingSound            = BoilingFood,
  }

  item PotOfTastyTomatoSoup
  {
    HungerChange                  =    -172,
    ThirstChange                  =    -14,
    Weight                        =    2,
    Type                          =    Food,
    IsCookable                    =    TRUE,
    UnhappyChange                  =    -18,
    MinutesToBurn                  =    130,
    DisplayName                    =    Pot of Tasty Tomato Soup,
    ReplaceOnUse                  =    Pot,
    Icon                          =    PotFull,
    MinutesToCook                  =    48,
        DaysTotallyRotten          =    7,
        DaysFresh               = 5,
        CustomContextMenu       = Drink,
        CustomEatSound          = EatingSoup,
        Carbohydrates           = 120,
        Proteins                = 15,
        Lipids                  = 0.12,
        Calories                = 610,
        StaticModel             = CookingPot,
        GoodHot                 = true,
        BadCold                 = true,
        WorldStaticModel        = CookingPotSoup_Ground,
        EatType                 = Pot,
        CookingSound            = BoilingFood,
  }

  item TomatoSoupBowl
  {
    HungerChange              =    -35,
    ThirstChange            = -15,
    Type                      =    Food,
    DisplayName                =    Bowl of Tomato Soup,
    MinutesToCook              =    15,
    Weight                    =    1,
    Carbohydrates           = 19,
        Proteins            = 2,
        Lipids              = 0.03,
        Calories            = 112,
    IsCookable                =    TRUE,
    DaysTotallyRotten          =    6,
    UnhappyChange              =    -8,
    MinutesToBurn              =    15,
    Icon                      =    BowlFull,
    ReplaceOnUse              =    Bowl,
    DaysFresh                  =    2,
    CustomContextMenu       = Drink,
    CustomEatSound          = EatingSoup,
    GoodHot                 = true,
    BadCold                 = true,
    StaticModel             = Bowl,
    EatType                 = 2handbowl,
    WorldStaticModel        = BowlSoup_Ground,
    CookingSound            = BoilingFood,
  }

  item TastyTomatoSoupBowl
  {
    HungerChange              =    -50,
    ThirstChange            = -15,
    Type                      =    Food,
    DisplayName                =    Bowl of Tasty Tomato Soup,
    MinutesToCook              =    15,
    Weight                    =    1,
    Carbohydrates           = 19,
        Proteins            = 3,
        Lipids              = 0.03,
        Calories            = 110,
    IsCookable                =    FALSE,
    DaysTotallyRotten          =    6,
    UnhappyChange              =    -18,
    MinutesToBurn              =    35,
    Icon                      =    BowlFull,
    ReplaceOnUse              =    Bowl,
    DaysFresh                  =    2,
    CustomContextMenu       = Drink,
    CustomEatSound          = EatingSoup,
    GoodHot                 = true,
    BadCold                 = true,
    StaticModel             = Bowl,
    EatType                 = 2handbowl,
    WorldStaticModel        = BowlSoup_Ground,
    CookingSound            = BoilingFood,
  }

  -- ======================= R E C I P I E S =======================

  recipe Make Pot of Tomato Soup
  {
     CannedTomatoOpen/Tomato=3,
     WaterPot,

     Result:PotOfTomatoSoup,
     Time:130.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.Cooking3,
  }

  recipe Make Pot of Tasty Tomato Soup
  {
     CannedTomatoOpen/Tomato=5,
     WildGarlic,
     WaterPot,

     Result:PotOfTastyTomatoSoup,
     Time:130.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.Cooking3,
  }

  recipe Distribute Bowls of Tomato Soup
  {
       Bowl=5,
       PotOfTomatoSoup,
       keep [Recipe.GetItemTypes.spoon],
       -- keep Pot,

       Result:TomatoSoupBowl=5,
       OnCreate:Recipe.OnCreate.TomatoSoupBowl,
       Time:70.0,
       Category:Cooking,
       -- OnGiveXP:Recipe.OnGiveXP.Cooking3,
  }

  recipe Distribute Bowls of Tasty Tomato Soup
  {
       Bowl=5,
       PotOfTastyTomatoSoup,
       keep [Recipe.GetItemTypes.spoon],
       keep Pot,

       Result:TomatoSoupBowl=5,
       -- OnCreate:Recipe.OnCreate.TastyTomatoSoupBowl,
       Time:70.0,
       Category:Cooking,
       -- OnGiveXP:Recipe.OnGiveXP.Cooking3,
  }

  -- === End of File =======================================
}

 

LUA > TomatoSoupDistributions.lua

Distributions = Distributions or {};

local distributionTable = {

-- =====================
-- TOMATO SOUP
-- =====================

    all = {
        freezer = {
            rolls = 3,
            items = {
                "EFM.TomatoSoupBowl", 0.8,
                "EFM.TastyTomatoSoupBowl", 0.5,
            }
        },
        fridge = {
            rolls = 2,
            items = {
                "EFM.PotOfTomatoSoup", 1,
                "EFM.PotOfTastyTomatoSoup", 3,
                "EFM.TomatoSoupBowl", 3,
                "EFM.TastyTomatoSoupBowl", 2,
            }
        },
        restaurantdisplay = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=20},
            }
        },
        stove = {
            rolls = 1,
            items = {
                "EFM.PotOfTomatoSoup", 2,
                "EFM.PotOfTastyTomatoSoup", 2,
            }
        },
    },

    breakroom = {
        counter = {
            procedural = true,
            procList = {
                {name="BreakRoomCounter", min=0, max=99},
            }
        },
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=8},
                {name="EFM.TomatoSoupBowl", min=0, max=10},
            }
        },
    },

    burgerkitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=20},
            }
        },
    },

    cafe = {
        isShop = true,
        displaycase = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=2, weightChance=10},
            }
        }
    },

    cafekitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
            }
        },
    },

    conveniencestore = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=7},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
    },

    cornerstore = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=7},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
    },

    dinerkitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=7},
            }
        },
    },

    fossoil = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
            }
        },
    },

    gasstore = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
            }
        },
    },

    generalstore = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
    },

    generalstorestorage = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
    },

    gigamart = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
            }
        },
    },

    gigamartkitchen = {
        isShop = true,
        counter = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
            }
        }
    },

    grocery = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
    },

    grocerystorage = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=15},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=25},
            }
        },
    },

    jayschicken_kitchen = {
        isShop = true,
        restaurantdisplay = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=30},
            }
        },
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=25},
            }
        },
    },

    kitchen_crepe = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=25},
            }
        },
    },

    motelroomoccupied = {
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=20},
            }
        },
    },

    pizzakitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.PotOfTomatoSoup", min=0, max=99, weightChance=10},
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
                {name="EFM.TomatoSoupBowl", min=0, max=99, weightChance=15},
            }
        },
        displaycase = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
            }
        },
        restaurantdisplay = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=30},
            }
        },
    },

    restaurant = {
        counter = {
            rolls = 0,
            items = {

            }
        },
        displaycase = {
            procedural = true,
            procList = {
                {name="EFM.TastyTomatoSoupBowl", min=0, max=99, weightChance=10},
            }
        },
    },

    restaurantkitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=40},
            }
        },
    },

    spiffoskitchen = {
        isShop = true,
        fridge = {
            procedural = true,
            procList = {
                {name="EFM.PotOfTastyTomatoSoup", min=0, max=99, weightChance=15},
            }
        },
    },

    Lunchbox = {
        rolls = 4,
        items = {
            "EFM.TomatoSoupBowl", 3,
            "EFM.TastyTomatoSoupBowl", 1,
        }
    },

    Lunchbox2 = {
        rolls = 4,
        items = {
            "EFM.TomatoSoupBowl", 2,
            "EFM.TastyTomatoSoupBowl", 3,
        }
    },


table.insert(Distributions, 1, distributionTable);

--for mod compat:
SuburbsDistributions = distributionTable;
}

 

Edited by lance789

Share this post


Link to post
Share on other sites

So I have added to the Soup.txt (added recipes)

Here's the full code with additions:
 

/*
CONTENTS
  ITEMS
    PotOfTomatoSoup
    PotOfTastyTomatoSoup
    TomatoSoupBowl
    TastyTomatoSoupBowl
*/

module EFM
{
  import
  {
    Base
  }

  item PotOfTomatoSoup
    {
        HungerChange  	            =	-115,
    ThirstChange  	            =	-18,
    Weight        	            =	2,
    Type          	            =	Food,
    IsCookable    	            =	TRUE,
    UnhappyChange	              =	30,
    MinutesToBurn 	            =	130,
    DisplayName   	            =	Pot of Tomato Soup,
    ReplaceOnUse  	            =	Pot,
    Icon                      	=	PotFull,
    MinutesToCook	              =	40,
        DaysTotallyRotten	      =	6,
        DaysFresh               = 3,
        CustomContextMenu       = Drink,
    CustomEatSound              = EatingSoup,
        Carbohydrates           = 110,
        Proteins                = 12,
        Lipids                  = 0.1,
        Calories                = 600,
        StaticModel             = CookingPot,
        GoodHot                 = true,
        BadCold                 = true,
        WorldStaticModel        = CookingPotSoup_Ground,
        EatType                 = Pot,
        CookingSound            = BoilingFood,
    }

  item PotOfTastyTomatoSoup
  {
    HungerChange	              =	-172,
    ThirstChange	              =	-14,
    Weight	                    =	2,
    Type	                      =	Food,
    IsCookable	                =	TRUE,
    UnhappyChange	              =	-18,
    MinutesToBurn	              =	130,
    DisplayName	                =	Pot of Tasty Tomato Soup,
    ReplaceOnUse	              =	Pot,
    Icon	                      =	PotFull,
    MinutesToCook	              =	48,
        DaysTotallyRotten	      =	7,
        DaysFresh               = 5,
        CustomContextMenu       = Drink,
        CustomEatSound          = EatingSoup,
        Carbohydrates           = 120,
        Proteins                = 15,
        Lipids                  = 0.12,
        Calories                = 610,
        StaticModel             = CookingPot,
        GoodHot                 = true,
        BadCold                 = true,
        WorldStaticModel        = CookingPotSoup_Ground,
        EatType                 = Pot,
        CookingSound            = BoilingFood,
  }

  item TomatoSoupBowl
  {
    HungerChange	          =	-35,
    ThirstChange            = -15,
    Type	                  =	Food,
    DisplayName	            =	Bowl of Tomato Soup,
    MinutesToCook	          =	15,
    Weight	                =	1,
    Carbohydrates           = 19,
        Proteins            = 2,
        Lipids              = 0.03,
        Calories            = 112,
    IsCookable	            =	TRUE,
    DaysTotallyRotten	      =	6,
    UnhappyChange	          =	-8,
    MinutesToBurn	          =	15,
    Icon	                  =	BowlFull,
    ReplaceOnUse	          =	Bowl,
    DaysFresh	              =	2,
    CustomContextMenu       = Drink,
    CustomEatSound          = EatingSoup,
    GoodHot                 = true,
    BadCold                 = true,
    StaticModel             = Bowl,
    EatType                 = 2handbowl,
    WorldStaticModel        = BowlSoup_Ground,
    CookingSound            = BoilingFood,
  }

  item TastyTomatoSoupBowl
  {
    HungerChange	          =	-50,
    ThirstChange            = -15,
    Type	                  =	Food,
    DisplayName	            =	Bowl of Tasty Tomato Soup,
    MinutesToCook	          =	15,
    Weight	                =	1,
    Carbohydrates           = 19,
        Proteins            = 3,
        Lipids              = 0.03,
        Calories            = 110,
    IsCookable	            =	FALSE,
    DaysTotallyRotten	      =	6,
    UnhappyChange	          =	-18,
    MinutesToBurn	          =	35,
    Icon	                  =	BowlFull,
    ReplaceOnUse	          =	Bowl,
    DaysFresh	              =	2,
    CustomContextMenu       = Drink,
    CustomEatSound          = EatingSoup,
    GoodHot                 = true,
    BadCold                 = true,
    StaticModel             = Bowl,
    EatType                 = 2handbowl,
    WorldStaticModel        = BowlSoup_Ground,
    CookingSound            = BoilingFood,
  }

  -- ======================= R E C I P I E S =======================

  recipe Make Pot of Tomato Soup
  {
     CannedTomatoOpen/Tomato=3,
     WaterPot,

     Result:PotOfTomatoSoup,
     OnCreate:Recipe.OnCreate.PotOfTomatoSoup,
     Time:130.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.Cooking8,
  }

  recipe Make Pot of Tasty Tomato Soup
  {
     CannedTomatoOpen/Tomato=5,
     WildGarlic,
     OnionSlices,
     ButterCube,
     WaterPot,

     Result:PotOfTastyTomatoSoup,
     OnCreate:Recipe.OnCreate.PotOfTastyTomatoSoup,
     Time:150.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.Cooking20,
  }

  recipe Distribute Bowls of Tomato Soup
  {
       Bowl=5,
       PotOfTomatoSoup,
       keep [Recipe.GetItemTypes.spoon],
       -- keep Pot,

       Result:TomatoSoupBowl=5,
       OnCreate:Recipe.OnCreate.TomatoSoupBowl,
       Time:70.0,
       Category:Cooking,
       OnGiveXP:Recipe.OnGiveXP.None,
  }

  recipe Distribute Bowls of Tasty Tomato Soup
  {
       Bowl=5,
       PotOfTastyTomatoSoup,
       keep [Recipe.GetItemTypes.spoon],
       keep Pot,

       Result:TomatoSoupBowl=5,
       OnCreate:Recipe.OnCreate.TastyTomatoSoupBowl,
       Time:70.0,
       Category:Cooking,
       OnGiveXP:Recipe.OnGiveXP.None,
  }

  recipe Merge Bowls of Tomato Soup
  {
     Pot,
     TomatoSoupBowl=5,
     keep Spoon,

     Result:PotOfTomatoSoup,
     Result:Bowl=5,
     OnCreate:Recipe.OnCreate.PotOfTomatoSoup,
     Time:15.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.None,
  }

  recipe Merge Bowls of Tasty Tomato Soup
  {
     Pot,
     TomatoSoupBowl=5,
     keep Spoon,

     Result:PotOfTastyTomatoSoup,
     Result:Bowl=5,
     OnCreate:Recipe.OnCreate.PotOfTastyTomatoSoup,
     Time:15.0,
     Category:Cooking,
     OnGiveXP:Recipe.OnGiveXP.None,
  }

  -- === End of File =======================================
}

 

Share this post


Link to post
Share on other sites

Well, the game has changed significantly since B36 or even B38. Bringing an outdated and unfinished mod could be more problematic I guess. How old is the video that you've followed? (note: no idea about anything mod-related myself)

Share this post


Link to post
Share on other sites

On 10/25/2021 at 8:32 AM, Pandorea said:

Well, the game has changed significantly since B36 or even B38. Bringing an outdated and unfinished mod could be more problematic I guess. How old is the video that you've followed? (note: no idea about anything mod-related myself)

Th vid i followed is about a year old, and the code Im using to revive this mod is based on the build 41 code from the new item.txt and the distribution LUA.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...