Jump to content

(Beginner) Why does my recipe break the game?


NeonScorpion

Recommended Posts

first off I'm new to moding and coding. I just got the PC version of 7DTD and found the xml files and found how cool ti was to easily change stuff. I'm doing my best to learn and so to cut my teeth on moding I'm making a few new weapons that are based off Weapon Mods from "Dead Island" such as flaming clubs and knives. I'm currently working inside Valmods Overhaul, but I don't know if that changes anything.

 

So far I added my new Item, its at the end of the Item file with a unique number (3010), its supposed to be a Flaming Club, a Barbed Club that also combines with a torch, giving off light and having a chance to cause "burning". I am still learning so it was a little confusing trying to combine the two items, but this is what I came up with. the game loads to the start menu fine, but I haven't actually started up and played with the item, I moved on to making its recipe. in the item.xml I named it "fireClub" and here is its code, any help on what I did wrong would be great I know i probobly botched it a lot but I don't quite understand why the Torch and Clubs are coded so differently and how I can overlap them to combine them properly. info or code with how I should combine the two items to get what I'm looking for would be appreciated, like I said im new and still trying to understand what stuff means or how it affects the game.

Here is the code for the "fireClub"

<item id="3010" name="fireClub">
<property name="Extends" value="clubIron"/>
<property name="Meshfile" value="Items/Tools/torchPrefab"/>
<property name="RepairTools" value="forgedIron"/>
<property name="EconomicValue" value="224"/>
<property name="SellableToTrader" value="true"/>
<property name="SoundIdle" value="torch_lp"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Stamina_usage" value="6.5"/>
	<property name="Delay" value="1.15"/>
	<property name="Sound_start" value="torch_swoosh"/>
	<property name="Buff" value="burning,bleeding,criticalBlunt"/>
	<property name="Buff_chance" value="0.65,0.3,0.3"/>
	<property name="DamageBonus.head" value="5"/>
</property>
<property class="Attributes">
	<property name="EntityDamage" value="12,22"/>
	<property name="BlockDamage" value="7.2,18"/>
	<property name="DegradationMax" value="250,650"/>
	<property name="DegradationRate" value="1,1"/>
</property>
<property name="CritChance" value="0.3"/>
<property name="Group" value="Ammo/Weapons"/>
<property name="DescriptionKey" value="clubBarbedDesc"/>
<property name="LightValue" value="0.35"/>
<property name="LightSource" value="lightSource"/>
<property name="ActivateObject" value="lightSource"/>
<property name="AlwaysActive" value="true"/>
</item>

 

So I moved onto the recipe, I put it at the bottom of the list, after the last recipe but before </recipes> . I copied another recipe and just replaced some of the values and names to make the recipe rather than retyping it from scratch to minimize the chances of messing up. but for some reason if I save this file after adding this recipe to it my game will start up, then stop loading at "Loading Items" and just never finish. This is the code for the recipe thats supposed to make the above item, what did I do wrong and am I missing something?

<recipe name="fireClub" count="1">
<ingredient name="clubBarbed" count="1"/>
<ingredient name="cloth" count="4"/>
<ingredient name="tallow" count="4"/>
</recipe>

Link to comment
Share on other sites

I loaded up your code in the items.xml and the recipes.xml and got zero errors. Went in game and it worked and was crafted as expected with no problems.

 

Maybe check your logs and see if you accidentally changed something else. One little character missing or in the wrong spot, one little letter or number off and the whole thing won't work.

Link to comment
Share on other sites

i have been able to open the console using F1 when stuck at the loading screen to see the error, and sometimes i even understand it . usually it is a syntax error, as ChocolateDough suggests

Link to comment
Share on other sites

I loaded up your code in the items.xml and the recipes.xml and got zero errors. Went in game and it worked and was crafted as expected with no problems.

 

Maybe check your logs and see if you accidentally changed something else. One little character missing or in the wrong spot, one little letter or number off and the whole thing won't work.

 

Wait it worked?! Woohoo! My first try and it worked! Ok well ill see if im doing something on my end. Thanks for testing it out i didn't know what was wrong. Maybe its because I'm coding within Valmods Overhaul pack? But i didn't think that would make a difference. Who knows. Anyhow thanks for the help!

 

- - - Updated - - -

 

i have been able to open the console using F1 when stuck at the loading screen to see the error, and sometimes i even understand it . usually it is a syntax error, as ChocolateDough suggests

 

Alright Ill try that thank you!

Link to comment
Share on other sites

  • 4 weeks later...
Hey thanks for the mod. How can we add a graphic to the Craft menu and the toolbelt?

 

The quick and dirty way that doesn't require setting up the Mods folder is to use an icon already in the game and tint it if you want, like this:

 

<item id="3010" name="fireClub">
<property name="Extends" value="clubIron"/>
       [color="#FF0000"][b]<property name="CustomIcon" value="clubIron"/>
<property name="CustomIconTint" value="FF0000"/>[/b][/color]
<property name="Meshfile" value="Items/Tools/torchPrefab"/>
<property name="RepairTools" value="forgedIron"/>
<property name="EconomicValue" value="224"/>
<property name="SellableToTrader" value="true"/>
<property name="SoundIdle" value="torch_lp"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Stamina_usage" value="6.5"/>
	<property name="Delay" value="1.15"/>
	<property name="Sound_start" value="torch_swoosh"/>
	<property name="Buff" value="burning,bleeding,criticalBlunt"/>
	<property name="Buff_chance" value="0.65,0.3,0.3"/>
	<property name="DamageBonus.head" value="5"/>
</property>
<property class="Attributes">
	<property name="EntityDamage" value="12,22"/>
	<property name="BlockDamage" value="7.2,18"/>
	<property name="DegradationMax" value="250,650"/>
	<property name="DegradationRate" value="1,1"/>
</property>
<property name="CritChance" value="0.3"/>
<property name="Group" value="Ammo/Weapons"/>
<property name="DescriptionKey" value="clubBarbedDesc"/>
<property name="LightValue" value="0.35"/>
<property name="LightSource" value="lightSource"/>
<property name="ActivateObject" value="lightSource"/>
<property name="AlwaysActive" value="true"/>
</item>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...