Scripts guide/Item Script Parameters
Introduction
Each Item has it's own set of parameters. Depending on the item "Type", different parameters may be required.
Examples:
item FishingRod
{
DisplayName = Fishing Rod,
DisplayCategory = Fishing,
Type = Weapon,
Weight = 0.4,
Icon = FishingRod,
AttachmentType = Shovel,
BaseSpeed = 1.3,
BreakSound = FishingRodBreak,
Categories = Improvised;Blunt,
ConditionLowerChanceOneIn = 1,
ConditionMax = 3,
CritDmgMultiplier = 2,
CriticalChance = 5,
DoorDamage = 1,
DoorHitSound = FishingRodHit,
HitFloorSound = FishingRodHit,
HitSound = FishingRodHit,
IdleAnim = Idle_Weapon2,
KnockBackOnNoDeath = FALSE,
KnockdownMod = 0,
MaxDamage = 0.3,
MaxHitCount = 2,
MaxRange = 1.55,
MinAngle = 0.8,
MinDamage = 0.2,
MinRange = 0.61,
MinimumSwingTime = 2,
PushBackMod = 0.3,
RunAnim = Run_Weapon2,
SplatBloodOnNoDeath = FALSE,
SplatNumber = 1,
SubCategory = Swinging,
SurvivalGear = TRUE,
SwingAmountBeforeImpact = 0.02,
SwingAnim = Bat,
SwingSound = FishingRodSwing,
SwingTime = 2,
TreeDamage = 0,
TwoHandWeapon = TRUE,
WeaponSprite = FishingRod_Modern,
Tags = FishingRod,
OnCreate = Fishing.OnCreateNewFishingRodItem,
}
item Apple
{
DisplayName = Apple,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Apple,
EvolvedRecipe = Cake:16;FruitSalad:8;Pancakes:8;Muffin:8;PieSweet:16;Oatmeal:4;Salad:8,
FoodType = Fruits,
DaysFresh = 5,
DaysTotallyRotten = 8,
HungerChange = -16,
ThirstChange = -7,
Calories = 95,
Carbohydrates = 25.13,
Lipids = 0.31,
Proteins = 0.47,
CustomEatSound = EatingFruit,
StaticModel = Apple_Ground,
WorldStaticModel = Apple_Ground,
}
How params are arranged by "Type" parameter
The following item types exist: Normal, Weapon, Food, Literature, Drainable, Clothing, Container, WeaponPart, Key, Moveable, Radio, AlarmClock, AlarmClockClothing, Map.
Advice: When writing a script for an item, be guided by the scripts of similar items from the vanilla game (or from other mods).
This is not a 100% rule where which parameter can be located. Some parameters may also be in other types. (Also, not all parameters are required!)
Normal
- Alcoholic
- BandagePower
- BrakeForce
- CanBandage
- CanStoreWater
- ChanceToSpawnDamaged
- ColorBlue
- ColorGreen
- ColorRed
- ConditionAffectsCapacity
- ConditionLowerOffroad
- ConditionLowerStandard
- ConditionMax
- Count
- DisplayCategory
- DisplayName
- EngineLoudness
- EquippedNoSprint
- FishingLure
- GunType
- Icon
- ItemWhenDry
- MaxAmmo
- MaxCapacity
- MechanicsItem
- MediaCategory
- Medical
- MetalValue
- OnCreate
- PlaceMultipleSound
- PlaceOneSound
- PrimaryAnimMask
- ProtectFromRainWhenEquipped
- RainFactor
- RemoteController
- ReplaceOnUse
- ReplaceOnUseOn
- ReplaceTypes
- RequiresEquippedBothHands
- SecondaryAnimMask
- SurvivalGear
- SuspensionCompression
- SuspensionDamping
- Tags
- Tooltip
- Trap
- Type
- VehicleType
- Weight
- WetCooldown
- WheelFriction
- WorldStaticModel
Weapon
- AimingPerkCritModifier
- AimingPerkHitChanceModifier
- AimingPerkMinAngleModifier
- AimingPerkRangeModifier
- AimingTime
- AlwaysKnockdown
- AmmoBox
- AmmoType
- AttachmentType
- BaseSpeed
- BreakSound
- BringToBearSound
- CanBePlaced
- CanBeRemote
- CanBeReused
- CantAttackWithLowestEndurance
- Categories
- ClickSound
- ClipSize
- CloseKillMove
- ColorBlue
- ColorGreen
- ColorRed
- ConditionLowerChanceOneIn
- ConditionMax
- Count
- CountDownSound
- CritDmgMultiplier
- CriticalChance
- DamageCategory
- DamageMakeHole
- DisplayCategory
- DisplayName
- DoorDamage
- DoorHitSound
- EjectAmmoSound
- EjectAmmoStartSound
- EjectAmmoStopSound
- EnduranceMod
- EquipSound
- EquippedNoSprint
- ExplosionPower
- ExplosionRange
- ExplosionSound
- ExplosionTimer
- ExtraDamage
- FireMode
- FireModePossibilities
- FirePower
- FireRange
- HaveChamber
- HitAngleMod
- HitChance
- HitFloorSound
- HitSound
- Icon
- IdleAnim
- InsertAllBulletsReload
- InsertAmmoSound
- InsertAmmoStartSound
- InsertAmmoStopSound
- IsAimedFirearm
- JamGunChance
- KnockBackOnNoDeath
- KnockdownMod
- MagazineType
- ManuallyRemoveSpentRounds
- MaxAmmo
- MaxDamage
- MaxHitCount
- MaxRange
- MetalValue
- MinAngle
- MinDamage
- MinRange
- MinimumSwingTime
- ModelWeaponPart
- MultipleHitConditionAffected
- NoiseDuration
- NoiseRange
- OnCreate
- OtherHandRequire
- OtherHandUse
- PhysicsObject
- PiercingBullets
- PlacedSprite
- PrimaryAnimMask
- PushBackMod
- RackAfterShoot
- RackSound
- Ranged
- RecoilDelay
- ReloadTime
- RemoteRange
- RequiresEquippedBothHands
- RunAnim
- SecondaryAnimMask
- SensorRange
- ShellFallSound
- SmokeRange
- SoundMap
- SoundRadius
- SoundVolume
- SplatBloodOnNoDeath
- SplatNumber
- SplatSize
- StopPower
- SubCategory
- SwingAmountBeforeImpact
- SwingAnim
- SwingSound
- SwingTime
- Tags
- Tooltip
- TreeDamage
- TriggerExplosionTimer
- TwoHandWeapon
- Type
- UnequipSound
- UseEndurance
- UseSelf
- WeaponLength
- WeaponReloadType
- WeaponSprite
- Weight
Food
- Alcoholic
- BadCold
- BadInMicrowave
- BoredomChange
- Calories
- CannedFood
- CantBeFrozen
- CantEat
- Carbohydrates
- ColorBlue
- ColorGreen
- ColorRed
- CookingSound
- Count
- CustomContextMenu
- CustomEatSound
- DangerousUncooked
- DaysFresh
- DaysTotallyRotten
- DisplayCategory
- DisplayName
- EatType
- EnduranceChange
- EvolvedRecipe
- EvolvedRecipeName
- FatigueChange
- FishingLure
- FluReduction
- FoodType
- GoodHot
- HerbalistType
- HungerChange
- Icon
- IsCookable
- Lipids
- MetalValue
- MinutesToBurn
- MinutesToCook
- OnCooked
- OnCreate
- OnEat
- Packaged
- PainReduction
- Poison
- PoisonDetectionLevel
- PoisonPower
- PrimaryAnimMask
- Proteins
- ReduceFoodSickness
- ReduceInfectionPower
- RemoveNegativeEffectOnCooked
- RemoveUnhappinessWhenCooked
- ReplaceOnCooked
- ReplaceOnRotten
- ReplaceOnUse
- RequireInHandOrInventory
- SecondaryAnimMask
- Spice
- StaticModel
- StressChange
- Tags
- ThirstChange
- Tooltip
- Type
- UnhappyChange
- UseForPoison
- Weight
- WorldStaticModel
Literature
- BoredomChange
- CanBeWrite
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- Icon
- LvlSkillTrained
- NumLevelsTrained
- NumberOfPages
- OnCreate
- PageToWrite
- ReplaceOnUse
- SkillTrained
- StaticModel
- StressChange
- Tags
- TeachedRecipes
- Tooltip
- Type
- UnhappyChange
- Weight
- WorldStaticModel
Drainable
- ActivatedItem
- AlcoholPower
- CanStoreWater
- CantBeConsolided
- ColorBlue
- ColorGreen
- ColorRed
- ConsolidateOption
- Count
- DisplayCategory
- DisplayName
- FillFromDispenserSound
- FillFromTapSound
- HairDye
- Icon
- IsWaterSource
- KeepOnDeplete
- LightDistance
- LightStrength
- MakeUpType
- Medical
- MetalValue
- OnCreate
- PrimaryAnimMask
- ReplaceOnDeplete
- SecondaryAnimMask
- StaticModel
- Tags
- TicksPerEquipUse
- Tooltip
- TorchCone
- TorchDot
- Type
- UseDelta
- UseWhileEquipped
- Weight
- WeightEmpty
Clothing
- AttachmentsProvided
- BiteDefense
- BloodLocation
- BodyLocation
- BulletDefense
- CanHaveHoles
- ChanceToFall
- ClothingExtraSubmenu
- ClothingItem
- ClothingItemExtra
- ClothingItemExtraOption
- ColorBlue
- ColorGreen
- ColorRed
- CombatSpeedModifier
- ConditionAffectsCapacity
- ConditionLowerChanceOneIn
- ConditionMax
- Cosmetic
- Count
- DisplayCategory
- DisplayName
- FabricType
- Icon
- IconsForTexture
- Insulation
- NeckProtectionModifier
- OnCreate
- RemoveOnBroken
- ScratchDefense
- StompPower
- Tags
- Tooltip
- Type
- WaterResistance
- Weight
- WeightWet
- WindResistance
- WorldRender
- WorldStaticModel
Container
- AcceptItemFunction
- AttachmentReplacement
- CanBeEquipped
- CanHaveHoles
- Capacity
- CloseSound
- ClothingItem
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- Icon
- Medical
- MetalValue
- OnCreate
- OnlyAcceptCategory
- OpenSound
- PutInSound
- ReplaceInPrimaryHand
- ReplaceInSecondHand
- RunSpeedModifier
- SoundParameter
- StaticModel
- Tags
- Tooltip
- Type
- Weight
- WeightReduction
- WorldStaticModel
WeaponPart
- AimingTimeModifier
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- HitChanceModifier
- Icon
- MaxRangeModifier
- MetalValue
- MinRangeModifier
- MountOn
- OnCreate
- PartType
- RecoilDelayModifier
- ReloadTimeModifier
- Tags
- Tooltip
- Type
- Weight
- WeightModifier
- WorldStaticModel
Key
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DigitalPadlock
- DisplayCategory
- DisplayName
- Icon
- MetalValue
- Padlock
- Tags
- Tooltip
- Type
- Weight
- WorldStaticModel
Moveable
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- Icon
- Tags
- Tooltip
- Type
- Weight
- WorldObjectSprite
Radio
- AcceptMediaType
- AttachmentType
- BaseVolumeRange
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisappearOnUse
- DisplayCategory
- DisplayName
- Icon
- IsHighTier
- IsPortable
- IsTelevision
- MaxChannel
- MicRange
- MinChannel
- NoTransmit
- OnCreate
- StaticModel
- Tags
- Tooltip
- TransmitRange
- TwoWay
- Type
- UseDelta
- UseWhileEquipped
- UsesBattery
- Weight
- WorldObjectSprite
- WorldStaticModel
AlarmClock
- AlarmSound
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- Icon
- Tags
- Tooltip
- Type
- Weight
- WorldStaticModel
AlarmClockClothing
- AlarmSound
- AttachmentsProvided
- BiteDefense
- BloodLocation
- BodyLocation
- BulletDefense
- CanHaveHoles
- ChanceToFall
- ClothingExtraSubmenu
- ClothingItem
- ClothingItemExtra
- ClothingItemExtraOption
- ColorBlue
- ColorGreen
- ColorRed
- CombatSpeedModifier
- ConditionAffectsCapacity
- ConditionLowerChanceOneIn
- ConditionMax
- Cosmetic
- Count
- DisplayCategory
- DisplayName
- FabricType
- Icon
- IconsForTexture
- Insulation
- NeckProtectionModifier
- OnCreate
- RemoveOnBroken
- ScratchDefense
- StompPower
- Tags
- Tooltip
- Type
- WaterResistance
- Weight
- WeightWet
- WindResistance
- WorldRender
- WorldStaticModel
Map
- ColorBlue
- ColorGreen
- ColorRed
- Count
- DisplayCategory
- DisplayName
- Icon
- Map
- OnCreate
- StaticModel
- Tags
- Tooltip
- Type
- Weight
- WorldStaticModel
All parameters
- AcceptItemFunction
- AcceptMediaType
- ActivatedItem
- AimingMod
- AimingPerkCritModifier
- AimingPerkHitChanceModifier
- AimingPerkMinAngleModifier
- AimingPerkRangeModifier
- AimingTime
- AimingTimeModifier
- AlarmSound
- AlcoholPower
- Alcoholic
- AlwaysKnockdown
- AlwaysWelcomeGift
- AmmoBox
- AmmoType
- AngleFalloff
- AngleModifier
- AttachmentReplacement
- AttachmentType
- AttachmentsProvided
- BadCold
- BadInMicrowave
- BandagePower
- BaseSpeed
- BaseVolumeRange
- BiteDefense
- BloodLocation
- BodyLocation
- BoredomChange
- BrakeForce
- BreakSound
- BringToBearSound
- BulletDefense
- BulletOutSound
- Calories
- CanBandage
- CanBarricade
- CanBeEquipped
- CanBePlaced
- CanBeRemote
- CanBeReused
- CanBeWrite
- CanHaveHoles
- CanStack
- CanStoreWater
- CannedFood
- CantAttackWithLowestEndurance
- CantBeConsolided
- CantBeFrozen
- CantEat
- Capacity
- Carbohydrates
- Categories
- ChanceToFall
- ChanceToSpawnDamaged
- ClickSound
- ClipSize
- ClipSizeModifier
- CloseKillMove
- CloseSound
- ClothingExtraSubmenu
- ClothingItem
- ClothingItemExtra
- ClothingItemExtraOption
- ColorBlue
- ColorGreen
- ColorRed
- CombatSpeedModifier
- ConditionAffectsCapacity
- ConditionLowerChanceOneIn
- ConditionLowerOffroad
- ConditionLowerStandard
- ConditionMax
- ConsolidateOption
- CookingSound
- Cosmetic
- Count
- CountDownSound
- CritDmgMultiplier
- CriticalChance
- CustomContextMenu
- CustomEatSound
- DamageCategory
- DamageMakeHole
- DamageModifier
- DangerousUncooked
- DaysFresh
- DaysTotallyRotten
- DigitalPadlock
- DisappearOnUse
- DisplayCategory
- DisplayName
- DoorDamage
- DoorHitSound
- EatType
- EjectAmmoSound
- EjectAmmoStartSound
- EjectAmmoStopSound
- EnduranceChange
- EnduranceMod
- EngineLoudness
- EquipSound
- EquippedNoSprint
- EvolvedRecipe
- EvolvedRecipeName
- ExplosionPower
- ExplosionRange
- ExplosionSound
- ExplosionTimer
- ExtraDamage
- FabricType
- FatigueChange
- FillFromDispenserSound
- FillFromTapSound
- FireMode
- FireModePossibilities
- FirePower
- FireRange
- FishingLure
- FluReduction
- FoodType
- GoodHot
- GunType
- HairDye
- HaveChamber
- HerbalistType
- HitAngleMod
- HitChance
- HitChanceModifier
- HitFloorSound
- HitSound
- HungerChange
- Icon
- IconsForTexture
- IdleAnim
- ImpactSound
- InsertAllBulletsReload
- InsertAmmoSound
- InsertAmmoStartSound
- InsertAmmoStopSound
- Insulation
- IsAimedFirearm
- IsAimedHandWeapon
- IsCookable
- IsHighTier
- IsPortable
- IsTelevision
- IsWaterSource
- ItemCapacity
- ItemWhenDry
- JamGunChance
- KeepOnDeplete
- KnockBackOnNoDeath
- KnockdownMod
- LightDistance
- LightStrength
- Lipids
- LvlSkillTrained
- MagazineType
- MakeUpType
- ManuallyRemoveSpentRounds
- Map
- MaxAmmo
- MaxCapacity
- MaxChannel
- MaxDamage
- MaxHitCount
- MaxRange
- MaxRangeModifier
- MechanicsItem
- MediaCategory
- Medical
- MetalValue
- MicRange
- MinAngle
- MinChannel
- MinDamage
- MinRange
- MinRangeModifier
- MinimumSwingTime
- MinutesToBurn
- MinutesToCook
- ModelWeaponPart
- MountOn
- MultipleHitConditionAffected
- NPCSoundBoost
- NeckProtectionModifier
- NoTransmit
- NoiseDuration
- NoiseRange
- NumLevelsTrained
- NumberOfPages
- OBSOLETE
- OnCooked
- OnCreate
- OnEat
- OnlyAcceptCategory
- OpenSound
- OtherCharacterVolumeBoost
- OtherHandRequire
- OtherHandUse
- Packaged
- Padlock
- PageToWrite
- PainReduction
- Palettes
- PalettesStart
- PartType
- PhysicsObject
- PiercingBullets
- PlaceMultipleSound
- PlaceOneSound
- PlacedSprite
- Poison
- PoisonDetectionLevel
- PoisonPower
- PrimaryAnimMask
- PrimaryAnimMaskAttachment
- ProjectileCount
- ProtectFromRainWhenEquipped
- Proteins
- PushBackMod
- PutInSound
- RackAfterShoot
- RackSound
- RainFactor
- RangeFalloff
- Ranged
- RecoilDelay
- RecoilDelayModifier
- ReduceFoodSickness
- ReduceInfectionPower
- ReloadTime
- ReloadTimeModifier
- RemoteController
- RemoteRange
- RemoveNegativeEffectOnCooked
- RemoveOnBroken
- RemoveUnhappinessWhenCooked
- ReplaceInPrimaryHand
- ReplaceInSecondHand
- ReplaceOnCooked
- ReplaceOnDeplete
- ReplaceOnRotten
- ReplaceOnUse
- ReplaceOnUseOn
- ReplaceTypes
- ReplaceWhenUnequip
- RequireInHandOrInventory
- RequiresEquippedBothHands
- RunAnim
- RunSpeedModifier
- ScaleWorldIcon
- ScratchDefense
- SecondaryAnimMask
- SecondaryAnimMaskAttachment
- SensorRange
- ShareDamage
- ShareEndurance
- ShellFallSound
- SkillTrained
- SmokeRange
- SoundGain
- SoundMap
- SoundParameter
- SoundRadius
- SoundVolume
- Spice
- SplatBloodOnNoDeath
- SplatNumber
- SplatSize
- SpriteName
- StaticModel
- StompPower
- StopPower
- StressChange
- SubCategory
- SurvivalGear
- SuspensionCompression
- SuspensionDamping
- SwingAmountBeforeImpact
- SwingAnim
- SwingSound
- SwingTime
- Tags
- TeachedRecipes
- Temperature
- ThirstChange
- TicksPerEquipUse
- ToHitModifier
- Tooltip
- TorchCone
- TorchDot
- TransmitRange
- Trap
- TreeDamage
- TriggerExplosionTimer
- TwoHandWeapon
- TwoWay
- Type
- UnequipSound
- UnhappyChange
- UseDelta
- UseEndurance
- UseForPoison
- UseSelf
- UseWhileEquipped
- UseWhileUnequipped
- UseWorldItem
- UsesBattery
- VehicleType
- WaterResistance
- WeaponLength
- WeaponReloadType
- WeaponSprite
- WeaponWeight
- Weight
- WeightEmpty
- WeightModifier
- WeightReduction
- WeightWet
- Wet
- WetCooldown
- WheelFriction
- WindResistance
- WorldObjectSprite
- WorldRender
- WorldStaticModel
Other params
Any other parameter not in the list will be written as a key-value in the item's ModData. For example: print(item:getModData().MyCustomOption) -> "This is custom label"
MyCustomOption = This is custom label,