Jump to content


Photo

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


24 replies to this topic

#1 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 16 February 2017 - 09:03 AM

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!


Edited by jastey, 17 February 2017 - 01:02 AM.


#2 Roxanne

Roxanne
  • Modders
  • 1144 posts
  • Gender:Not Telling

Posted 16 February 2017 - 09:32 AM

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

 

At least it exists in the EE's

 

Spoiler


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2497 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 16 February 2017 - 12:49 PM

!TriggerOverride(Player1,ModalState(STEALTH))


"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#4 Roxanne

Roxanne
  • Modders
  • 1144 posts
  • Gender:Not Telling

Posted 16 February 2017 - 01:26 PM

!TriggerOverride(Player1,ModalState(STEALTH))

Does that work for old game as well? Or only EE?


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#5 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5918 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 16 February 2017 - 01:39 PM

Does that work for old game as well? Or only EE?

Looking at the extended IESDP, will tell you that at least the ModalState(STEALTH) part works in both games... don't know about the TriggerOverride -command... but that's for you to try out.


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.

Here's how to install all the stable mods you ever really could want to Infinity Engine games.


#6 argent77

argent77
  • Modders
  • 616 posts
  • Gender:Male

Posted 16 February 2017 - 03:22 PM

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.
 



#7 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 16 February 2017 - 09:17 PM

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



#8 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5918 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 17 February 2017 - 12:08 AM

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.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.

Here's how to install all the stable mods you ever really could want to Infinity Engine games.


#9 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 17 February 2017 - 12:55 AM

Thank you all!



#10 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 17 February 2017 - 01:02 AM

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?



#11 Roxanne

Roxanne
  • Modders
  • 1144 posts
  • Gender:Not Telling

Posted 17 February 2017 - 01:11 AM

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?


Edited by Roxanne, 17 February 2017 - 01:24 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#12 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 17 February 2017 - 02:15 AM

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!



#13 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 17 February 2017 - 05:51 AM

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?

#14 K4thos

K4thos
  • Modders
  • 876 posts
  • Gender:Male

Posted 17 February 2017 - 06:02 AM

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.


Edited by K4thos, 17 February 2017 - 06:07 AM.


#15 jastey

jastey
  • Gibberlings
  • 6510 posts
  • Gender:Female

Posted 17 February 2017 - 06:22 AM

Cool. Thank you!





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users