[1.3] [KV] Weapon Storage [ModSync RW]

Started by Kiame, September 05, 2017, 05:46:47 PM

Previous topic - Next topic

Canute

Once you draft your pawn, you can choose to equip other weapon you assign him.
But undrafted he will continue to use the last weapon you told him to equip.
No automatical weapon switch.

Amnesiac

Quote from: Canute on September 24, 2018, 09:06:17 AM
Once you draft your pawn, you can choose to equip other weapon you assign him.
But undrafted he will continue to use the last weapon you told him to equip.
No automatical weapon switch.

Oh good, it works! So I am just dumb ;D this mod is awesome as heck, thank you.

Amnesiac

#122
I was able to duplicate weapons with this mod, after a series of events involving arresting a colonist, I took a single chain shotgun and ended with two. https://i.imgur.com/etjHxnn.png

I know that sometimes the weapon will show up on the list and then disappear when checked, but this time the duplicate did not disappear from the list: https://i.imgur.com/7FTW0fd.png

This is how it happened:


1. Colonist A with the Chain Shotgun went on a food binge. Colonist A was arrested by Colonist B.
2. Colonist B places Colonist A in a prisoner bed, and removes his weapons and equipment. (Including the chain shotgun)
3. Colonist B Hauls the shotgun to weapon storage box.
4. Reload save after this happened, got this error:

Log - https://git.io/fAh9O
Picture - https://i.imgur.com/jkPW38H.png

5. Colonist A is released, Checked weapon storage and two Chain Shotguns now exist.
6. This persists after restarting the game, and the weapons can be assigned to different colonists, while causing errors.

As long as the duplicate exists, every time you load the game, you get these errors shown in the picture above.




  • As for a temp solution:
In the end I was able to fix it by dropping the duplicates outside of the storage in a previous save (Before the prisoner was released, if after, still gives error) and saving, then reloading. I could also use the devmode to delete the duplicate and stop the error.

Edit: upon further testing, I actually have no idea how I fixed it the first time. I had to use the dev mode to destroy the duplicate in order to stop the errors, but in my first test I was able to do it as described above, but in my later saves, I tried doing the same thing and was unsuccessful.

As a side note, if you save while one of the duplicates is moved/equipped after dropping them out of storage, before reloading, this happens: https://git.io/fAh9A 
https://i.imgur.com/h0xu5bl.png

Hope this helps!

Canute

I am geting similar error and duplicate weapons.
I think everytime these  UIRootUpdate error pop up another duplicate got created (i think).
It happen many times so far.
I tryed to reproduce it with a test colony with just weapon storage and sparkling world but it didn't happen, or not at the beginning.
But Amnesiac don't use Sparkling world, and it happen with a vanilla weapon, i don't think anymore it is based on Sparking worlds.

It end up that pawn's got multiple assignments of the same weapons.
If you need logs you can use them from
https://ludeon.com/forums/index.php?topic=35503.msg434123#msg434123

Kiame

Thank you Amnesiac for the explanation of how the duplication happened. I will look into this. I have an idea about how this is happening

Amnesiac

#125
I did some more testing, and for me, it's happening when a pawn drops his currently equipped weapon, for some reason it's not becoming unassigned, creating the duplicate.

Kiame

#126
Update:
Fixed an issue that caused weapon duplication when pawns dropped their weapon.

Thanks for the help Amnesiac

J.BEAR

#127
Quote from: Canute on September 27, 2018, 06:37:45 AM
I am geting similar error and duplicate weapons.
I think everytime these  UIRootUpdate error pop up another duplicate got created (i think).
It happen many times so far.
I tryed to reproduce it with a test colony with just weapon storage and sparkling world but it didn't happen, or not at the beginning.
But Amnesiac don't use Sparkling world, and it happen with a vanilla weapon, i don't think anymore it is based on Sparking worlds.

It end up that pawn's got multiple assignments of the same weapons.
If you need logs you can use them from
https://ludeon.com/forums/index.php?topic=35503.msg434123#msg434123

hi Kiame, thanks for the mod and the updated duplicate fix
turns out i had duplicates of a legendary sniper and 12 copies of an excellent LMG lol
here's how i fixed my save game:

1.un-equip all guns for all colonists, drop on floor (just in case someone was holding a duplicate weapon, makes it easier to delete later)
2.empty all guns from all weapon storage on floor
3.find the offending duplicate weapon ID (ie. Gun_SniperRifle2476540)
4.go into save file, search and delete all duplicates [thing][/thing] until only 1 remain

my save file is now red/yellow error free on save and load

will let u know if i encounter dupe weapons again somehow

cheers

Kiame

Another way to fix it is to drop everything of the floor then have pawns put them into a weapon storage. When inserting if there is a duplicate it will just delete the duplicate


Edit haha now I'm second guessing myself. I'll double check this when I get on my computer

Canute

Nope, THIS way i tryed multiple times.
Unassigned all weapons.
Droped anything on floor.
Saved game, error's about duplicate item's
Load game, warning about the stack items, and the pile spread out over the room.

After all weapon's back in the storage, save, load but still error's.

J.BEAR

Quote from: Kiame on September 29, 2018, 11:58:40 AM
Another way to fix it is to drop everything of the floor then have pawns put them into a weapon storage. When inserting if there is a duplicate it will just delete the duplicate


Edit haha now I'm second guessing myself. I'll double check this when I get on my computer

i'm not 100% sure how i duplicated my weapons, but i think i was able to assign 2 pawns the same excellent LMG somehow. After game load it'd prompt me "Hunter has no range weapon" on one of the pawns.
I think i also lost a pawn crafted legendary charge lance somewhere in pocket dimension somehow and i had to mod it back in. no idea what happened.

Amnesiac

#131
Quote from: Kiame on September 28, 2018, 11:20:36 PM
Update:
Fixed an issue that caused weapon duplication when pawns dropped their weapon.

Thanks for the help Amnesiac

You're welcome!

Just updated and tested some things out, no issues with the weapons being unassigned now!

I did however, find another bug :-[ I was able to make a gun disappear and output an error:
https://git.io/fxfMP
https://i.imgur.com/zp7ftib.png

Steps:
1. Draft pawn, tell him to drop primary weapon (Which is a bolt action rifle, assigned to him. He also has another Shotgun, and Mace assigned to him.)
2. Tell pawn to pick up the just dropped Bolt Action Rifle.
3. Error occurs and Bolt Action disappears

In my testing, I noticed a few things which I think may be important;
1. If the pawn drops all his weapons, then picks up a weapon, this doesn't happen.
2. When a pawn has only 1 weapon assigned, no errors occurred as far as I could tell.
2. Only when he has assigned 2 or more weapons, then picks up a 3rd dropped weapon, does the error occur.

Sorry to do this to you! LOL

Kiame

Update:
Fixed the issue where the first weapon would disappear when picking up another weapon.

The current fix is not my preferred method but for some reason i can't get my preferred path to work.
This fix is currently: If a pawn tries to pick up a weapon, even if the original weapon is assigned to the pawn, the original weapon will be dropped on the floor. To assign weapons to a pawn the best way is to use the weapon storage's Assign Weapon to do that.

Canute

QuoteTo assign weapons to a pawn the best way is to use the weapon storage's Assign Weapon to do that.
Then please add elephant tust and thrumbo horn's to the storage filter ! :-)

Kiame

I guess it is time for me to figure out how add those 'weapons' dynamically to the filters....

I wonder what a tust is