Author Topic: CHAIN or Not  (Read 2662 times)

Offline CoM_Solaufein

  • CoM Founder
  • Planewalker
  • *****
  • Posts: 184
  • Gender: Male
  • War is Peace, Freedom is Slavery, Ignorance is Strength
    • Chosen of Mystra
CHAIN or Not
« on: April 17, 2004, 09:15:32 PM »
Can you use a chain on a character that is not an NPC? What I want to do is have a villian start talking to a npc when they see them. They chat and then it ends, then the villian talks to the PC before hell breaks out. Or would I be better off using INTERJECT?

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: CHAIN or Not
« Reply #1 on: April 17, 2004, 11:08:50 PM »
You can use CHAIN (Non-joinable characters are still NPCs), and I think that'd be easier for the scenario you describe.
Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

             --Neil Gaiman, Terry Pratchett, "Good Omens"

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: CHAIN or Not
« Reply #2 on: April 18, 2004, 12:24:00 AM »
Would you also need to use WEIGHTS in this situation?
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: CHAIN or Not
« Reply #3 on: April 18, 2004, 03:01:46 AM »
Thats good. I've never seen an example that I recall it being used on a party npc and a non party npc.

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: CHAIN or Not
« Reply #4 on: April 18, 2004, 10:25:26 AM »
Would you also need to use WEIGHTS in this situation?

Off the top of my head, no. If the villain NPC has the first line, you'd script them to initiate dialogue with the NPC, and the conditions you use should handle it. The code would look something like this (Something, because I can always be wrong, wrong, wrong. :) ):

In your villain's script:

IF
   Global("VillainNPC1", "LOCALS", 0)
   See("NPC")
   InParty("NPC")
   
THEN
   RESPONSE #100   
      StartDialogueNoSet("NPC")
END


In your .d for the villain:

BEGIN ~VILLAIN~

CHAIN
IF ~
Global("VillainNPC1","LOCALS",0)
InParty("NPC")
See("NPC")
!StateCheck("NPC",STATE_SLEEPING)~ THEN VILLAIN YouMustPayTheRent
~You must pay the rent!~ DO ~SetGlobal("VillainNPC1","LOCALS",1)~
==NPCJ
~I can't pay the rent!~
==VILLAIN
~You must pay the rent!~
==NPCJ
~I can't pay the rent!~
==VILLAIN
~You must pay the rent!~
END
++ ~I'll pay the rent!~ GOTO Curses

IF ~~ THEN BEGIN Curses
SAY ~Curses! Foiled again!~
IF ~~ THEN DO ~Enemy()
Attack([PC])~ EXIT
END 


If the shoe were on the other foot, and the NPC called out to the villain first, then a WEIGHT might be necessary to insure the desired line of dialogue appears.
Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

             --Neil Gaiman, Terry Pratchett, "Good Omens"

 

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)?: