Jump to content

One last problem.


Lerrasien

Recommended Posts

I can't seem to get the loot to spawn inside of the class container. I based it around Valmod's class containers, but for some reason, I get no loot to spawn. The error code is:

 

KeyNotFoundException: The given key was not present in the dictionary.

at System.Collections.Generic.Dictionary`2[system.String,LootContainer+LootQualityTemplate].get_Item (System.String key) [0x00000] in <filename unknown>:0

at LootContainer.WZ (.LootEntry , .ItemValue , Int32 , System.Collections.Generic.List`1 , System.Int32& , Single , Single ) [0x00000] in <filename unknown>:0

at LootContainer.GZ (System.Collections.Generic.List`1 , Single , System.Collections.Generic.List`1 , System.Int32& , Single , Single ) [0x00000] in <filename unknown>:0

at LootContainer.LZ (System.Collections.Generic.List`1 , Int32 , Single , System.Collections.Generic.List`1 , System.Int32& , Single , Single ) [0x00000] in <filename unknown>:0

at LootContainer.HZ (.LootGroup , Int32 , Single , System.Collections.Generic.List`1 , System.Int32& , Single , Single ) [0x00000] in <filename unknown>:0

at LootContainer.LZ (System.Collections.Generic.List`1 , Int32 , Single , System.Collections.Generic.List`1 , System.Int32& , Single , Single ) [0x00000] in <filename unknown>:0

at LootContainer.Spawn (Int32 _maxItems, Single playerLevelPercentage, Single rareLootChance) [0x00000] in <filename unknown>:0

at LootManager.LootContainerOpened (.TileEntityLootContainer _tileEntity, Int32 _entityIdThatOpenedIt) [0x00000] in <filename unknown>:0

at GameManager.QH (.TileEntityLootContainer , .LocalPlayerUI , Int32 ) [0x00000] in <filename unknown>:0

at GameManager.TELockServer (Int32 _clrIdx, Vector3i _blockPos, Int32 _lootEntityId, Int32 _entityIdThatOpenedIt) [0x00000] in <filename unknown>:0

at BlockLoot.OnBlockActivated (.WorldBase _world, Int32 _cIdx, Vector3i _blockPos, BlockValue _blockValue, .EntityAlive _player) [0x00000] in <filename unknown>:0

at BlockLoot.OnBlockActivated (Int32 _indexInBlockActivationCommands, .WorldBase _world, Int32 _cIdx, Vector3i _blockPos, BlockValue _blockValue, .EntityAlive _player) [0x00000] in <filename unknown>:0

at XUiC_Radial.CallContextAction () [0x00000] in <filename unknown>:0

at XUiC_Radial.XRG (Int32 , Boolean , Boolean , Boolean , Boolean , Boolean , Boolean ) [0x00000] in <filename unknown>:0

at XUiC_Radial.SetCurrentBlockData (.WorldBase _world, Vector3i _blockPos, Int32 _cIdx, BlockValue _blockValue, .EntityAlive _entityFocusing) [0x00000] in <filename unknown>:0

at PlayerMoveController.Update () [0x00000] in <filename unknown>:0

 

 

No idea what it's trying to tell me, since I'm still pretty new to modding/coding.

 

This is the blocks.xml code

 

<block id="2042" name="Class - Warrior (Locked)">
	<property name="DescriptionKey" value="classWarriorDesc"/>
	<property name="CustomIcon" value="Class - Warrior" />
	<property name="Group" value="Class System" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Material" value="wood+wood" />
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<drop event="Destroy" count="0" prob="1" />
	<property name="CanPickup" value="true" />
	<property name="DowngradeBlock" value="Class - Warrior" />
	<property class="UpgradeBlock">
		<property name="ToBlock" value="Class - Warrior" />
		<property name="Item" value="classKey" />
		<property name="ItemCount" value="1" />
		<property name="UpgradeHitCount" value="1" />
	</property>
</block>

<block id="2043" name="Class - Warrior">
	<property name="Class" value="Loot" />
	<property name="Material" value="wood+wood" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<property name="LootList" value="100" />
	<drop event="Destroy" count="0" />
	<drop event="Fall" name="woodDebris" count="1" prob="1.0"  stick_chance=".75" />
	<property name="LPHardnessScale" value="8" />
</block>

<block id="2044" name="Class - Juggernaut (Locked)">
	<property name="DescriptionKey" value="classJuggernautDesc"/>
	<property name="CustomIcon" value="Class - Juggernaut" />
	<property name="Group" value="Class System" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Material" value="wood+wood" />
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<drop event="Destroy" count="0" prob="1" />
	<property name="CanPickup" value="true" />
	<property name="DowngradeBlock" value="Class - Juggernaut" />
	<property class="UpgradeBlock">
		<property name="ToBlock" value="Class - Juggernaut" />
		<property name="Item" value="classKey" />
		<property name="ItemCount" value="1" />
		<property name="UpgradeHitCount" value="1" />
	</property>
</block>

<block id="2045" name="Class - Juggernaut">
	<property name="Class" value="Loot" />
	<property name="Material" value="wood+wood" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<property name="LootList" value="101" />
	<drop event="Destroy" count="0" />
	<drop event="Fall" name="woodDebris" count="1" prob="1.0"  stick_chance=".75" />
	<property name="LPHardnessScale" value="8" />
</block>

<block id="2046" name="Class - Sage (Locked)">
	<property name="DescriptionKey" value="classSageDesc"/>
	<property name="CustomIcon" value="Class - Sage" />
	<property name="Group" value="Class System" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Material" value="wood+wood" />
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<drop event="Destroy" count="0" prob="1" />
	<property name="CanPickup" value="true" />
	<property name="DowngradeBlock" value="Class - Sage" />
	<property class="UpgradeBlock">
		<property name="ToBlock" value="Class - Sage" />
		<property name="Item" value="classKey" />
		<property name="ItemCount" value="1" />
		<property name="UpgradeHitCount" value="1" />
	</property>
</block>

<block id="2047" name="Class - Sage">
	<property name="Class" value="Loot" />
	<property name="Material" value="wood+wood" />
	<!--		<property name="CustomIcon" value="suitcase" /> -->
	<property name="Shape" value="Ext3dModel" />
	<property name="Mesh" value="models" />
	<property name="Model" value="LootContainers/suitcase" param1="main_mesh" />
	<property name="Place" value="TowardsPlacer" />
	<property name="LootList" value="102" />
	<drop event="Destroy" count="0" />
	<drop event="Fall" name="woodDebris" count="1" prob="1.0"  stick_chance=".75" />
	<property name="LPHardnessScale" value="8" />
</block>

Link to comment
Share on other sites

Here is the loot.xml code

 

<lootgroup name="warriorClass" count="all">
	<item name="bottledWater" count="1"/>	
	<item name="firstAidKit" count="1"/>
	<item name="flashlight02" />
       <item name="militaryBoots" count="1"/>
       <item name="gunMP5" count="1" quality="200,200"/>
       <item name="repairKit" count="5"/>
       <item name="9mmBullet" count="200"/>
	<item name="challengeClassWarrior" count="1"/>
	<item name="perkWarrior" count="1"/>
</lootgroup>

<lootgroup name="sageClass" count="all">
       <item name="clawHammer" count="1" quality="200,200"/>
       <item name="fireaxeIron" count="1" quality="200,200"/>
       <item name="wood" count="2000"/>
       <item name="woodFrameBlock" count="100"/>
	<item name="forgedIron" count="50"/>
       <item name="gunPistol" count="1" quality="200,200"/>
       <item name="9mmBullet" count="50"/>
       <item name="repairKit" count="4"/>
	<item name="challengeClassSage" count="1"/>
       <item name="wrench" count="1" quality="200,200"/>
       <item name="workbench" count="1"/>
	<item name="perkSage" count="1"/>
</lootgroup>

<lootgroup name="juggernautClass" count="all">
	<item name="painkillers" count="2"/>
	<item name="bottledWater" count="1"/>
	<item name="firstAidBandage" count="4"/>
	<item name="sledgehammer" count="1" quality="200,200"/>
       <item name="clubSpiked" count="1" quality="200,200"/>
       <item name="gunSawedOffPumpShotgun" count="1" quality="200,200"/>
	<item name="shotgunShell" count="120"/>
       <item name="antibiotics" count="2"/>
       <item name="repairKit" count="4"/>
	<item name="challengeClassJuggernaut" count="1"/>
	<item name="perkJuggernaut" count="1"/>
</lootgroup>

	<lootcontainer id="100" count="1" size="8,4" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="classTemplate">
    <item group="warriorClass"/>
	</lootcontainer>

	<lootcontainer id="101" count="1" size="8,4" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="classTemplate">
    <item group="juggernautClass"/>
	</lootcontainer>

	<lootcontainer id="102" count="1" size="8,4" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="classTemplate">
    <item group="sageClass"/>
	</lootcontainer>

Link to comment
Share on other sites

Simple terms, dictionary is part of the code in the dll, if you see in file and a blank that means the code caused a break in the dll.

Key not present in dictionary, easiest explanation, you have an item,a block, an entity, something physical that you want to display in game but your code does not define it fully. Example: add entity BADDOG one of mine I had him attack the bunny corpse but i Called it Rabbit instead of rabbit so game could not find an association to the correct corpse.

 

Looking at it now but best bet ist repeat the steps from earlier.

 

 

The only thing i can think of and its probably wrong is what placehlder are your loot containers a part of?

Heirarchy, item in container in placeholder.

Link to comment
Share on other sites

As far as I can tell, all of the names line up, the loot container #s line up with the LootList #s, all of the loot I want is basic default game loot (apart from the class perk/quest), so I know those exist and have the correct parameters.

 

I'm looking at Valmod's files and they look the exact same in comparison other than me taking out the Survival gear stuff, since I don't have those parameters in anything, since I don't have that loot group made.

 

I ran a search with the container names and such within the other Valmod files to see if there was something I missed in adding, but I can't seem to find anything missing from another xml file.

 

And when I delete the file, the container is gone and I can't really do anything further with it. I've tried taking items out, etc, but it comes to the same result. Hence why I posted, since the stuff we did with the last issue I had doesn't seem to be helping me much with this one.

 

I figured out the last issue was that I was trying to use an outdated UI to show my Food/Water with my Health/Stamina rather than having to go into my character screen to see it.

Link to comment
Share on other sites

That's why i said id probably be wrong, too many variables to that error, compounded with multiple edits.

Advice

True Survival does something similar, It looks like you want to give a multiple inventory suitcase.

TS starts same way with a key that leads to case which leads to inventory.

Dont delete file but block comment out all but the first suitcase you are trying to make.

Get that one right first and it will help to create the others.

Link to comment
Share on other sites

That's why i said id probably be wrong, too many variables to that error, compounded with multiple edits.

Advice

True Survival does something similar, It looks like you want to give a multiple inventory suitcase.

TS starts same way with a key that leads to case which leads to inventory.

Dont delete file but block comment out all but the first suitcase you are trying to make.

Get that one right first and it will help to create the others.

 

So try and get one right to make a base for the others, rather than trying to do them all at once. It will certainly save time at the very least. I'll give it a shot. Maybe there's something minute that I missed somewhere along the way. I'll go slower over everything again each time, see if I can sniff out a mistake.

Link to comment
Share on other sites

Can't remember off the top of my head but what is the max id for blocks? Isn't it 2042 or something close to that? Maybe it's trying to read info from the 2042 block that is based on a higher block id. At work so I can't check the max right now.

 

I think the max is 2047.

 

Edit: Yeah, 2047

Link to comment
Share on other sites

I finally buckled. I'm good at doing quests, and clearly not at doing blocks lol. So I just made an intro quest for each class and made the ClassSelection item given upon entry to be able to be crafted into that intro quest rather than a block. So I guess problem solved xD

Link to comment
Share on other sites

Here is the loot.xml code

 

loot_quality_template="classTemplate"

Do you have the "classTemplate"? If you want quality 200, it should look like so:

 

	<lootqualitytemplate name="classTemplate">
	<qualitytemplate level="0,1" default_quality="200,200">
		<loot quality="200,200" prob="1"/>
	</qualitytemplate>
</lootqualitytemplate>

Link to comment
Share on other sites

Do you have the "classTemplate"? If you want quality 200, it should look like so:

 

	<lootqualitytemplate name="classTemplate">
	<qualitytemplate level="0,1" default_quality="200,200">
		<loot quality="200,200" prob="1"/>
	</qualitytemplate>
</lootqualitytemplate>

 

Nah, I took that template and everything out, since I no longer was using it with the class loot. I haven't changed anything with the items otherwise, nothing that should have changed all crafted items. The quest rewards give me everything they should. It's just everything I craft. I gave myself capped crafting and they're still 0.

Link to comment
Share on other sites

Nah, I took that template and everything out, since I no longer was using it with the class loot. I haven't changed anything with the items otherwise, nothing that should have changed all crafted items. The quest rewards give me everything they should. It's just everything I craft. I gave myself capped crafting and they're still 0.
I'm talking about your first approach with the lootcontainers. I did not see an error there, so I'm asking about the template. Can't say anything about the quest-approach, without any code. Giving items with a quest is mostly no good idea, because the player's inventory might be full. Probably not right after the game's start, but you never know. Only giving items per quests before the player has a chance to do anything in the beginning is save, but that does not work when you want to give out items after the player made a decision.
Link to comment
Share on other sites

I'm talking about your first approach with the lootcontainers. I did not see an error there, so I'm asking about the template. Can't say anything about the quest-approach, without any code. Giving items with a quest is mostly no good idea, because the player's inventory might be full. Probably not right after the game's start, but you never know. Only giving items per quests before the player has a chance to do anything in the beginning is save, but that does not work when you want to give out items after the player made a decision.

 

Ah, yeah I've removed all of that. The quest that gives items is given upon entering and only requires gathering 1 wood to start the quest line and give the starting class' items. So there won't be an issue of no room. Give me a second and I'll throw all of my code on here.

[ATTACH]25123[/ATTACH]

[ATTACH]25127[/ATTACH]

[ATTACH]25128[/ATTACH]

[ATTACH]25125[/ATTACH]

[ATTACH]25126[/ATTACH]

 

As far as I can tell, I haven't edited anything that should affect items crafted by the player, much less that every item should be 0 quality. But that's the problem I'm currently encountering.

 

I'm also getting a spam error when having the challenge_soldier1 quest selected in the menu while in game, not sure what that's about either, since as far as I can tell, everything is properly in place.

blocks.zip

items.zip

progression.zip

quests.zip

recipes.zip

Link to comment
Share on other sites

So you are no longer interested to make your initial approach work..? I kinda spent some time to check the code you've used for that, and it does work if you do it right.

 

I am still interested in it at a later date, but I'm trying to get it working for my friends, and it seemed I was having a lot of difficulty with it. I'm still working on it on the side, but this was an easier and much faster path to a similar, almost exact same result. I just can't understand why the items crafted have changed at all... it makes no sense, as I've done nothing to warrant that change in the code I've altered.

 

When I craft the very first Stone Axe, or anything thereafter as I've seen through CM testing, all results in a 0 quality item, rather than the baseline 25. I also saw through testing that it never increases from 0, regardless of perk levels.

Link to comment
Share on other sites

I am still interested in it at a later date, but I'm trying to get it working for my friends, and it seemed I was having a lot of difficulty with it. I'm still working on it on the side, but this was an easier and much faster path to a similar, almost exact same result. I just can't understand why the items crafted have changed at all... it makes no sense, as I've done nothing to warrant that change in the code I've altered.

 

When I craft the very first Stone Axe, or anything thereafter as I've seen through CM testing, all results in a 0 quality item, rather than the baseline 25. I also saw through testing that it never increases from 0, regardless of perk levels.

I remember that I once had the issue you are having, but I think it had to do with progression.xml. Maybe it's tied to giving skill level as a reward, but I'm just guessing.

 

I briefly looked at the quests.xml and found no error. I'm not going to check deeper. If I were you, I would:

 

Restore vanilla's quests.xml and see if your edits of that file were the cause of your issue.

 

If so: Add quests until the issue appears. Make sure, you remove those rewards of quests that are not in yet, for example use:

 

<quest id="challenge_soldier" group_name_key="quest_soldier" name="Soldier Quest Intro" subtitle="Soldier Challenge" description="You were born a Soldier" icon="ui_game_symbol_rifle"
	repeatable="false" category_key="challenge" offer="You were born a soldier!" difficulty="easy">

<objective type="FetchKeep" id="wood" value="1" />

<reward type="Skill" id="Rifles" value="25" />
<reward type="Skill" id="Blade Weapons" value="25" />
<reward type="Skill" id="9mm Round Crafting" value="1" />

<reward type="Item" id="armyPants" value="200"/>
<reward type="Item" id="armyShirt" value="200"/>
<reward type="Item" id="militaryRation" value="1"/>
<reward type="Item" id="painkillers" value="1"/>
<reward type="Item" id="bottledWater" value="1"/>	
<reward type="Item" id="firstAidKit" value="1"/>
<reward type="Item" id="flashlight02" value="200" />
<reward type="Item" id="militaryGloves" value="200" />
       <reward type="Item" id="militaryBoots" value="200" />
       <reward type="Item" id="gunMP5" value="200" />
<reward type="Item" id="huntingKnife" value="200"/>
       <reward type="Item" id="repairKit" value="5"/>
       <reward type="Item" id="9mmBullet" value="200"/>
</quest>

Btw, if you have no objective at all, the quest is instantly finished, giving the rewards, so I'd remove your fetchkeep 1 wood.

 

If you found the quest that causes the problem, examine, if you can't find an error, post the problem-causing quest.

Link to comment
Share on other sites

I remember that I once had the issue you are having, but I think it had to do with progression.xml. Maybe it's tied to giving skill level as a reward, but I'm just guessing.

 

I briefly looked at the quests.xml and found no error. I'm not going to check deeper. If I were you, I would:

 

Restore vanilla's quests.xml and see if your edits of that file were the cause of your issue.

 

If so: Add quests until the issue appears. Make sure, you remove those rewards of quests that are not in yet, for example use:

 

<quest id="challenge_soldier" group_name_key="quest_soldier" name="Soldier Quest Intro" subtitle="Soldier Challenge" description="You were born a Soldier" icon="ui_game_symbol_rifle"
	repeatable="false" category_key="challenge" offer="You were born a soldier!" difficulty="easy">

<objective type="FetchKeep" id="wood" value="1" />

<reward type="Skill" id="Rifles" value="25" />
<reward type="Skill" id="Blade Weapons" value="25" />
<reward type="Skill" id="9mm Round Crafting" value="1" />

<reward type="Item" id="armyPants" value="200"/>
<reward type="Item" id="armyShirt" value="200"/>
<reward type="Item" id="militaryRation" value="1"/>
<reward type="Item" id="painkillers" value="1"/>
<reward type="Item" id="bottledWater" value="1"/>	
<reward type="Item" id="firstAidKit" value="1"/>
<reward type="Item" id="flashlight02" value="200" />
<reward type="Item" id="militaryGloves" value="200" />
       <reward type="Item" id="militaryBoots" value="200" />
       <reward type="Item" id="gunMP5" value="200" />
<reward type="Item" id="huntingKnife" value="200"/>
       <reward type="Item" id="repairKit" value="5"/>
       <reward type="Item" id="9mmBullet" value="200"/>
</quest>

Btw, if you have no objective at all, the quest is instantly finished, giving the rewards, so I'd remove your fetchkeep 1 wood.

 

If you found the quest that causes the problem, examine, if you can't find an error, post the problem-causing quest.

 

Oh, I figured they needed parameters to be completed, I'll go ahead and remove the wood requirement on the intro quests then. Yeah, I'm thinking it may have to do with me putting class restrictions on getting specific perks. That's what I'll check first. If it's not that, then I'll go into quests and so forth until I find the issue.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...