Jump to content

Custom NPC with custom clothes


GensoII

Recommended Posts

Not sure if I worded this right.

 

I'm making a custom companion in Fallout CK. The problem I'm having now is getting the NPC to use a custom outfit.
I downloaded this mod: Evil Detective. (CBBE. JaneBod. Vanilla) at Fallout 4 Nexus - Mods and community and made it into an outfit in CK.
The outfit appears in the actor form for my NPC but whenever I go in game, the NPC spawns naked.
I tried with vanilla clothes and it works fine.

Link to comment
Share on other sites

When you open the CK with multiple plug-ins they are assigned a 'Temporary Form ID Prefix' (the first two digits of the Form ID). When you run the game, the plug-in your using things from will most likely have a different ID than it did in the CK.

 

The game can't find those items because they're at a different ID. You will either need to copy those items from the other .esp into yours, and use the items from your .esp in the outfit record (which is a big NO-NO if you don't have permission from the author to copy their work).

 

OR you will need to code a script to find those item IDs (hint: GetFormFromFile()), spawn them, and equip them on the NPC_. This isn't as hard as it may sound, just add a script to the NPC_ that runs OnInit(). You will in this case also have to note the other .esp as a 'Dependency' for your mod.

 

If it were me I'd avoid using someone else's items unless this is just a mod for your own personal use.

Link to comment
Share on other sites

I see. Thanks for the info. This is just a personal mod.

Not really familiar with Papryus language but I'll see what I can do.

Also, I'm a little lost on where should I write the script. Right now, I created a new script in the Actor form of my NPC. Is it the right spot or do I have to create an external script and call it in the actor form?

Link to comment
Share on other sites

If you're just using it for yourself, I'd go with copying those items to your .esp. No scripting required.

 

You might be able to make it as simple as copying the Armor Add-On and Armor records. They will likely still point to loose files in the other mod's folder, but should still work. Since you aren't redistributing this mod you don't have to worry about loose files in odd places.

 

To be sure you're thorough, right click on a record (in the original .esp) and choose 'Use Info' to help you make sure you've copied everything you need. *EDIT* you may see NPC_ records in 'Use Info', for characters that are 'wearing' an armor, which you don't want to copy. I mentioned this really as a way to help you learn to 'reverse engineer' whats going on with the records, just an interesting thing to poke around in.

 

Does that make sense enough to get you started?

 

To answer your question, yes you would write and place that script on the NPC_ record. So that the script would only apply to actors that use the given form as their base.

Edited by MasterMagnus
Link to comment
Share on other sites

It seems I hit a wall again.

The script runs fine. Except for the equipping part.
I used EquipItem() but somehow it doesn't want to equip to my NPC. I tested it out with reference to the Player and the MC immediately equips the outfit once I load any save.

Tested out with AddItem() for the NPC as well and it runs fine. The outfit gets added to the inventory.

*EDIT*
Attempted to use vanilla clothing. Failed as well.

Edited by GensoII
Link to comment
Share on other sites

If this mod is for personal use and you don't know how to script, simply convert that Evil Detective esp into esm and use it as a master.

 

Or add those meshes manually to your esp and throw them into an outfit. No scripts needed. Problem solved.

Link to comment
Share on other sites

If this mod is for personal use and you don't know how to script, simply convert that Evil Detective esp into esm and use it as a master.

 

Or add those meshes manually to your esp and throw them into an outfit. No scripts needed. Problem solved.

Link to comment
Share on other sites

I was hoping if I could do the script, then I wouldn't have to edit anything on the outfit mod.

I'm still trying out different lines of code to see. So far I got the vanilla clothes to work with the script but it's not consistent. Sometimes he spawns with clothes on and sometimes he's naked.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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