dragonslayer770
New member
hi all , im trying to give all guns and tools random 0-8 mods slots.
can some one help with the set code if possible, thank you.
can some one help with the set code if possible, thank you.
thank you, but I need the append set code to get it to work
this is what I have, and it doesn't work
<set xpath="/items/item[starts-with(@name, 'gun')]/effect_group[starts-with(@name, 'gun')]/passive_effect[@name='ModSlots']/@value">8,8,8,8,8,8</set>
I've tried a lot of ways and nothing
hi all , im trying to give all guns and tools random 0-8 mods slots.
can some one help with the set code if possible, thank you.
when i craft one any level it has one mod slot, yes the code is between <config> </config>, no errors and yes the modlet has a ModInfo.xml file.First, what is not working exactly? Do you have this code between <config> </config>? Are you getting any errors in the console regarding mods when you load up a game? Does your modlet have a ModInfo.xml file?
i found what the problem was, it was z30k-itemstack mod.BFT2020 said:I think you have a different issue than the code above.
If you installed Doughs modlets and started getting that error, there might be an issue with the files going from Alpha19 to Alpha20.
i will look into it thanks for the heads up.<triggered_effect trigger="onSelfAttackedOther" action="Ragdoll" target="other" duration=".2" force="200">
<requirement name="ProgressionLevel" progression_name="perkTurrets" operation="LTE" value="1"/>
<requirement name="RandomRoll" seed_type="Random" min_max="0,100" operation="LTE" value="30"/>
</triggered_effect>
I'm not sure if you'd be able to use this logic with ModSlots... like make several of these rules and say 1 slot if 10%, 2 if 11-20%, 3 is 21-40%...etc. . I almost thing you'd need cvar or something to keep track of/set the ModSlots string, but I am not well versed on their usage. I may be talking gibberish at this point...sorry
So after reading this thread, I tried making a mod based off your mod, very simple, I just want 4 mod slots regardless of the tier.Hello![]()
If you're using the mod named "Doughs-UI-Add-2ModSlots" version 19.2.1.0 has not been tested/converted to work with a20 experimental (as mentioned above) BUT
I put just that single mod into the "Mods" folder of the game and started a new map using Navezgane on the latest 20 exp build and it appears to work in a few weapons I checked (I did not spend any time really checking it though, like adding weapon mods, etc).
What I was looking for was:
- The mod loads without apparent errors: it does
- The mod adds 2 more slots: it does
Based on how it worked in a20 exp, I'm reasonably sure its not generating that "IOException: Sharing violation on path..." error. However it appears you may be attempting to create a mod of your own from it. Note: my mod only (very clumsily) makes it so all weapons have 2 mod slots (8 total). It doesn't do this and make the UI pretty either, nor does it do it randomly as you're trying to do. I don't know how to easily make it random unless there's some way to do logic in that part and perform a random number check and then choose the slot count based on that...and just looking at weapons items.xml it appears that for to be "random" it has to already be "a random thing" the game accepts ( like a range) or it has to be a triggered effect, and ModSlots appears to be a passive effect. I could *easily* be wrong about this though as I haven't brushed up on modding in a bit and I never got into all the minute differences like this. here's an example for a "random roll" for a triggered effect for the junk sledge so show what "RandomRoll" looks like to determine if it ragdolls when it hits something (I am guessing) and it only triggers a ragdoll if its 30% of the time:
<triggered_effect trigger="onSelfAttackedOther" action="Ragdoll" target="other" duration=".2" force="200">
<requirement name="ProgressionLevel" progression_name="perkTurrets" operation="LTE" value="1"/>
<requirement name="RandomRoll" seed_type="Random" min_max="0,100" operation="LTE" value="30"/>
</triggered_effect>
I'm not sure if you'd be able to use this logic with ModSlots... like make several of these rules and say 1 slot if 10%, 2 if 11-20%, 3 is 21-40%...etc. . I almost thing you'd need cvar or something to keep track of/set the ModSlots string, but I am not well versed on their usage. I may be talking gibberish at this point...sorry![]()
"IOException: Sharing violation" from what I believe (and I'm not super knowledgeable about Unity or anything it does, so I'm guessing a bit. not googling too much) is related to opening/closing/accessing files, and something tried to access/open/close a file that was already open/accessed by something else (e.g. "sharing" was not allowed). There are a few more clues as you read "down" into the error: "System.IO.FileAccess access" probably means "accessing the file" and "System.IO.File.OpenRead" likely means "trying to read the file" and errr...ummm... "CalcCrcCoroutine" might be Calculate Cyclic Redundancy Check Coroutine? and "InvokeMoveNext" is likely a literal attempt at reading the next byte(s) of the file or file handle or something.
ANYWAY: ***All guesses*** here: from the error, I'm guessing the mod you're loading is messed up in a weid way (like the XML tags are not properly closed/formatted) that it messed up Unity trying to load it, or you have another issue with the game files (need to validate/redownload them maybe) or its possible its a file permissions thing where the file can be "seen" but when it tried to access (open) it it fails. Another possibility might be you had the mod file(s) open in another program and it locked Unity out from reading them (usually files can be read by other programs while they are open... but maybe it was locked or something).
I made my mod look like you posted above, and it actually worksAnywho, this is what I did which doesn't work
My mod still works (did very light testing just now). The extra code in the windows.xml as to visually add 2 more slots so you could see mods you loaded. Its not too important to see the slots below the "recipe" area, but its a bit more important to see them in the "available mod slots" area as you can't easily add/remove mods unless you can click on the mod. I'm not sure but I think I had to include them as the game hard coded a limit of 6 visible slots and I had to make it add 2 more. When you only have 4 slots ( as you want) then yep the windows.xml file isn't needed as its less than 8 slots.Did you ever get a chance to see if your mod still works?
Thanks for the info! Yes, I do want it to apply to all items not just guns. Newly crafted t4 still have 2 slots and cheated in items have defaults. The mod is loading fine according to the log. I'm going to try making a new save to see if that works.I made my mod look like you posted above, and it actually worksthere's a weirdness with the game that you might be seeing that I found. So, just to test if it works on your system, do this:
- Load up your existing game you were testing thw mod slots with your mod with all the 4's. Make sure creative mode is enabled!
- search for "gun" and choose a few new guns from the search results. Make them of different tiers ( hopefully tier 1 and tier 6)
- These guns should have 4 mod slots in them.
- Choose one of the guns you had in earlier saves. Try to choose Tier 1 or 6 if you have them. Note how the mod slots are likely *not* 4!
What appears to be happening is that once you pick up a gun, it has the mod slots "hardcoded" into it based on the current game settings. If you shut down the game, and mod the mod slots, then start the game back up , the new mod slot counts only takes effect on "new" guns you pick up.
So if you want *all* existing and new guns to have 4 mod slots *in an existing saved game* it appears you'll have to scrap all your existing weapons that were created/picked up that had more or less than 4 slots before you added your 4 slot mod.
My mod still works (did very light testing just now). The extra code in the windows.xml as to visually add 2 more slots so you could see mods you loaded. Its not too important to see the slots below the "recipe" area, but its a bit more important to see them in the "available mod slots" area as you can't easily add/remove mods unless you can click on the mod. I'm not sure but I think I had to include them as the game hard coded a limit of 6 visible slots and I had to make it add 2 more. When you only have 4 slots ( as you want) then yep the windows.xml file isn't needed as its less than 8 slots.
EDIT: Also, upon looking at the code, this mod will likely sent *everything* to 4 mod slots. Weapons, armor, probably anything with mod slots except vehicles. It just says "which everything with this ModSlots pattern to this other one, no matter what it is". Mine does the same thing but makes them all 8. It likely applies to any item/weapon that has "item quality" which is why it doesn't affect vehicles.
That is weird. I’ve seen issues somewhat like this when messing with changing Localization.txt via modding. It seems (my belief) that some things persist unless you completely exit out of the game all the way to Steam. Like if you make a Localization.txt change, and don’t exit the game all the way to Steam, then the changes you made might not get applied.Made a new save, made a t1 stone axe and it worked. Ok, even more bizarre, after doing that I went back to my other 2 saves and the mod works now.
there is a “modded xml cache” (of sorts) the game creates… I wonder if either it doesn’t always get cleared or certain modding actions or files don’t trigger it to clear? Just me musing here if anyone reads this.
I think what you want is materials in the items file actually (not an expert). This looks to tell the game what the item scraps back to.hi all, I'm trying to make a modlet that makes everything scrapable but I'm not sure of the code this is what I'm trying to use
<set xpath="/items/item/property[@name='Weight' and (@value='0')]/@value">1,2,3,4,5,6,7,8,9,10</set>
any thoughts? thanks.