Jump to content

Neat Lua code


Maris

Recommended Posts

For example, ClothingRecipesDefinitions.lua by now:

ClothingRecipesDefinitions = {};

ClothingRecipesDefinitions["Sheet"] = {materials="Base.RippedSheets:4" }
--ClothingRecipesDefinitions["Belt2"] = {materials="Base.LeatherStrips:1"}


ClothingRecipesDefinitions["FabricType"] = {}
ClothingRecipesDefinitions["FabricType"]["Cotton"] = {};
ClothingRecipesDefinitions["FabricType"]["Cotton"].material = "Base.RippedSheets";

ClothingRecipesDefinitions["FabricType"]["Denim"] = {};
ClothingRecipesDefinitions["FabricType"]["Denim"].material = "Base.DenimStrips";
ClothingRecipesDefinitions["FabricType"]["Denim"].tools = "Base.Scissors";
ClothingRecipesDefinitions["FabricType"]["Denim"].noSheetRope = true;

ClothingRecipesDefinitions["FabricType"]["Leather"] = {}
ClothingRecipesDefinitions["FabricType"]["Leather"].material = "Base.LeatherStrips";
ClothingRecipesDefinitions["FabricType"]["Leather"].tools = "Base.Scissors";
ClothingRecipesDefinitions["FabricType"]["Leather"].noSheetRope = true;

 

Should be:

ClothingRecipesDefinitions = {
  Sheet = { materials="Base.RippedSheets:4" },
  --Belt2 = { materials="Base.LeatherStrips:1" },
  
  FabricType = {
    Cotton = {
      material = "Base.RippedSheets",
    },
    Denim = {
      material = "Base.DenimStrips",
      tools = "Base.Scissors",
      noSheetRope = true,
    },
    Leather = {
      material = "Base.LeatherStrips",
      tools = "Base.Scissors",
      noSheetRope = true,
    },
  },
};

 

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...