Larian Studios
Posted By: Ikul Having a friendly turn hostile - 09/12/15 01:17 AM
I'm trying to implement the following behaviour:
Through dialog choices, the player antagonises a (friendly) NPC to the point of that NPC attacking them.
None of the other NPCs that are nearby get involved in the fight on either side.

Is there an elegant way to implement this?
Posted By: SniperHF Re: Having a friendly turn hostile - 09/12/15 01:56 AM
Whether the other NPCs get involved or not I think depends on their alignment. I haven't tried to make such a scenario so you'll have to figure that part out unless someone else knows a way.

The way I normally do it is this:
CharacterSetFaction(CHARACTER_NPC,"Evil NPC");


There's also:
CharacterSetTemporaryHostileRelation

The second one might be more up your alley for this particular scenario. Never used that call though myself.


Also you might have to do the same thing from the other thread, set the calls for on DialogEnded. If you set hostile during dialog it will kill the dialog. Which might be okay depending on what you are trying to do.

Posted By: Ikul Re: Having a friendly turn hostile - 09/12/15 06:58 AM
Yeah, Evil NPC is a good way and I've used it in another place, but the problem is that the civilians join in on your side when you do this. I need them to just walk past and not take a side.
© Larian Studios forums