Jump to content
Svarog

Item and Recipe Script Variables + Brief Description

Recommended Posts

Type = Normal,
There are various types of items in Project Zomobid, below you will se each of them with a short description.
 
Normal – A basic item.
 
Drainable – An item that has a certain amount of uses before it's destroyed
 
Food – An item that can be consumed by the character
 
Weapon – An item that can serve as an equpable weapon.
 
Container – An item that can store other items inside it.
 
Clothing – Item worn by the player character.
 
Literature – A readable item like a book or a newspaper.
 
Weight = 1,
The weight of an item as seen in-game, it should be a sum of weight + size of the item.
Typically used in Item Type: All
 
DisplayName = Example item,
Defines the name of the item as displayed in game
Typically used in Item Type: All
 
Icon = ItemIcon,
Defines the icon the item will have in-game, the .png file of the icon should be in media/textures folder of the mod and the name must look like this Item_ItemIcon.png
Typically used in Item Type: All
 
UseDelta = 0.1,
Defines how many uses a Drainable item has, if it's 0.1 the item will have 10 uses before it's depleted.
Typically used in Item Type: Drainable
 
Capacity = 20,
Defines the maximum carrying capacity of the container.
Typically used with item Type: Container
 
CanBeEquipped = Back,
Defines the clothing slot the item is equipped in, typically only used for containers in the form above.
 
BodyLocation = Bottoms,
Defines what part of the body a Clothing item is worn on. Can be Bottoms, Shoes or Top
 
Temperature = 8,
Defines the temperature resistance a Clothing item gives to the player when worn.
 
CanStoreWater = TRUE/FALSE,
Defines if the item can be used to store water. Defaults to FALSE if not used.
Typically used in Item Type: Drainable
 
IsWaterSource = TRUE/FALSE,
Defines whether or not the item is a source of water. Defaults to FALSE if not used.
Typically used in Item Type: Drainable
 
UseWhileEquipped = TRUE/FALSE,
Defines if the items has to be equipped in Primary or Secondary slot in order to be used. Defaults to FALSE if not used.
 
