Author Topic: Banters Between NPCs and PC  (Read 1292 times)

Offline CoM_Solaufein

  • CoM Founder
  • Planewalker
  • *****
  • Posts: 184
  • Gender: Male
  • War is Peace, Freedom is Slavery, Ignorance is Strength
    • Chosen of Mystra
Banters Between NPCs and PC
« on: November 14, 2004, 04:24:19 AM »
I am trying to figure out how to code this. I have two npcs who are argueing with each other then the PC gets involved.

NPC1 ~I don't like you.~
NPC2 ~If you don't like me then leave.~
NPC1 ~Maybe I'll just kill you instead.~
NPC2 ~Yeah try it!~
NPC1 ~Ok you asked for it!~
NPC2 ~Help me <CHARNAME>!~
Option 1 ~Now what?~
Option 2 ~Knock it off you two!~
Option 3 ~Good a fight! Lets get it on~
Remaining PC dialogues are with NPC2

So how would I code this?

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Banters Between NPCs and PC
« Reply #1 on: November 14, 2004, 05:59:41 AM »
CHAIN
IF ~Global("SomeVariable","GLOBAL",0)~ THEN NPC1DialogFile SomeDialogState
NPC1 ~I don't like you.~ DO ~SetGlobal("SomeVariable","GLOBAL",1)~
==NPC2 ~If you don't like me then leave.~
==NPC1 ~Maybe I'll just kill you instead.~
==NPC2 ~Yeah try it!~
==NPC1 ~Ok you asked for it!~
==NPC2 ~Help me <CHARNAME>!~
END
++ ~Now what?~ EXTERN NPC2 NPC2dialogState1
++ ~Knock it off you two!~ EXTERN NPC2 NPC2DialogState2
++ ~Good a fight! Lets get it on~ EXTERN NPC2 NPC2DialogState3
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: Banters Between NPCs and PC
« Reply #2 on: November 14, 2004, 04:41:38 PM »
You don't need NPC1 on the first line of dialogue. It should just look like this:

~I don't like you.~ DO ~SetGlobal("SomeVariable","GLOBAL",1)~

For the NPC reply to your reply, simply CHAIN again.

CHAIN NPC2DialogFile NPC2dialogState1
~He's mean to me!~
== NPC1 ~So what if I am?~
== NPC2 ~Whaah!~
END
++ ~PC reply.~ NPC2DialogState4


You only have to EXTERN in the first dialogue because you're going to a state that does not belong to the person who started the CHAIN. If all those replies went to an NPC1 state, you could just do this:

END
++ ~Now what?~ NPC1nowwhat
The color of infinity inside an empty glass.

Offline CoM_Solaufein

  • CoM Founder
  • Planewalker
  • *****
  • Posts: 184
  • Gender: Male
  • War is Peace, Freedom is Slavery, Ignorance is Strength
    • Chosen of Mystra
Re: Banters Between NPCs and PC
« Reply #3 on: November 15, 2004, 07:03:35 PM »
Thanks

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: