Factions problem

Simple faction problem I’ve encountered. My hostiles won’t attack ! They’re far too nice.

The hostiles in question are two sets of encounters where the faction is hostile. Hostile is clearly set to attack the PC in the table ( see below). however, the PC can walk up to them with no interest shown. If I attack they will respond.

Possible reason. I used creature wizard to create a leopard ( faction hostile ) and before finishing, in the Properties changed the pull down faction to Commoner. This leopard then becomes a henchman to the PC. Could this be affecting the PC’s relationship with hostiles?

Hostiles attack normally in a clean module.

  1. Nothing is wrong with your faction reputation settings.
  2. Set the creature(s) to be hostile in its/their blueprint(s).
  3. Set the encounter to be hostile to spawn its payload when an “enemy” (i.e. PC) steps over it.
  4. Hostile encounter can still summon PC-friendly creatures if you wish (see 1).

Thanks for responding. Sorry, I’ve maybe not been clear. The leopard created naturally is set as hostile but it is not intended to be hostile in this module as it becomes a henchman for the PC so after creating it I went back in and changed it to Commoner.

Great !

I didn’t want the leopard hostile though. So I set it to “Commoner” in the Advanced tab of Properties.

encounter is set as hostile and to be player activated.

The leopard isn’t spawned at the same time as the encounter. It joins the team after the first encounter that isn’t working and before the second.

Why don’t the goblins attack then ?

When the leopard joins as a henchman, they switch to the PC’s faction, so that can’t affect encounters.

Are the encounter creatures hostile, as indicated by the tab key? Or are they neutral until attacked?

I don’t use encounters much, but I seem to remember that there are issues if the creature templates are not the same faction as the encounter, or the encounter triggers within perception range.

If you mean do they appear as hostile (red) ? Yes.

They are goblins, hostile by their very nature and hostile on the advanced tab of properties. I’ve not touched that.

not sure what you mean here. Do you mean that if the encounter is close enough for them to be in sight of the PC naturally it won’t work - that’s possible. I’ll try moving them out of sight.


Final point. At the time of the first encounter with goblins the creature hasn’t even appeared ( happens much later).

OK, I get it now. The issue is that the encounter spawns hostile goblins that don’t attack the PC on sight. Did you check their OnPerception script? What happens when you spawn them from a trigger? It might be easier to just go with that to avoid the encounter hassle (ResRefs can be read by the script from trigger’s string variables).

Thanks again, @NWShacker.


No, I’ll do that in a minute. What should I see?

I’ve got four or five encounters in the module and my scripting skills are as weak as a goblin’s combat so I haven’t thought about that. If worst comes to worst I can place individual monsters around the place but I think I read that encounters are much lighter on the machine.

This might be your main issue.

I recommend to always create NPCs as a copy of an existing npc which is as close to what you want to do. Be it by appearance, class or challenge rating. Then modify the NPC as needed.

The problem with creature wizard is that it gives the npc starting items for given class and mainly 1.69 Horse feats. NPCs with Horse feats will freeze as AI will try to use the feat but it can’t. This is fixed in community patch btw, but it is simply better option to avoid using Creature Wizard. It is useless anyway.

Sounds likely.

Just tried moving the encounter well away from the PC. That didn’t change anything. Will try to use a stock leopard now.

Ok, stranger yet. I placed a single Goblin into the first scene ( the encounter is in the 2nd). I deliberately killed him ( sorry!)

Transitioned into the second scene for the encounter and I can still walk up to the Goblins safely.

also, removed the creature wizard created creature and no difference. Still no combat.

Tried a minotaur thinking it was a goblin problem but no joy.

So, what I think I know:

My settings are correct - ie. all creatures have hostile faction
My faction settings are correct
It’s not being affected by the creature wizard
It’s not a goblin problem as such - they are red and will attack if provoked
It’s not an encounter problem as such as it works in a clean module.

So, I’ve done something to knacker the settings in this module somehow.
I cant restart the module - I’ve come too far. Will now try calling the encounter from a trigger.

Are you using stock goblins or some custom blueprint? Did you modify any of the scripts they use? Verify by making a trigger and using this as its OnEnter:

void main()

It should spawn an agro gob.

No, no changes to goblins. Just went through encounter wizard, selected a few goblins and set it up in the normal way. This has been working a few module versions ago but I cant think what could have changed it. All I’ve really done faction wise is added a new faction of robber with a parent of hostile but set it so they are neutral to the PC to start with.

Will try that now.

No, sorry. It just spawned two goblins who seemed like very pleasant fellows :grinning:

My thinking now - and trust me it’s not on a high level, is that by making a new faction ( robbers) whose parent faction is hostile but I’ve altered their faction( robbers) to be neutral to start with to the PC ( to allow a conversation first) is affecting the PC relations with the actual hostiles ?

Try painting the same goblin on the map. Does it attack on sight?

Did you modify nw_c2_default2?

Nope. Just tried the above. Changed all the robbers to hostile and then removed the actual robbers faction . Saved. Close down the module. Went in and same result.

Ah, well done. Script in OnPerception is as below which I’m guessing is nothing like it should be as it is from Script Generator which I’ve used on several occasions although I cant remember if I’ve put anything into this specific slot.

Does this mean I’ve knackered the whole game’s OnPerception scripts?

 *  Script generated by LS Script Generator, v.TK.0
 *  For download info, please visit:
 *  http://nwvault.ign.com/View.php?view=Other.Detail&id=1502
// Put this script OnPerceived (of a creature).

void main()
    // We are only interested in "seen" events.
    if ( !GetLastPerceptionSeen() )

    // Get the creature who triggered this event.
    object oPC = GetLastPerceived();

    // Only fire for (real) PCs.
    if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )

    // Only fire once per PC.
    if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
    SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

    // Have "NW_GUARD" say something.
    AssignCommand(GetObjectByTag("NW_GUARD"), SpeakString("Hello, fine day !"));

This could be a castle guard I have but why would it appear in a goblin’s script?


Because all (?) stock non-henchmen creatures use it. See any stock blueprint. It’s easy to break the module by overwriting core scripts.


  • Save this script under whatever new name, say my_perception
  • Delete nw_c2_default2 from your script list
  • Find which creature has NW_GUARD tag and set my_perception as its OnPerception

That’s it !! I took a HELL of a beating !!!

Thank you so much . Copied an OnPerception script from a clean module’s goblin. No idea how an individual guard’s OnPerception script can end up on a goblin.

Must be that if you change one OnPerception in a module you change them all ?

Anyway, thanks again everyone who has tried to help .Life can go on . . .