ReplaceOnDeplete = Module.ItemID,
When the item is depleted (Has no uses left or if you've eaten\drank all of it) it will be replaced by Module.ItemID
 
ReplaceOnUseOn = WaterSource-WaterBottleFull,
If the item is used on something it will turn into something else, in the case above, if used on a Water Source (Item\Water Barrel\River) it will become WaterBottleFull
 
IsCookable = TRUE,
Defnises whether or not the item can be Cooked using Fire Pits, Stoves or BBQ. If the item is cookable and stores water, it can be used to boil it to remove the tainted water effect. Defaults to FALSE if not used.
 
DangerousUncooked = TRUE,
If TRUE, eating the food item without cooking will result in it having a semi-poisonous effect.
 
HungerChange = -20,
Defines how much hunger will be removed upon consumption, if the value is Positive, consuming the item will make the character more hungry.
 
ThirstChange = -20,
Defines how much thirst will be removed upon sonsumption, if the value is Positive, consuming the item will make the character more thirsty.
 
StressChange = -20,
Defines how much stress will be removed upon sonsumption, if the value is Positive, consuming the item will make the character more stressed.
 
UnhappyChange = -20,
Defines how much happiness will be removed upon sonsumption, if the value is Positive, consuming the item will make the character more unhappy.
 
BoredomChange = -20,
Defines how much boredom will be removed upon sonsumption, if the value is Positive, consuming the item will make the character more bored.
 
FatigueChange = -20,
Defines how much fatigue will be removed upon sonsumption, if the value is Positive, consuming the item will make the character more tired.
 
EnduranceChange = 20,
Defines how much endurance will be removed upon sonsumption, if the value is NEGATIVE, consuming the item will make the character more fatigued.
 
Alcoholic = TRUE,
If TRUE consuming the item will make the character drunk. If used for Bandage items, it will act as disinfectant.
 
DaysFresh = 6,
Defines the amount of days before a food item starts to rot.
 
DaysTotallyRotten = 10,
Defines the amount of days before the food item rots completely, becoming poisonous.
 
MinutesToCook = 40,
In-Game Minutes before the item is cooked, use with Cookable = TURE,
 
MinutesToBurn = 110,
In-Game Minutes of Cooking the item before it becomes Burned.
 
Poison = TRUE,
Defnines if the item is poisonous upon consumption.
 
PoisonDetectionLevel = 1,
Unknown, probably defines the difficulty of detecting poison if used in Evolved Recipe.
 
PoisonPower = 5,
Defines the power of poison, the higher the value, the more lethal it is upon consumpion. 5 Is PoisonIvy (White Berry) 45 is Bleach level.
 
UseForPoison = 1,
Unknown, possibly amount of PoisonPower goes into Evolved Recipes.
 
FoodType    =   Fruits,
Unknown, no known use as of Build 32
 
AlwaysWelcomeGift = true,
Unknown, no known use as of Build 32
 
CustomContextMenu   =   Take,
Will replace "Eat" text in the context menu for food items.
 
EvolvedRecipe = Stew:3;Pie:3;Soup:3;Sandwich:3;Salad:3;Roasted Vegetables:3,
Item can be used in Evolved Recipes, in the above case, it could be used in Stew, Pie, Soup, Sandwitch and so on...
 
DisplayCategory = Ammo,
Will be displayed as the item's category, can be anything but custom Categories need a Translation file.
 
CanBandage = true,
If TRUE the item can be used as a Bandage for wounds.
 
BandagePower    =   4,
Defines how good a bandage is, higher values make the bandage last longer before it goes Dirty.
 
ReduceInfectionPower     =   50,
If used, it will reduce infection (NOT Zombie Infection, it reduces regular wound infection, it might slow down zombie infection though, uncofirmed)
 
Tooltip = Tooltip_UseOnHealthPanel,
Will display tooltip if item is moused over in inventory, requires Translation file that defines the text to display.
 
Known Preset Tooltips:
Tooltip_Painkillers,
Tooltip_PillsAntidepressant,
Tooltip_PillsBetablocker,
Tooltip_PillsSleeping,
Tooltip_tissue_tooltip,
Tooltip_IronSight,
Tooltip_Scope,
Tooltip_AmmoStrap,
Tooltip_Sling,
Tooltip_FiberglassStock,
Tooltip_RecoilPad,
Tooltip_Laser,
Tooltip_RedDot,
Tooltip_ChokeTubeFull,
Tooltip_ChokeTubeImproved,
Tooltip_Trap,
Tooltip_Generator,
Tooltip_UseOnHealthPanel,
Tooltip_Vitamins,
 
RequiresEquippedBothHands = TRUE,
If TRUE the item HAS TO be equipped in Both Hands in order to even be carried.
 
TeachedRecipes =   Make Bread Dough,
If Read the item will teach the character how to make Bread Dough, any Recipe name can be used.
Typically used with Literature
 
NumberOfPages = 260,
Defines the number of pages a Skill Book has.
Typically used with Literature Skill Books
 
SkillTrained = Trapping,
Defines what skill the Skill Book gives a multiplier to.
 
LvlSkillTrained = 3,
Minimum skill level required to read the skill book.
 
NumLevelsTrained = 2,
Amount of skill levels the multiplier will apply to beginning with LvlSkillTrainer.
 
CanBeWrite  =   true,
If TRUE the item can be used to write on if the character has a Pencil or Pen
 

Weapon Type Only Below: MELEE/RANGED WEAPONS
 

MinRange = 0.61,

Defines the minimum range at which the weapon is effective, if the target is closer, he will be pushed away. Possibly 1 = 1 tile.

 

MaxRange = 1.5,
Defines the maximum range at which the weapon is effective. Possibly 1 = 1 tile.
 
WeaponSprite = Fireaxe,
Defines the weapon model used.
 
MinAngle = 0.2,
Unsure, defines the angle at which the weapon is effective.
 
HitAngleMod = -30,
Unsure, as above.
 
SwingTime = 3.0,
Defines the default time it will take for the swing animation to play out.
 
MinimumSwingTime = 3.0,
Defines the minimum time it will take to swing the melee weapon, affects the speed of animation and DPS.
 
KnockBackOnNoDeath = TRUE,
If TRUE the weapon will knock back the target if the strike was not lethal.
 
SwingAmountBeforeImpact = 0.002,
Defines the time from start of the swing before it makes an impact.
 
Categories = Axe,
Defines the weapon Category. Can be Blunt, Blade, Axe, Improvised, Unarmed
 
SubCategory = Swinging,
Defines the weapon Sub Category. Can be Swinging, Stab, Firearm
 
ConditionMax = 15,
Defines the maximum durability of the weapon.
 
ConditionLowerChanceOneIn = 30,
Defines the chance for weapon condition to lower when used.
 
SplatNumber = 1,
Unsure, Possible affects how many blood splats comes out after impact.
 
SplatSize = 5,
Unsure, possible affects how much blood comes out with each splat.
 
SplatBloodOnNoDeath = TRUE,
Defines whether or not blood comes out if the strike was not lethal.
 
PushBackMod = 0.3,
Modifies the strength with which the target is pushed back upon impact.
 
MinDamage = 1,
Defines the minimum damage.
 
MaxDamage = 2.5,
Defines the maximum damage.
 
MaxHitCount = 2,
Defines how many targets can be hit with a single attack.
 
DoorDamage = 35,
Defines the amount of damage done to doors. Doors have 100 HP by default.
 
TreeDamage  =   35,
Defines the amount of damage done to trees. Trees have 100HP by default.
 
IdleAnim = Idle_Weapon2,
Defines the idle animation that plays when the character is holding the weapon.
 
SwingAnim = Bat,
Defines the swinging animation that plays when the weapon is used
 
RunAnim = Run_Weapon2,
Defines the animation that plays when the character runs with the weapon.
 
CriticalChance = 20,
Chance to inflict critical, lethal damage upon the target.
 
WeaponWeight = 3,
Higher values cause exertion faster.
 
KnockdownMod = 2,
Defines the knockdown modifier, higher values mean it will be easier to knock the target down.
 
TwoHandWeapon = TRUE,
If true the weapon will be most effective if equipped in both hands.
 
CloseKillMove = Jaw_Stab,
Defines the type of close kill move, used for knives and some other stabbing weapons only.
 
CantAttackWithLowestEndurance = TRUE,
If TRUE the weapon can't be used if the character is under Extreme Exertion moodle.
 
EnduranceMod = 0.5,
Modifies the amount of endurance used up when swinging the weapon. Higher values mean exertion comes on faster.
 
Weapon Type Only Below: RANGED SPECIFIC
Ranged weapons will use a lot of variables, if not all, used by melee weapons, below you will find variables specific for Ranged Weapons, they would probably all work with a melee weapon, you can experiment.
 
AmmoType = BerettaClip,
Defines the type of Ammo being used. To the best of my knowledge, reloading requires .lua code.
 
ImpactSound = null,
Defines the sound created after impact.
 
SwingSound = 9mmShot,
Defines the attack sound.
 
SoundVolume = 75,
Defines the volume of attack sound.
 
ToHitModifier = 1.5,
Unsure, possibly a modifier for a chance to hit the target.
 
NPCSoundBoost = 1.5,
Unknown. No use as of Build 32. Speculated boost to sound if used by NPC so more zombies hear it and come.
 
Ranged = TRUE,
Defines if the weapon is a ranged weapon.
 
ProjectileCount = 1,
Defines the amount of projectiles created by shooting the weapon.
 
ShareDamage = FALSE,
Unknown effect.
 
IsAimedFirearm = TRUE,
Defines if the weapon needs to be aimed.
 
UseEndurance = FALSE,
Defines if using the weapon uses up endurance.
 
MultipleHitConditionAffected = FALSE,
Unknown.
 
SoundRadius = 150,
Defines the sound radius, higher values cause more zombies to hear it from more far away.
 
AimingPerkCritModifier = 10,
Defines Aiming Skill Bonus to Critical Chance
 
AimingPerkRangeModifier = 1.5,
Defines Aiming Skill Bonus to Range.
 
HitChance = 45,
Default chance to hit the target.
 
AimingPerkHitChanceModifier = 15,
Defines Aiming Skill Bonus to Hit Chance.
 
AimingPerkMinAngleModifier = 0.05,
Defines Aiming Skill Bonus to Min Angle.
 
RecoilDelay = 20,
Unsure. Defines time that must pass between shots.
 
SoundGain = 1.5,
Unknown effect.
 
ClipSize = 15,
Maximum amount of ammo that can go into the weapon. Again, .lua code is required for the weapon to be re loadable.
 
ReloadTime = 10,
Defines the time needed for the weapon to be reloaded.
 
AimingTime = 40,
Defines Aiming Difficulty, lower values increase chance to hit with low aiming time.
 
PiercingBullets = TRUE,
If true, multiple objects can be hit by a single projectile if they are in the right angle.
 
Weapon Type Only Below: THROWN SPECIFIC
 
UseSelf = TRUE,
If TRUE the item itself will be used up when attacking.
 
PhysicsObject = Aerosolbomb,
Defines the thrown item sprite.
 
ExplosionPower  =   70,
Defines the power of the explosion created upon impact.
 
ExplosionRange  =   6,
Defines the AoE of the explosion.
 
FirePower  =   97,
Defines the amount of fire that will be created upon impact.
 
FireRange  =   6,
Defines the AoE of fire.
 
triggerExplosionTimer   =   50,
Defines the time before exlosion if placed.
 
ExplosionSound  =   smallExplosion,
Defines the sound of explosion.
 
PlacedSprite = constructedobjects_01_32,
Defines sprite used if the weapon is placed as a trap.

I hope this helps anyone who wants to create their own items for PZ. Remember, this is just a list of variables, don't use all of them, it's not required. Take a look at items.txt and newitems.txt to see what variables are used by what items and base your items off that.
 

Share this post


Link to post
Share on other sites
recipe Recipe Name
Defines the name of the recipe, it will be used in .lua as it serves as recipe ID too.
 
IngredientItemID,
One of Ingredient will be used
 
IngredientItemID=1,
One of Ingredient's UseDelta will be used (If use delta of ingredient item is 0.1 the item will have 9 uses left)
 
keep IngredientItemID,
You will keep Ingredient Item upon recipe's execution.
 
destroy IngredientItemID,
Item will be removed upon recipe's execution.
 
IngredientItemID/IngredientItemID2/IngredientItemID3
Recipe will use IngredientItemID or IngredientItemID2 or IngredientItemID3 and so on...
 
Result:ResultItemID,
Defines the item that will be created upon recipe's execution.
 
SkillRequired:Electricity=2,
Defines the level of skill required to execute the recipe.
 
Known Skills:
Axe
Strength
Cooking
Doctor
Aiming
Reloading
Fishing
PlantScavenging
Farming
Woodwork
BladeMaintenance
BluntMaintenance
Nimble
Sneak
Lightfoot
Blunt
Sprinting
Fitness
Trapping
BladeGuard
BluntGuard
Electricity
 
NeedToBeLearn:true,
If TRUE the recipe will need to be learned by the character in order to be used.
 
CanBeDoneFromFloor:true,
If TRUE the recipe can be executed if required items are on the floor.
 
 
Category:Cooking,
Defines the category used in Crafting UI (Build 32)
 
Known Preset Categories:
Carpentry
Electrical
Cooking
Engineer
Farming
Survivalist
Fishing
Health
Trapper
 
Time:100.0,
Defines time required to complete.
 
OnGiveXP:LuaFunction_OnGiveXP,
Upon execution, this will call a lua function that grant's the character XP points for it's execution.
 
OnCreate:LuaFunction_OnCreate
Calls a .lua function upon execution. The only way to have multiple results is to create a .lua function.
 
For various OnCreate and OnGiveXP .lua functions used see the file below.
 
C:\Steam\steamapps\common\ProjectZomboid\media\lua\server\recipecode.lua

Again, see recipes.txt for examples on how to create a recipe, this just lists various things you can add\use in your recipes.
 
REPAIRING - Below you will find stuff useful in repair scripts.
 
Fixing scripts work almost identically to Recipe scripts.
 
fixing Fix Name
Same as recipe Recipe Name
 
Require : ItemID,
Defines the base item that will be fixed. In needs to have durability. Typically, it will be a weapon.
 
Fixer : ItemID=2; SkillID=2,
Defines the item used for fixing and skill required in order to sue it properly.
 
Fixer : ItemID=4,
Defines the item used for fixing, in this case, 4 of it or it's UseDelta will be used.
 
Fixer : ItemID,
Defines the item used for fixing, 1 will be used.
 

Share this post


Link to post
Share on other sites

Where are item types defined? Can you add different ones?

They're defined in java source code and no, not unless you decompile the source code, add some and recompile it, hoping that process didn't break anything.

You can use DisplayCategory if you want the category to appear different than it is.

Share this post


Link to post
Share on other sites

Really cool list, thank you. Could you also please add the possible (known) Values of each variable as a list?

 

For example: What other translated tooltip options already exist:

 

Tooltip = Tooltip_UseOnHealthPanel,
Will display tooltip if item is moused over in inventory, requires Translation file that defines the text to display.

 

For example the "poisonous when uncooked"-tooltip?

Share this post


Link to post
Share on other sites

Really cool list, thank you. Could you also please add the possible (known) Values of each variable as a list?

 

For example: What other translated tooltip options already exist:

 

Tooltip = Tooltip_UseOnHealthPanel,
Will display tooltip if item is moused over in inventory, requires Translation file that defines the text to display.

 

For example the "poisonous when uncooked"-tooltip?

Sure, I'll try to add them below the variable soon. Thanks for the suggestion.

Also, Dangerous if Uncooked is automatically added as a tooltip if item is DangerousUncooked = TRUE,

 

Edit: I've more\less finished the list now, if I forgot something and you notice it, please do tell.

Share this post


Link to post
Share on other sites

You can use DisplayCategory if you want the category to appear different than it is.

 

Awesome! It works! Thanks for the tip Svarog! I've been hoping to customize the categories in PZ since i first started playing it. The only problem i've ran across is when i try to add an unexisting category: it shows up as IGUI_ItemCat_[my new category]. Do you happen to know if there's any way to prevent this from happening?

Share this post


Link to post
Share on other sites

@lifemare: I bet you need a translation for your new category. I can't look right now, where the vanilla category translations are located.

 

You, sir, should be playing slots in Vegas instead of wasting your time on a noob like me. Excellent bet! Found it at \media\lua\shared\translate\EN\IG_UI_EN.txt. Thank you :)

Share this post


Link to post
Share on other sites
On 28.1.2017 at 9:43 PM, TheLeonBM said:

Weapon parts have the line "MetalValue=". What does this do?

It does give the value of how much metal scrap you get when that item is disassembled.

 

There's also new variables usable for items and recipes

  • Override:true - Overrides the base item or recipe.
  • Obsolete:true - Removes the base item or recipe from the game.

To use variables above, make own script file for override/obsolete items. Use Base module and import your mod to the script.

module Base
{
	imports 
	{
	YourMod
	}
  
/************************ Example ************************/
  item Socks
  {
	Count = 2,
	Weight = 0.01,
	Type = Normal,
	DisplayName = ModdedSocks,
	Icon = Socks1
	Override:true,
  }
}

 

Share this post


Link to post
Share on other sites

Is there a way to declare that an item can be used as fuel and how long does it burn?

 

The question is removed ... the answer found here...

 

 

Edited by Nebula

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