Author Topic: the epilogues  (Read 1691 times)

Offline Sillara Tamar

  • Princess
  • Planewalker
  • *****
  • Posts: 83
  • Gender: Female
the epilogues
« on: May 20, 2004, 07:43:28 PM »
How can I assign epilogues to my NPC?  I have checked Ghareth, but his is in the .tp2.  I have a romanceable NPC, so he has four different epilogue endings.  Where do I put those?  Is it possible to just put them in the .tp2?  If so, what do I have to do to get the the .tp2 to understand the difference between non-ascension, romanced and ascension romanced, not to mention the other two?  ???

I am sorry to be so ignorant, but I have tried looking in the 2da files (which I have heard access the character epilogues, but I can only find a stringref, nothing more.  I cannot find the associated text, and I do not know where to put it.

Sillara
_________________________________________
For I have sworn thee fair and thought thee bright,
Who are as black as hell, as dark as night.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: the epilogues
« Reply #1 on: May 20, 2004, 08:14:46 PM »
How can I assign epilogues to my NPC?  I have checked Ghareth, but his is in the .tp2.  I have a romanceable NPC, so he has four different epilogue endings.  Where do I put those?  Is it possible to just put them in the .tp2?  If so, what do I have to do to get the the .tp2 to understand the difference between non-ascension, romanced and ascension romanced, not to mention the other two?  ???

I am sorry to be so ignorant, but I have tried looking in the 2da files (which I have heard access the character epilogues, but I can only find a stringref, nothing more.  I cannot find the associated text, and I do not know where to put it.

Epilogues seem like a lot of work because you have to put together multiple pieces to get one to happen, but once you get the hang of them, doing 10 is about as easy as doing 1.

The epilogues are nothing more than a special condition in AR6200 calling the game's TextScreen() command (which, incidentally, you may use at other times during the game, if you wish... Kiara/Zaiya put some love scenes in this interfaces, for instance.)

If you look at Ghareth's ar6200.baf file (which gets EXTEND_TOP'ed into AR6200.bcs) you'll see it is:

IF
    Global("StartEndBios","AR6200",1)
    InParty("FWGhareth")
    Global("FWGharethBio","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("FWGharethBio","GLOBAL",1)
        TextScreen("FWGHAND1")
        SetGlobal("FWGharethBio","GLOBAL",1)
        SmallWait(1)
        SetGlobal("FWGharethBio","GLOBAL",1)
        Continue()
        SetGlobal("FWGharethBio","GLOBAL",1)
END

If the conditions are true (StartEndBios=1, which only occurs after the game has played out the final drama with Melissan, and we haven't already done an epilogue for Ghareth), then it sets FWGharethBio = 1 (so no other epilogues for Ghareth will occur, even if the script restarts from the top, which can happen and calls TextScreen("FWGHAND1"). The bits where I set the global multiple times are legacy, bad-example coding that probably shouldn't be used, but we'd had some trouble getting the variable changes to "take" properly in the past. Nothing will be hurt if you do it, it's just not elegant.

The value in the TextScreen command refers to a 2DA of that name: FWGHAND1.2da.

That 2da looks intimidating, but listen carefully: you only care about TWO sections of it. Unless I specifically mention it, nothing in this 2DA is relevant. Just copy it verbatim and use it in your own mod without altering anything except the two sections I mention.

Code: [Select]
2DA V1.0
*FWGHARG
                        0           1
SWITCH                  DEFAULT     DEFAULT
DEFAULT                 71020       99999
DWARF                   0           0
ELF                     0           0
HALFELF                 0           0
HALFLING                0           0
GNOME                   0           0
HUMAN                   0           0
HALFORC                 0           0
MAGE                    0           0
FIGHTER                 0           0
CLERIC                  0           0
THIEF                   0           0
BARD                    0           0
PALADIN                 0           0
FIGHTER_MAGE            0           0
FIGHTER_CLERIC          0           0
FIGHTER_THIEF           0           0
FIGHTER_MAGE_THIEF      0           0
DRUID                   0           0
RANGER                  0           0
MAGE_THIEF              0           0
CLERIC_MAGE             0           0
CLERIC_THIEF            0           0
FIGHTER_DRUID           0           0
FIGHTER_MAGE_CLERIC     0           0
CLERIC_RANGER           0           0

We care about exactly two things here:

*FWGHARG

and

99999

The first entry starts with a * and is the name of your large (210x330) epilogue-sized portrait for the NPC. So if the large format BMP for your NPC was tsujaG, you'd have

*tsujaG

in that line.

The "99999" is the strref that we want to display for the epilogue. This is a placeholder value which we will be using TP2 REPLACE to fill in.

Notice in the TP2 this section:

COPY ~ghareth/2da/fwghand1.2da~ ~override\fwghand1.2da~
  REPLACE ~99999~ ~Ghareth wasted little time shaking off the sands of Tethyr and returning home to Amn, where he found himself a wanted man, branded an extremist magical deviant and hounded by both Cowled Enforcers and civilian forces alike. (etc.)~

This is a standard TP2 trick used to fill in a sttref value. You set it to be something nonsensical like 99999 in the 2DA or BCS file, then use COPY/REPLACE to provide WeiDU with a new string. That string will be inserted into the talk, and 99999 will be replaced with whatever the strref for "Ghareth wasted little time etc." ends up being.

If you have multiple epilogues, you just have more stuff in the fragment you append to AR6200:

From Kelsey's J#ar620a.baf file:

IF
   Global("StartEndBios","AR6200",1)
   InParty("J#Kelsey")
   Global("J#KelseyBio","GLOBAL",0)
   Global("J#KelseyRomanceActive","GLOBAL",2)
   Global("PlayerChoseEssence","GLOBAL",1)
   Global("FWKelseyBaby","GLOBAL",0)
THEN
   RESPONSE #100
      SetGlobal("J#KelseyBio","GLOBAL",1)
      TextScreen("FWKels03")
END

IF
   Global("StartEndBios","AR6200",1)
   InParty("J#Kelsey")
   Global("J#KelseyBio","GLOBAL",0)
   Global("J#KelseyRomanceActive","GLOBAL",2)
   Global("PlayerChoseEssence","GLOBAL",1)
   Global("FWGiveBaby","GLOBAL",1)
THEN
   RESPONSE #100
      SetGlobal("J#KelseyBio","GLOBAL",1)
      TextScreen("FWKels04")
END

This presents two of the many epilogue possibilities: one for if the PC was romancing Kelsey but ascended (PlayerChoseEssence=1) and they did not have a child together, another for PC romance, ascended, and the PC agrees to give the baby to Kelsey. Notice that the J#KelseyBio variable remains used in all cases, because we only want to get ONE epilogue for Kelsey and only ONCE.

You simply create multiple 2DA files to account for all the different values you call in the TextScreen. The K-TOB TP2 shows a neat trick where you can make those 2DAs using just a single 2DA source file.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

 

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