Larian Studios
Why is it that this will start combat when I enter a trigger

---------------------------------------------------

IF
CharacterEnteredTrigger(_Character, TRIGGERGUID_Enter_Histerix_House_44361b57-9ab5-4447-9531-54d2042f36e4)
AND
CharacterIsPlayer(_Character, 1)
THEN
DisplayText(_Character, "Entered house");
ProcMakeNPCHostile(_Character, CHARACTERGUID_Eldithas_Histerix_3347b77a-4b37-40e7-9e36-60caef04cbe8);

-------------------------------------------------------

but this will not start combat when a flag is set?

-------------------------------------------------------

IF
ObjectFlagSet("Eldithas_Fights_Player", (CHARACTERGUID)_Character, _)
AND
CharacterIsPlayer(_Character, 1)
THEN
DisplayText((CHARACTERGUID)_Character, "Flag Set");
ProcMakeNPCHostile(_Character, CHARACTERGUID_Eldithas_Histerix_3347b77a-4b37-40e7-9e36-60caef04cbe8);

-------------------------------------------------------

The DisplayText() does appear in that second set of code, so the flag is being set, but the combat doesn't start even though it does with the first bit of code and that call is identical between the two.
Is the flag being set in a dialog? Maybe wait til the dialog is ended first.

Code
IF
DialogEnded("dialogName", _)
AND
DB_IsPlayer(_Player)
AND
ObjectGetFlag(_Player, "Eldithas_Fights_Player", 1)
THEN
DisplayText(_Player, "Flag Set");
ProcMakeNPCHostile(_Player, CHARACTERGUID_Eldithas_Histerix_3347b77a-4b37-40e7-9e36-60caef04cbe8);

Could use
Code
SetFaction(CHARACTERGUID_Eldithas_Histerix_3347b77a-4b37-40e7-9e36-60caef04cbe8,"Evil NPC");
to make them hostile too.
That worked! THANK YOU! :)

Setting the faction also fixes the other issue I was having with the kid demanding reparations instead of being scared. So double-thanks!
© Larian Studios forums