Jump to content

Weidu - NumTimesTalkedTo


Zoerkus

Recommended Posts

I'm aware of how to check if CHARNAME has already spoken to a NPC:

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0
    SAY ~Behold <CHARNAME>. Before you is the great Mendak, champion of the people of Cormyr, slayer of the dragon of the Great Mountain.~
    ++ ~May I ask what brings you to Candlekeep?~     GOTO 2
    +~Global("IZDagger","GLOBAL",2)~+ ~I got that dagger identified. Looks like its cursed.~ GOTO 4
    ++ ~My apologies, I didn't mean to disturb you.~ EXIT
END

Now, I'm also aware of how to make the check for if CHARNAME has indeed spoken to NPC:

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN 1
    SAY ~<CHARNAME> and his merry band of adventurers, hello again!~
    ++ ~May I ask what brings you to Candlekeep?~     GOTO 2
    +~Global("IZDagger","GLOBAL",2)~+ ~I got that dagger identified. Looks like its cursed.~ GOTO 4
    ++ ~My apologies, I didn't mean to disturb you.~ EXIT
END

This means I've to have two identical conversation blocks, once for the 1st encounter, and once for all following. The only difference is the SAY statement for the 1st greeting vs the subsequent.

I assume this is error prone. I've had a look at a couple of files decompiled via NearInfinity but there's very heavy state usage and I'm not quite getting it.

Is there a 'standard' approach for NPC interaction with something like first greeting, set a var, followup activities that avoids the re-copying of conversation logic?

Thanks again!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...