Jump to content

Recommended Posts

Posted (edited)

I'm developing a mod that aims to enforce behaviour packages onto npcs dynamically during combat gameplay in fallout 4. 

The process is as follows:

  1. Quest with RefCollectionAlias starts when OnCombatStateChanged is fired.
  2. RefCollectionAliasses filled with their respective Races (supermutants, humans, etc...) using simple conditions and "Loaded Area" criteria.
  3. keywords in the player will drive which packages the NPCs will use, and I cycle through their collection to EvaluatePackages using scripting when the player gets updated.

My question is, how do I efficiently update these aliasses if another NPC is loaded into the game/current cell?

  1. Is there an event I can register to to keep track of newly loaded NPCs? Maybe the Encounter Zone or the cell itself?
  2. When I can isolate this NPC, I'm assuming I have to use forceRefto to one of these RefCollectionAlias? Do I first add a new to the RefCollectionAlias before forcing ref to (to avoid overwriting a previously existing element)
  3. or should I just stop-start the quest? Is that more efficient?

Cheers and thanks in advance!

Edited by africanwarhead
added extra detail...
Posted (edited)

There is AddRef and RemoveRef for RefColl, ForceRef is for singular. AddRef won't create duplicates in collection. Could possibly use Cloak to update collection when it hits a new actor.

Ps. Why asking this in Discussion?

Edited by hereami
  • Recently Browsing   0 members

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