How does this mod work (technically)? How can i change the spawn chances? How can i make a mod affect an NPC from some mod?

all information relates tolatest version.
it is better to read also the questions previous to your

How does this mod work (technically)?

The game has the following order: LvlAnimalForestPredator (NPC) uses as template LCharAnimalForestPredator (LeveledNPC), which in turn contains a
list of all (NPC) forest predators (EncWolf, EncBear, etc.)
Mod contains one script СhanceBasedNPCDisabler, which is attached to LvlAnimalForestPredator and other LvlAnimal NPC.
Script disable NPC with some chance, when the NPC is loaded. Chance is global value (SpawnChancePredator\Prey\AmbientCreatures), which is attached in script properties.
The script also ignores the NPC in the interiors.


What can be conflicts with mods?

This mod only changes the Lvl animals. Report if you find some mod that changes them.
This will be compatible with mods that change the stats, behaviour, etc. of animals, because Lvl animals use their as template.
This will be compatible with mods that modify vanilla LChar animal lists (for example, forest predators list).

if some mod attaches scripts to animals like EncWolf then my mod will make them invalid. You can try returning the "Use Script" flag and checking if my mod works in the game (despite the information
from the CK wiki, it worked for me, but I changed that just in case).
But don't worry about it. I have not found the scripts in the mods that are listed as compatible.


How can I change the spawn chances to my taste?

Very easily and quickly. You only need to change global values.
0. You need: good - TES5Edit | SSEEdit, normal - Creation Kit.
1. Open True Hunter.esp and open Global section.
2. There are three values that correspond to the three types of animals in game:

SpawnChancePredator - for all predators (wolf, bear, sabrecat, skeever, spider, troll, etc...);
SpawnChancePrey - for all prey (deer, elk, goat);
SpawnChanceAmbientCreatures - for "ambient creatures" (fox and rabbit).

The value is the spawn chance in percentage (0-100%). For example, if the
value is 20%, only about 1/5 of all animals of this type will spawn in
the game.
Of course, the value is not limited to 0-100. 0 and values less than 0 will not spawn animals at all.
100 and values greater than 100 will spawn the animals always (but you can simple remove some entries from esp for this).

These values are distributed in scipt properties for each leveled animal. You
can also add more values and other, see next question.

3. Сhange the value you need.


How can I customize the spawn chances even more?

You can adjust the spawn chances down to the individual values for each
leveled animal. Maybe you want a separate chance for animals in cold
climates? Maybe you want to make more deer than goats? You can do this
quite easily without editing the script.

I created three global values that correspond to the three types of animals in game. You can create more global values (short type). Of course, in order for this to work, you need to attach these values to the animals you need.
The script (ChanceBasedNPCDisabler.pex) is attached to each leveled animal. Global value is a script property.
So in order to replace one value with another, you need to change the
reference to the global value in script properties.

but you are limited in setting up chances this way. You can see the list of animals
that will spawn by LvlAnimal in the corresponding LChar list.
Accordingly, to change, for example, the number of wolves relative to
bears, you must edit the LChar lists (CK Wiki page).


How can I make a mod affect an animals from some mod?

All you need to do is add the script to the NPC and choose the appropriate global value as the spawn chance (maybe you want a standalone value?).
Script simply removes the NPCs with some chance so you can apply it to any NPCs (but it is better suited to non-unique (leveled) NPCs).

0. Find the NPCs you need. You can find them by name (includes "Lvl" prefix) or directly in the world as spawn point. Also they should use leveled NPC as template.
1. Attach the ChanceBasedNPCDisabler script to the NPC.
2. Go to script properties and set the global value you need. You may want to create a new value for the individual spawn chance.
3. If there are no scripts on template NPC, remove the "Use Script" flag. If the scripts is, test the patch at a specially placed NPCs.


Can I use it for other purposes?

If you want to use this to reduce the number of bandits or something like this, keep in mind that when reentry to the location, NPCs will be recalculated (enabled\disabled again). Unfortunately, this is the only way to make a temporary despawn. You can make the same script that will Delete() NPC instead of disabling.
Also don't forget that it ignores interiors.

Article information

Added on

Edited on

Written by

lilebonymace

0 comments

Top