Companion Backpack Carry Weight Bug

Post » Sun Jul 03, 2011 4:21 pm

I posted this up on another forum but got no answers, hoping to get one here. (Kinda big post incoming.)

Hello everyone,

I know some of you are using backpack mods such as BlackWolf's or the Leather Backpack. You are mostly aware that, if you give one of them to your companion, it's max carry weight will always increase by the amount the pack gives each time you trade with them. Since I made a personal mod that reduces the max carry weight, and requires you to get a backpack to have a decent storage, this really irks me as my companions are also wearing backpacks.

First thing I thought about was adding a ''counter'' backpack, which would remove the amount lbs. that the backpack would give. I'll give you an example:

This item is a clothing item, much like the backpack, with no visible model added on the character, just an effect (-75lbs. which is the inverse of what my Leather Backpack gives). Give the regular backpack to the companion, he/she gains + 75lbs. Re-trade with him/her, but give them the ''counter carry weight'' item. Worked flawlessly; every time I access his/her backpack, it stays at 150(or whatever it should be.)

The problem lies elsewhere, as sometimes, even though the carry weight is stalled, it increases without me accessing the trade menu.

Now, because of this, I thought about another possible way to counter this ''bug''. If I could make a perk like ''Strong Back'', but is only added while the backpack is equipped. If the pack is unequipped, the perk is removed.

Since I'm very very bad at making scripts (I'm way better at creating cells and using available assets to create something entirely different), I'm looking for someone to help me create this object script. (I did try though, and the stupid Geck not showing error messages is even worse on me.)

Thanks everyone. (And sorry for the long write-up.)
User avatar
sam
 
Posts: 3386
Joined: Sat Jan 27, 2007 2:44 pm

Post » Sun Jul 03, 2011 3:23 pm

I just use ForceAV on my companion to get around the effect stacking bug. Don't ever use ForceAV on the player, though. And once you use it on your companion, you are stuck with using it to make any change.

You could try putting this script on the backpack:

scn MyBackpackLimitScriptref rActorREFBEGIN OnEquip	set rActorREF to GetContainer	if (rActorREF) && (rActorREF != Player)		rActorREF.ForceAV Carryweight 150	endifENDBEGIN OnUnEquip	if (rActorREF) && (rActorREF != Player)		rActorREF.ForceAV Carryweight 100	endif	END

User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Sun Jul 03, 2011 7:17 am

The perk idea makes sense, though. Use Player.Addperk Perk 1 to add a given perk to the player's companions; call that in the OnAdd block of the backpack, conditionalise the perk's effects on "GetItemCount Backpack", bingo.
User avatar
Lance Vannortwick
 
Posts: 3479
Joined: Thu Sep 27, 2007 5:30 pm

Post » Sun Jul 03, 2011 3:03 pm

Well I made this, doesn't work, but it's a start.

scn LeatherBackpackCompanionScriptBEGIN onAdd				If player.GetItemCount LeatherBackpackWithMattressForCompanions == 1				player.addperk LeatherBackpackPerk 1		endifENDBEGIN onAdd		If player.GetItemCount LeatherBackpackWithMattressForCompanions == 0				player.removeperk LeatherBackpackPerk 1		endifEND


It's very much possible that everything in that script is wrong. Still got a ton of stuff to learn. Now the thing I don't get is how to get the ref id of the companion equipped with the Backpack instead of just ''player.''. Thanks a bunch for the help.

Got myself the Geck Power Up, helps a lot in the removal of script errors.
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Sun Jul 03, 2011 2:19 pm

Well I made this, doesn't work, but it's a start.

scn LeatherBackpackCompanionScriptBEGIN onAdd				If player.GetItemCount LeatherBackpackWithMattressForCompanions == 1				player.addperk LeatherBackpackPerk 1		endifENDBEGIN onAdd		If player.GetItemCount LeatherBackpackWithMattressForCompanions == 0				player.removeperk LeatherBackpackPerk 1		endifEND


It's very much possible that everything in that script is wrong. Still got a ton of stuff to learn. Now the thing I don't get is how to get the ref id of the companion equipped with the Backpack instead of just ''player.''. Thanks a bunch for the help.

Got myself the Geck Power Up, helps a lot in the removal of script errors.

You can't add perks to NPCs- you can only add them to the player, or to a list the player has that's applied to their companions- hence player.AddPerk Perk 1 to signify 'Add this to the player's companion perk list'.
That's also why you don't need to bother adding/removing it individually- just conditionalise the increased carry weight on GetItemCount YourBackpack.

Either way that script is kind of off kilter- you don't normally put in two of the same blocktype, and the Player.GetItemCount you have in the first one will fail if the player has 2 or more copies of the backpack. You'd want if(getItemCount item != 0), which can be shortened to the marginally more efficient if(getItemCount item), so if you were going to use that it would be:
begin OnAdd if Player.GetItemCount LeatherBackpackWithMattressForCompanions    player.addperk LeatherBackpackPerk 1else   player.removeperk LeatherBackpackPerk 1endifend

Although all you actually need is
begin OnAdd    player.addperk LeatherBackpackPerk 1end
As you can put the conditions on the perk, and it'll check all of the player's companions and apply the perk's effects to those who meet the conditions. If they stop meeting the conditions, the effect should stop running on the individual that no longer meets conditions.

I think you need to re-add the perk to make it apply to new NPCs, but if that's the onAdd script for the item the perk will get reapplied and checked every time you give a backpack to someone.
If it still doesn't work, the Increase Carry Weight perk entry may not work on NPCs, so instead use the perk to add an ability with the effect Increase Carry Weight.
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm


Return to Fallout: New Vegas