Jump to content

(and more questions) Don't want my NPC to initiate dialogue if PC is hiding in shadows


jastey

Recommended Posts

What would I use if I don't want the NPC to initiate dialogue while the PC is hiding in shadows?

 

What else is there that would let my NPC hesitate to initiate conversation because he knows the PC is preparing an attack / wants to prevent a fight?

!StateCheck(Player1,STATE_INVISIBLE),

!StateCheck(Player1,STATE_IMPROVEDINVISIBILITY),

...?

 

Thank you!

Link to comment

There is a vanilla script InitInv.bcs for this purpose.

 

At least it exists in the EE's

 

 

IF
See([PC])
!StateCheck(LastSeenBy(Myself),STATE_INVISIBLE)
!StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(LastSeenBy(Myself))
END

IF
See(Player1)
!StateCheck(Player1,STATE_INVISIBLE)
!StateCheck(Player1,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player1)
END

IF
See(Player2)
!StateCheck(Player2,STATE_INVISIBLE)
!StateCheck(Player2,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player2)
END

IF
See(Player3)
!StateCheck(Player3,STATE_INVISIBLE)
!StateCheck(Player3,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player3)
END

IF
See(Player4)
!StateCheck(Player4,STATE_INVISIBLE)
!StateCheck(Player4,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player4)
END

IF
See(Player5)
!StateCheck(Player5,STATE_INVISIBLE)
!StateCheck(Player5,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player5)
END

IF
See(Player6)
!StateCheck(Player6,STATE_INVISIBLE)
!StateCheck(Player6,STATE_IMPROVEDINVISIBILITY)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
Dialogue(Player6)
END

 

Link to comment

TriggerOverride(target, trigger()) is a convenience construct used by WeiDU to mimic the ActionOverride() command. It's actually encoded as two consecutive commands NextTriggerObject(target) followed by trigger(). NextTriggerObject() is available for EE games and original BG2+TobEx.

Link to comment

Without TobEx, it's not possible to check the hiding status? Or how would I do that?

Nope, doesn't look like so. But you can include the install file library that is all that's needed for the install to happen, if it hasn't been installed yet. Just like the SCS, and other do it.
Link to comment

I have more questions to triggers / actions.

 

InPartyAllowDead() vs. InParty() - do I assume correctly that InParty() dies not give true if the NPC is dead?

 

Is there a trigger to detect whether an NPC already joined the group?

yes - to the first question

 

BeenInParty("DV*) - to second question (again this is EE only, EET uses it for the continuous NPCs feature). Not sure however it is what you need, as it is set for all NPCs that have ever joined, so not just current party. >>>>however you can create your own global to track if some NPC has joined and evaluate that, right?

Link to comment

BeenInParty("DV*) is what I meant, thank you. Yes, I could (and might) use my own variable.

 

And I didn't know about InParty() not giving true for a dead NPC. I need to rewrite some triggers (the few where someone reacts to a party member without initiating dialogue).

 

Thank you!

Link to comment

Are there any restrictions to SetDialog()? Could I, in theory, change the joined DLG to xxxP.DLG, and the out-of-party dialogue or the meeting dialogue to xxxJ.DLG by SetDialog() for the NPC (while he is in / out oft the party)?

Do the DLG names get resetted at some point (to what is defined in pdialog.2da), or does the set DLG stay active until it is changed by SetDialog() again?

Link to comment

PDIALOG.2DA (or other 2da files if referenced in CAMPAIGN.2DA) kicks in whenever:

- NPC joins party (JOIN dialogue set)

- NPC is kicked from party (POST dialogue set)

- game is loaded and NPC is in party (JOIN dialogue set)

 

So generally SetDialog() should be only used on CREs outside the party. This way dialogue is not reset unless NPC joins the party.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...