Jump to content

Attempted To Add New Forge Material, Forge Broken, Help?


Recommended Posts


IndexOutOfRangeException: Index was outside the bounds of the array.
  at XUiC_WorkstationMaterialInputWindow.OnOpen () [0x0005f] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_WorkstationWindowGroup.OnOpen () [0x0023c] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiWindowGroup.OnOpen () [0x00006] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at GUIWindowManager.Open (GUIWindow _w, System.Boolean _bModal, System.Boolean _bIsNotEscClosable, System.Boolean _bCloseAllOpenWindows) [0x000d0] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at GUIWindowManager.Open (System.String _windowName, System.Boolean _bModal, System.Boolean _bIsNotEscClosable, System.Boolean _bCloseAllOpenWindows) [0x00065] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at GameManager.workstationOpened (TileEntityWorkstation _te, LocalPlayerUI _playerUI) [0x00090] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at GameManager.OpenTileEntityUi (System.Int32 _entityIdThatOpenedIt, TileEntity _te, System.String _customUi) [0x00062] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at GameManager.TELockServer (System.Int32 _clrIdx, Vector3i _blockPos, System.Int32 _lootEntityId, System.Int32 _entityIdThatOpenedIt, System.String _customUi) [0x00137] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at BlockForge.OnBlockActivated (WorldBase _world, System.Int32 _cIdx, Vector3i _blockPos, BlockValue _blockValue, EntityAlive _player) [0x00028] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at BlockForge.OnBlockActivated (System.Int32 _indexInBlockActivationCommands, WorldBase _world, System.Int32 _cIdx, Vector3i _blockPos, BlockValue _blockValue, EntityAlive _player) [0x00009] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_Radial.handleBlockCommand (XUiC_Radial _sender, System.Int32 _commandIndex, XUiC_Radial+RadialContextAbs _context) [0x00024] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_Radial.CallContextAction () [0x000b8] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_Radial.SetCommonData (GUI_2.UIUtils+ButtonIcon _controllerButtonForSelect, XUiC_Radial+CommandHandlerDelegate _commandHandlerFunc, XUiC_Radial+RadialContextAbs _context, System.Int32 _preSelectedCommandIndex, System.Boolean _hasSpecialActionPriorToRadialVisibility, XUiC_Radial+RadialStillValidDelegate _radialValidityCallback) [0x000d0] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_Radial.SetCurrentBlockData (WorldBase _world, Vector3i _blockPos, System.Int32 _cIdx, BlockValue _blockValue, EntityAlive _entityFocusing) [0x0009d] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at PlayerMoveController.Update () [0x01df0] in <39cf8b713b17414c9e5ddfff01d6df19>:0 

2022-04-12T00:55:38 89.765 ERR [XUi] Error while updating window group 'workstation_forge:
2022-04-12T00:55:38 89.766 EXC Index was outside the bounds of the array.
  at XUiC_WorkstationMaterialInputWindow.Update (System.Single _dt) [0x00043] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiController.Update (System.Single _dt) [0x0004f] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_WorkstationWindowGroup.Update (System.Single _dt) [0x00000] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUi.OnUpdateDeltaTime (System.Single updateDeltaTime) [0x00131] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
XUi:OnUpdateDeltaTime(Single)
XUiUpdater:Update()
XUiUpdateHelper:LateUpdate()

Essentially I edited the "windows.xml" file to account for the new material in the forge UI, as well as, the: "materials.xml", and the "items.xml" for the new Material and for any items that would scrap down into that Material.

The scrapping doesn't work for the new material either.

Any help would be greatly appreciated.

 

Changes:

"windows.xml"

<config>

	<set xpath="/windows/window[@name='windowForgeInput']/@materials_accepted">iron,brass,lead,glass,stone,clay,aluminum</set>

	<set xpath="/windows/window[@name='windowToolsForge']/rect[@name='content']/grid[@name='inventory']/@required_tools">toolBellows,toolAnvil,toolForgeCrucible,toolMechanicalBellows</set>

</config>

"materials.xml"

<config>
  <append xpath="/materials">

    <material id="MresourceAluminumScrap">
      <property name="damage_category" value="metal"/>
      <property name="surface_category" value="metal"/>
      <property name="forge_category" value="aluminum"/>
      <property name="Hardness" type="float" value="1"/>
      <property name="stepsound" value="metal"/>
      <property name="stability_glue" value="15"/>
      <property name="Mass" type="int" value="10"/>
      <property name="MaxDamage" value="80"/>
      <property name="Experience" value="1"/>
    </material>

    <material id="Maluminum">
      <property name="damage_category" value="metal"/>
      <property name="surface_category" value="metal"/>
      <property name="forge_category" value="aluminum"/>
      <property name="Hardness" type="float" value="1"/>
      <property name="stepsound" value="metal"/>
      <property name="stability_glue" value="10"/>
      <property name="Mass" type="int" value="5"/>
      <property name="MaxDamage" value="30"/>
      <property name="Experience" value="1"/>
    </material>

    <material id="Mirondust">
      <property name="damage_category" value="earth"/>
      <property name="surface_category" value="earth"/>
      <property name="forge_category" value="iron"/>
      <property name="Hardness" type="float" value="1"/>
      <property name="stepsound" value="metal"/>
      <property name="stability_glue" value="20"/>
      <property name="Mass" type="int" value="5"/>
      <property name="MaxDamage" value="30"/>
      <property name="Experience" value="1"/>
    </material>
    
  </append>
</config>

"items.xml"

