Jump to content

Replace NPC Armor on Death


daisy8

Recommended Posts

Hey there

 

Does anybody have a script that will replace an NPCs armor after they die ?

 

For example a living Gunner has "leather chest" piece and after you shoot him to death, looting him only finds a "damaged leather chest" piece with worse stats. Just need the game to swap one bit of armor for another on death.

 

I have been trying to get the event ondeath to work but nada.

 

Cheers !

daisy

Link to comment
Share on other sites

I'm not familiar with such a script , but there is another way to do this , though it's probably a bit less elegant

what you could do is create unplayable versions of the normal armors , and replace the entries in the leveled lists with these . this will make NPCs spawn and use these , while not allowing users to loot these

make sure that the NPC will spawn with both the unplayable proper version and the playable damaged version , and you should get the same effect

 

the script way is probably possible , but you'll need someone with more experience to help with this

but hopefully you can try out my idea , hopefully that'll work for you , at least for now

Link to comment
Share on other sites

If you would like to consider the script route, you need to describe what NPCs are affected and you will be getting a reference to them:

 

Is this any NPC in the world wearing armor, any NPC in the world using specific actorbases, in specific locations, factions, only NPCs spawned by you ... what ?

Link to comment
Share on other sites

Assassin, thanks for the reply. I think that should work. I had not thought to use the unplayable type.

 

SKK, the Armor replacement will only need to be on a couple of my own created NPCs. I have created an armoured hazmat suit for use by only two or three NPCs and once killed, to make them realistic, I just want the player to find a damaged suit, because it would be if the NPC was shot.

 

I will give it a try and report back.

 

Cheers

daisy

Link to comment
Share on other sites

Have tried not playable armor idea with the CK and it works perfectly, except for one thing.

 

This is what I did and the results.

 

I changed the hazmat suit I created to not playable and made the outfit for my NPC this hazmat suit. I also included a damaged hazmat suit in his inventory. In the game the NPC wears the hazmat suit I created, and benefits from all the good things about it, and then when killed the only clothing that shows up when the player loots him is a damaged hazmat suit. Perfect, except for one thing - when the player takes the damaged suit, the NPC corpse does not loose his clothing visually. So when you take his clothes, they don't come off his dead body.

 

I think the way to do this is a little script on my created NPC with some properties - one the armored hazmat suit (worn while alive) and another the damaged one (worn when dead). Then ondeath remove one and add the other. Any good ?? I think maybe the changes might need to be made on the actual outfit, not just the armor. That way when the armors are swapped over the NPC corpse will be wearing the damaged suit, not just have it in his inventory.

 

Cheers

daisy

Link to comment
Share on other sites

Another thing that might work is to have the armored hazmat suit as not playable, include a playable damaged suit in his inventory and when the damaged suit is removed by the player remove the armored suit from the NPC. One problem with this might be again that the armored suit isn't actually in his inventory, but in his outfit.

 

Waddya think ?

Link to comment
Share on other sites

The main quest does exactly this between pre and post war cryo, just need to wrap it in Event OnDeath()

 

;swap to postwar vault suits
PlayerREF.AddItem(pArmor_Vault111_Underwear, absilent=true)
PlayerREF.EquipItem(pArmor_Vault111_Underwear, absilent=true)
PlayerREF.RemoveItem(Armor_Vault111Clean_Underwear, absilent=true)
Link to comment
Share on other sites

That works great !

 

Thanks guys. Below is my script.

Scriptname ADZHazmatSwap01Script extends Actor
{Changes the armor of a dude when he is killed}

Armor property pADZArmor_HazmatSuitARMORED auto const
Armor property pArmor_HazmatSuitDamaged auto const

Event OnDeath(Actor akKiller)

	Self.RemoveItem(pADZArmor_HazmatSuitARMORED, absilent=true)
	Self.AddItem(pArmor_HazmatSuitDamaged, absilent=true)
	Self.EquipItem(pArmor_HazmatSuitDamaged, absilent=true)

EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...