Jump to content

Nesting NPC_model.ymt


SAC
 Share

Recommended Posts

 

Is it possible to make a nested / "foreign reference" NPC model ymt?

 

Something like:

 

sac_model.ymt

 

<blah>

<outfits>

   [a_f_m_btchillbilly] (existing model ymt)

   [a_f_m_sdchinatown] (existing model ymt)

   [... etc]

</outfits>

</blah>

 

 

My Fallout 4 and Skyrim mods: SAC - LoversLab

 

Link to comment
Share on other sites

20 minutes ago, HughJanus said:

I dont think so, but you can replace the original one with your modified one (in which you add whatever you would like to add) using lml.

Or am I missing the point?

 

True, and I'm going to share my custom ymts at some point. They can be put in \lml\stream, no need for a replacer xml

 

However, it is extremely difficult to maintain. For instance, let's say you want an ymt which references females from various populations. Any modification you make to any of the populations you want to reference, you will need to replicate in your "master" ymt. This gets very complex, very fast, as you reference more NPC models and you make more modifications to them (as I am frequently doing).

 

Of course, scripting make this easy (after the brutal initial learning curve), do a map (array) 😛 of the populations you want to spawn, then proceed to random spawning from that map. 

 

 

string SAC_return_random_female_model()
{

    std::map<int, char*> female_models;

    female_models[0] = "sac_female";

[...]

    female_models[31] = "a_f_o_waptownfolk_01";

    return female_models[(rand() % female_models.size())];

}

[..]

    char const* mymodel = SAC_return_random_female_model().c_str();

    Ped myPed = spawnPed((MISC::GET_HASH_KEY(mymodel)), vfront.x, vfront.y, vfront.z);

 

(abbreviated)

 

 

There is another weird effect to maintaining a monolithic ymt. Let's say I stack 2 NPC models in one ymt (10 variations each, for the sake of the example). The weird effect is when I spawn from that ymt in-game, the game randomizer will pick a lot of successive outfits from the first model, then switch to the other model and produce a lot of variants from the second one. I don't understand it, but it's a fact. I was able to randomize better by scripting

 

PED::_SET_PED_OUTFIT_PRESET(pedSpawn, (std::rand() % (PED::GET_NUM_META_PED_OUTFITS(pedSpawn) - 1)), false);

 

Useful reference for scripting spawns here: https://www.rdr2mods.com/forums/topic/1296-solved-how-to-spawn-ped-from-c-script-hook/

 

 

  • Like 1

 

My Fallout 4 and Skyrim mods: SAC - LoversLab

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...