Jump to content

Custom Armor Invisible Only When Added Via Script


MxBurin

Recommended Posts

I'm trying to make a quest where you have to retrieve a piece of armor/clothing from a mannequin, imitating the Silver Shroud quest. I've created this armor as a modified version of a piece of clothing from another mod. I have a set of activators (parented together) that use the world models for the armor. They're in the attic of a store in Concord outside the museum. When activated, they set a quest stage that spawns and adds to the player the two pieces of clothing (marked as quest items).

 

The clothing is successfully spawned and added to the player. However, when I equip it, the armor is invisible.

 

If I place the armor on the ground elsewhere and just pick it up, it works fine and is visible when equipped. Armor acquired through the script, however, is invisible; even worse, if I try to wear any pieces of armor that share the same model and material, they too are invisible. It seems as if I can mess around with different pieces of armor and eventually get them to become visible again, but I don't have a reproducible method for doing so.

 

Is there something about how armor can be spawned in and added that makes it not display properly? Maybe to do with resources not loading in right?

 

Below is the code used to add the items, based on the Silver Shroud MS04 quest code:

ObjectReference oClothing1 = Game.GetPlayer().PlaceAtMe(PClothing1)
AliasClothing1.ForceRefTo(oClothing1)
Game.GetPlayer().AddItem(oClothing1)


ObjectReference oClothing2 = Game.GetPlayer().PlaceAtMe(PClothing2)
AliasClothing2.ForceRefTo(oClothing2)
Game.GetPlayer().AddItem(oClothing2)

 

Link to comment
Share on other sites

I don't think adding to the inventory via script causes the armor to be invisible. You may want to investigate the body slots in use. FO4 should be similar to Skyrim in this regard. A piece of armor has three locations for body slots to be assigned (NIF file, armor record and armor addon record). One slot must match on all three (essential), but the armor records and armor addon records can have additional slots (non-essential). These additional slots can sometimes cause conflict between various armor items. The armor addon record has a priority value which determines what piece gets to be visible when more than one item sharing a non-essential slot is equipped. What happens when two or more items are equipped with the same priority value? Unsure to be honest. I would suspect that the game might prioritize the newly equipped but I suppose it could freak out and not show anything.

 

Might I make a suggestion which may make things a bit easier for you in the long run. Add a container outside the playable area where you have the activators. Use your quest aliases to spawn a copy of the armor objects inside the container. Then when the activator is triggered you can transfer the armor items directly to the player using RemoveItem.

Link to comment
Share on other sites

I think I've narrowed down what's making the clothing act odd: I've been using the clothings' biped model as the model for the activators, so that it looks as if it's being worn by the mannequin. Somehow this means that the same model doesn't want to show up on the player. If I change the activators to use some other random models, the clothing works fine (which also means it's not an issue with mismatched clothing slots).

 

Is there some good way to use a piece of clothing's biped model for an activator without causing this issue? I'd prefer to have the clothing be displayed on a mannequin and skip all of this, but the mannequins from the DLC seem to have their own issues when using custom bodies.

Link to comment
Share on other sites

I ended up making a mannequin based on the armor rack from the Contraptions DLC and accepting that players who care would need to add a mod to fix its texture issues. When the clothing is displayed properly on the mannequin, it doesn't end up having the issue with invisibility when you wear it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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