<configs>
	<append xpath="/items">
		<item name="resourceIronOxide">
			<property name="HoldType" value="45"/>
			<property name="DescriptionKey" value="resourceIronOxideDesc"/>
			<property name="Meshfile" value="Items/Misc/sackPrefab"/>
			<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
   			<property name="CustomIcon" value="resourceIronOxide"/>
			<property name="Material" value="Mirondust"/>
			<property name="Stacknumber" value="6000"/> <!-- STK resource -->
     			<property name="Weight" value="5"/>
			<property name="EconomicValue" value="20"/>
			<property name="Group" value="Resources"/>
		</item>
		<item name="resourceAluminumScrap">
			<property name="HoldType" value="45"/>
          		<property name="DescriptionKey" value="resourceAluminumScrapDesc"/>
			<property name="Meshfile" value="Items/Misc/sackPrefab"/>
			<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
   			<property name="CustomIcon" value="resourceScrapBrass"/> <property name="CustomIconTint" value="999999"/>
			<property name="Material" value="MresourceAluminumScrap"/>
			<property name="Stacknumber" value="6000"/> <!-- STK resource -->
     			<property name="Weight" value="5"/>
			<property name="EconomicValue" value="20"/>
			<property name="Group" value="Resources"/>
		</item>
		<item name="resourceAluminum">
			<property name="HoldType" value="45"/>
			<property name="DescriptionKey" value="resourceAluminumDesc"/>
			<property name="Meshfile" value="Items/Misc/sackPrefab"/>
			<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
   			<property name="CustomIcon" value="drugCrushedPainkillers"/> <property name="CustomIconTint" value="999999"/>
			<property name="Material" value="Maluminum"/>
			<property name="Stacknumber" value="6000"/> <!-- STK resource -->
     			<property name="Weight" value="5"/>
			<property name="EconomicValue" value="20"/>
			<property name="Group" value="Resources"/>
		</item>

		<item name="unit_aluminum">
			<property name="Extends" value="unit_iron"/>
			<property name="CustomIcon" value="resourceScrapBrass"/> <property name="CustomIconTint" value="999999"/>
			<property name="Material" value="Maluminum"/>
			<property name="MeltTimePerUnit" value=".4"/>
			<property name="CreativeMode" value="None"/>
		</item>
	</append>

	<set xpath="/items/item[@name='foodCanBeef']/property[@name='Material']/@value">MresourceAluminumScrap</set>
	<set xpath="/items/item[@name='drinkCanEmpty']/property[@name='Material']/@value">MresourceAluminumScrap</set>
	<set xpath="/items/item[@name='resourceRocketCasing']/property[@name='Material']/@value">MresourceAluminumScrap</set>
</configs>

 

Link to comment
Share on other sites

Have a look at Mining mod by MeanCloud or Alchemy mod by me.

 

Mining mod adds copper and zinc to the existing forge

 

Alchemy mod adds Aluminium, Manganese, Chromium, Copper, Zinc, Titanium, Nickel, Zircon, Magnesium and Tin to a new forge

 

You could use that as a starting point and just strip back everything you don't want.

 

 

Link to comment
Share on other sites

I checked, double checked, and triple checked, my work against these mods mentioned, and found no issues, no errors. I even reverted my ENTIRE work on aluminum and removed every mention of it from all files, and the error persists.

 


2022-04-12T18:21:50 89.421 ERR [XUi] Error while updating window group 'workstation_forge:
2022-04-12T18:21:50 89.426 EXC Index was outside the bounds of the array.
  at XUiC_WorkstationMaterialInputWindow.SetMaterialWeights (ItemStack[] stackList) [0x00011] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_WorkstationMaterialInputWindow.Update (System.Single _dt) [0x0003a] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiController.Update (System.Single _dt) [0x0004f] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUiC_WorkstationWindowGroup.Update (System.Single _dt) [0x00000] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
  at XUi.OnUpdateDeltaTime (System.Single updateDeltaTime) [0x00131] in <39cf8b713b17414c9e5ddfff01d6df19>:0 
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
XUi:OnUpdateDeltaTime(Single)
XUiUpdater:Update()
XUiUpdateHelper:LateUpdate()

 

I've checked, there is not a single file that edits the forge window UI, in my VERY small modlist. I've gone through every XUi file in every mod folder and nothing even mentions the forge. This must be something else.

Link to comment
Share on other sites

7DtD loads mods in numerical/alphabetical order.  If a mod with required assets is loading AFTER the mod calling for that required asset, it's going to break.  Since we don't have the equivalent tools of LOOT or TESVEdit for 7DtD yet to help sort load order or mod conflicts, it's time to go Old School.

Fresh install of game (new game folder preferred), no mods.
Add your modlet.
Fire up the game, does the error occur?  If so, does your mod require any assets added by one of your other mods?  If so, rename your modlet folder to load AFTER the required mod.  Load the required mod and try again.  If error occurs - there is still a bug somewhere in your modlet.
If the error does not occur - add ONE of your other mods, fire up the game.
Does the error occur with those two mods?  If so work with just those mods to figure out what's breaking. Rename folders to adjust load order if needed.
If the error does not occur - add one more mod, fire up the game.
Wash, rinse, repeat until you find out where the error is occurring.

Yes, it's tedious AF.  But it usually pinpoints where the problem is occurring.

 

Link to comment
Share on other sites

I think it was simpler than that. I made a guess, that loading the same testing world everytime I make a change would eventually, inevitably, break something and not load, mostly because the LOG was not pointing to an XML error like it normally would.

 

Note to self: ALWAYS start a new game for testing mods

Still not able to add anything to the forge, though.

 

Must be an issue with version 20.1, as older versions, with mods that add in their own materials that can smelt in the forge, work fine. I even copied their exact codes, substituting only the names of the materials in the respective xml files and still no luck.

 

Can't even simply copy a mod that adds copper to the forge and change all the names in the apporpriate xml files to aluminum. I get an xml error in the "windows.xml" file even though it's a copy of a functional code.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...