Larian Banner
Previous Thread
Next Thread
Print Thread
Combat script works in one place but not another #636451
09/11/17 07:21 PM
09/11/17 07:21 PM
Joined: Nov 2017
Posts: 42
I
iwantcheese Offline OP
apprentice
iwantcheese  Offline OP
apprentice
I

Joined: Nov 2017
Posts: 42
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.

Re: Combat script works in one place but not another [Re: iwantcheese] #636478
09/11/17 11:14 PM
09/11/17 11:14 PM
Joined: Oct 2017
Posts: 78
United Kingdom
Branvex Offline
journeyman
Branvex  Offline
journeyman

Joined: Oct 2017
Posts: 78
United Kingdom
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.

Re: Combat script works in one place but not another [Re: iwantcheese] #636486
10/11/17 12:09 AM
10/11/17 12:09 AM
Joined: Nov 2017
Posts: 42
I
iwantcheese Offline OP
apprentice
iwantcheese  Offline OP
apprentice
I

Joined: Nov 2017
Posts: 42
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!


Powered by UBB.threads™ PHP Forum Software 7.6.2