Kenshi
Talk to shopkeepers while in disguise
Chaste  [developer] 9 Jan, 2024 @ 10:52am
Dialogue Condition Notes and Observations
(This is all for EV_PLAYER_TALK_TO_ME)
  1. DC_PERSONALITY can only detect the NPC's personality, NEVER the player's. T_ME, T_TARGET, T_TARGET_IF_PLAYER does not matter; it will only detect the NPC's personality.

  2. DC_BOUNTY_AMOUNT_ACTUAL requires T_TARGET or T_TARGET_IF_PLAYER to detect player's bounty, even if THE PLAYER IS THE ONE TALKING (choosing dialogue option).

  3. In essence, T_ME is ALWAYS the NPC, T_TARGET or T_TARGET_IF_PLAYER is ALWAYS the PLAYER, no matter if the one speaking is the NPC or the PLAYER.

  4. No need to add effect REMEMBER_ME so they will remember you. As long as you talk to them once, they will remember you forever. Use DC_MET_TARGET_BEFORE with DC_TARGET_LAST_SEEN_X_HOURS_AGO to see the expected function. If X hours pass and your condition is X<time passed, when they talk to you, it's as if they haven't met you before, unless there's an explicit dialogue that has the ONLY condition DC_MET_TARGET_BEFORE.

    It has a chance to bug though if DA_REMEMBER_CHARACTER is not in effect. The NPC will not remember correctly how many hours passed already since they saw the player.

  5. Sidebar condition "target has item" can only detect if PLAYER has ITEM. Again, TARGET is always PLAYER in EV_PLAYER_TALK_TO_ME.

  6. Sidebar condition "has package" means HAS DIALOGUE PACKAGE. This is very useful to allow specific dialogue to trigger to a group of NPCs that use the same dialogue package. inheritsFrom is not counted as dialogue package that NPC has. Only those that are directly added to the NPC.

  7. DC_IN_COMBAT. If set to T_ME, this detects if the NPC is in combat. If set to T_TARGET or T_TARGET_IF_PLAYER, this would NEVER detect if the PLAYER is in combat. Once the player initiates dialogue, it is automatic NOT IN COMBAT.

  8. DC_IN_MY_BUILDING. If set to T_ME, this detects if the NPC is inside THEIR building. In any case that the NPC is moved to a different building, this condition will become FALSE. However, if the NPC is separated from its original squad, this will ru TRUE while inside ANY building.

    If set to T_TARGET or T_TARGET_IF_PLAYER, it runs as expected (only TRUE if PLAYER is in the NPC's building.

  9. EV_I_SEE_ENEMY_PLAYER and EV_I_SEE_NEUTRAL_SQUAD somehow does not work for NPCs when player is in disguise...

    There is no specific condition that detects if player is in disguise or not. Yes, it's very sad. And that's why this next keypoint is very important.

  10. DC_COPS_AROUND. T_ME detects if there are cops inside the NPC's building. Rings true if NPC is in OWN building. "COPS" pertain to OT_MILITARY and OT_LAWENFORCEMENT characters. Units belonging to the NPC's own squad is not counted as "COPS". However, I brought an NPC inside the police station and the NPC failed to recognize the cops. There is an additional condition though before this rings TRUE, and I'm trying to find it out.

Take note this is only tested for shopkeepers (those inside shops, not necessarily OT_TRADER), so it might be different to other NPC classes.
Last edited by Chaste; 9 Jan, 2024 @ 10:55am