Jump to content


Photo

Interjections


  • Please log in to reply
44 replies to this topic

#1 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 24 March 2004 - 05:08 AM

I was wondering how to code this in, and I would really appreciate some guidance. I understand about the INTERJECT_COPY_TRANS, and that is what I use for most of my interjections. However, there are a few occasions when that is not what I need. For example, I want my NPC to comment upon arrival in Spellhold. How do I put that in the J file? What are the triggers I need to put to make sure he does not make his comment EVERY time he enters the door?

My other question is what do I do to make my NPC talk to, say, Valen even before she begins her talk and offer? Is there some sort of thing like this?

SEE ("Valen")~ THEN
SAY ~Blah, blah, Valen.~
END

I realize that that is not right, but what IS? And how do I keep him from saying that every time he sees her? I only want him to say it the FIRST time. If there is any place that explains this, please point me in that direction.

Sillara
Check out my RPG forum!

#2 -Guest-

-Guest-
  • Guest

Posted 24 March 2004 - 08:06 AM

For "just entered the area" you will need to add a block to your NPC's override script, which will check the group's persence in the area. To make sure it happens only once use Global. The block will look something like this:

IF
InParty(Myself)
AreaCheck("AR0051")
Global("NPCTalksinArea0051", "GLOBAL",0)
THEN
IncrementGlobal("NPCTalksinArea0051", "GLOBAL",1)
StartDialogueNoSet(Player1)
IncrementGlobal("NPCTalksinArea0051", "GLOBAL",1)
END

in the J file the condition for your talk will include

Global("NPCTalksInArea0051", "GLOBAL",1)

And, again, take my words with a grain of salt, but I think that a similar block with a condition on the NumberofTimesTalked To and See("VALEN") will make the character to talk to Valen... but I am not sure, how it will affect the

#3 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 25 March 2004 - 02:51 AM

So does that mean that if I put this in my TSUJATD.baf

IF
InParty(Myself)
AreaCheck("AR2800")
Global("TsuSuldanTalk", "GLOBAL",0)
THEN
IncrementGlobal("TsuSuldanTalk", "GLOBAL",1)
StartDialogueNoSet(Player1)
IncrementGlobal("TsuSuldanTalk", "GLOBAL",1)
END

and this in my TSUJATJ.d
IF
Global("TsuSuldanTalk", "GLOBAL",1)
THEN SAY~
~Blah blah blah.~
IF ~~ THEN EXIT
END

then Tsujatha will speak the first time he enters AR2800? That he will say his lines and then not say them again? Oh please, please let this be right!

SofT

Check out my RPG forum!

#4 -Ashara-

-Ashara-
  • Guest

Posted 25 March 2004 - 06:30 AM

One question:

TSUJATD.baf

Is not it your dream script per chance (assigned through PDIALOGUE.2DA)? If it is, then the dialogue will happen when you are going to rest in this area.

I appologize in advance, if it is not dream script and you have used override scripts, but here goes a small very dummy thinggie on override scripts (and again, I am a dumb novice, so it may not be the best way). I use override scripts to create "script-driven" dialogues - ie in the area, when someone died etc (actually I also use them now to initiate all dialogues between NPCs and PC).

To create an override script, basically you want to do a separate BAF file and then use it for, say, creating conditional dialogues. The script then can be compiled through TP2 COMPILE option and assigned, using TP2 WRITE ASCII function, to your CRE. If you have not done it previously, either look into Kelsey TP2 - they assign a bunch of things through ASCII to their secondary chars and compile the BAFs or someone can post a small snippet of TP2.

#5 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 25 March 2004 - 07:09 AM

You also wouldn't want to increment the global twice.

#6 -Guest-

-Guest-
  • Guest

Posted 25 March 2004 - 07:43 AM

Is it better to reset it to 2 in the dialogue then?

#7 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 25 March 2004 - 08:04 AM

She's checking for the global to be 1 in the dialog so it should be set to 1 in the script that starts the dialog. She should probably set it to 2 in the dialog just so nothing else will start that particular dialog again.

#8 -Ashara-

-Ashara-
  • Guest

Posted 25 March 2004 - 09:20 AM

She should probably set it to 2 in the dialog just so nothing else will start that particular dialog again.

Yes, that's why I was trying to IncrementGlobal the second time (hate DO ~SetGlobal~ ) otherwise, this dialogue will actually be repeated every time the NPC is scripted to talk to PC (been there, lol) I think double Increment worked for me, but I can double check and go to the annoying DO's after every PC's option, if it's a cleaner way.

#9 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 25 March 2004 - 03:24 PM

Ah, yes, you were right, domi. I was using my dream script .baf. Oops. I will put it in my TSUJATH.baf. That is, I think, my override. If not, I will dig out whichever one is and put the code there. So what I ought to do is this:
In my TSUJATH.baf

IF
InParty(Myself)
AreaCheck("AR2800")
Global("TsuSuldanTalk", "GLOBAL",0)
THEN
IncrementGlobal("TsuSuldanTalk", "GLOBAL",1)
StartDialogueNoSet(Player1)
END

And in my TSUJATJ.d
IF
Global("TsuSuldanTalk", "GLOBAL",1)
THEN SAY~
~Blah blah blah.~
IF ~~ THEN DO SET GLOBAL("TsuSuldanTalk","GLOBAL",2)~
EXIT
END

Oh please let that be right!

SofT

Check out my RPG forum!

#10 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 26 March 2004 - 05:18 AM

If I put this in my J file, will it work? Oh please let it be right! (No, I do not need the dialogue to go back to any player options.)


IF ("TsujathaRomanceActive","GLOBAL",1)
INTERJECT SALVANAS 22 TsuSalvanas
== TSUJATJ IF ~IsValidForPartyDialog("Tsujatha")~ THEN
~Blah, blah, blah.~
== SALVANAS IF ~IsValidForPartyDialog("Tsujatha")~ THEN
~Blah.~
== TSUJATJ IF ~IsValidForPartyDialog("Tsujatha)~ THEN
~Blah, blah.~
END


I have a couple of dialogues like this, and I would like to be able to code them up. (I am running out of other interjections to code.) Also, how do I code in the chance for an interjection to turn into a banter? That is, my NPC says something, and it gives the PC the chance to talk to him. Like this:

Tsujatha: My, that was a tough battle.
PC:
1. Yes, it was.
2. No, it wasn't.
3. What battle?

And each option, of course, continues the thread of the conversation. Is this done any differently from a standard LT banter, only I put it in the J file? Or do I put in the B file instead?

Thank you again!

Sillara

Check out my RPG forum!

#11 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 26 March 2004 - 05:28 AM

I think you want to code it like this:

INTERJECT SALVANAS 22 TsuSalvanas
== TSUJATJ IF ~IsValidForPartyDialog("Tsujatha")
Global("TsujathaRomanceActive","GLOBAL",1)~ THEN ~Blah, blah, blah.~
== SALVANAS ~Blah.~
== TSUJATJ ~Blah, blah.~
END

And on turning it into a banter then yes you can (thanks to an INTERJECT feature I asked Wes to add - http://www.shsforums.net/index.php?showtopic=5122).

The code I use for Harvey's tree of life dialogue uses this structure:

//Tree of Life
INTERJECT PLAYER1 33 GH#I#TreeofLife
== PLAYER1 IF ~IsValidForPartyDialog("G#Harvey")~ THEN ~Harvey, the enigmatic sorceror who travels with you; he is still as much a mystery as the day you first met him. Is he willing to fight and probably die in the coming battle?~
END
++ ~This isn't your fight, Harvey. It's mine. There's no need for you to risk your life...~ EXTERN HARVEYJ 22#RiskLife
++ ~Harvey, you don't have to fight Irenicus if you don't want. He is very powerful. Maybe even more powerful than you...~ EXTERN HARVEYJ 22#MorePowerful
++ ~Irenicus is a powerful mage. I'm going to need a more powerful sorceror to defeat him. You up for it?~ EXTERN HARVEYJ 22#UpForIt

APPEND HARVEYJ
IF ~~ THEN BEGIN 22#RiskLife
SAY ~No <CHARNAME>, I'm staying. I want to see how tough this bastard really is. And besides could I risk my life even if I wanted to?~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#MorePowerful
SAY ~Oh come on! I am so much more powerful that this bastard, and I'm going to prove it. Lead on <CHARNAME>!~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#UpForIt
SAY ~Hell yeah! I'm going to teach this bastard a thing or two about spellcasting. We'll take him down!~ COPY_TRANS PLAYER1 33
END
END

Hope that helps.
"You alone can make my song take flight..."

#12 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 26 March 2004 - 05:37 AM

Oh thank you! I think I have it now. And what is the trigger for a Tree of Life dialogue? Is it PLAYER1 33? And where do I put the epilogues? (Sorry about that last one. I know it has nothing to do with interjections, but I did not want to open a new topic just for that. :rolleyes: )

Thank you again, Grim. This has already been extremely helpful! :D

Sillara
Check out my RPG forum!

#13 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 26 March 2004 - 05:42 AM

Yeah PLAYER1 33 is the correct Tree of Life INTERJECT point. On epilogues, I'm not sure. I haven't got around to coding any ToB NPCs yet. I'm concentrating on creating working SoA versions and then do ToB (like Kelsey).
"You alone can make my song take flight..."

#14 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 26 March 2004 - 01:41 PM

I am, too, except that I did want his epilogues to be there. It is frustrating to take an NPC all the way to the throne, and then not see what happened afterward! Especially for a romance . . . . Anyway, I will keep looking. But thank you so much for the help! I am beginning to reach the end of the interjections! Hurrah!

SofT
Check out my RPG forum!

#15 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 26 March 2004 - 07:00 PM

I am having difficulty tracing the trigger for the Slayer change. I have found a couple of things, but they are the NPC RESPONSES to the Slayer, not the state that triggered the responses. Could someone please let me know either what the Player1 state is that triggers those responses, (e.g. Imoen's "You became the avatar of Bhaal!" or what-have-you), or else how to find it. I have searched in NI without success. I would also like to be able to transfer the EndangerLovedOne global to my NPC. How would I do that?

Thank you in advance!

Sillara
Check out my RPG forum!

#16 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 27 March 2004 - 01:06 AM

I think you want to code it like this:

The code I use for Harvey's tree of life dialogue uses this structure:

//Tree of Life
INTERJECT PLAYER1 33 GH#I#TreeofLife
== PLAYER1 IF ~IsValidForPartyDialog("G#Harvey")~ THEN ~Harvey, the enigmatic sorceror who travels with you; he is still as much a mystery as the day you first met him. Is he willing to fight and probably die in the coming battle?~
END
++ ~This isn't your fight, Harvey. It's mine. There's no need for you to risk your life...~ EXTERN HARVEYJ 22#RiskLife
++ ~Harvey, you don't have to fight Irenicus if you don't want. He is very powerful. Maybe even more powerful than you...~ EXTERN HARVEYJ 22#MorePowerful
++ ~Irenicus is a powerful mage. I'm going to need a more powerful sorceror to defeat him. You up for it?~ EXTERN HARVEYJ 22#UpForIt

APPEND HARVEYJ
IF ~~ THEN BEGIN 22#RiskLife
SAY ~No <CHARNAME>, I'm staying. I want to see how tough this bastard really is. And besides could I risk my life even if I wanted to?~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#MorePowerful
SAY ~Oh come on! I am so much more powerful that this bastard, and I'm going to prove it. Lead on <CHARNAME>!~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#UpForIt
SAY ~Hell yeah! I'm going to teach this bastard a thing or two about spellcasting. We'll take him down!~ COPY_TRANS PLAYER1 33
END
END

Umm--This might be silly, but what if I want the conversation to go on longer? Right now it goes something like this:

Harvey comment
PC choices
Extern to Harvey
Append Harvey
The End

What about this?

NPC comment
PC
Extern to NPC
Append NPC
PC choices
NPC response
The End

My question is: do I continue to EXTERN and APPEND? Or can I use GOTO?

Thanks!

Sillara
Check out my RPG forum!

#17 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 27 March 2004 - 04:18 AM

Ok I'll give you a rather strange example of how you could extend this dialogue:

//Tree of Life
INTERJECT PLAYER1 33 GH#I#TreeofLife
== PLAYER1 IF ~IsValidForPartyDialog("G#Harvey")~ THEN ~Harvey, the enigmatic sorceror who travels with you; he is still as much a mystery as the day you first met him. Is he willing to fight and probably die in the coming battle?~
END
++ ~This isn't your fight, Harvey. It's mine. There's no need for you to risk your life...~ EXTERN HARVEYJ 22#RiskLife
++ ~Harvey, you don't have to fight Irenicus if you don't want. He is very powerful. Maybe even more powerful than you...~ EXTERN HARVEYJ 22#MorePowerful
++ ~Irenicus is a powerful mage. I'm going to need a more powerful sorceror to defeat him. You up for it?~ EXTERN HARVEYJ 22#UpForIt

APPEND HARVEYJ

IF ~~ THEN BEGIN 22#RiskLife
SAY ~No <CHARNAME>, I'm staying. I want to see how tough this bastard really is. And besides could I risk my life even if I wanted to?~
++ ~Yeah, once I become a god I could butcher your arse!~ GOTO 22#Butcher
++ ~Good point...~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#MorePowerful
SAY ~Oh come on! I am so much more powerful that this bastard, and I'm going to prove it. Lead on <CHARNAME>!~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#UpForIt
SAY ~Hell yeah! I'm going to teach this bastard a thing or two about spellcasting. We'll take him down!~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN 22#Butcher
SAY ~You know, I always hated you <CHARNAME>! You always thought you were so much better me! I've had enough of this, let's fight!~
++ ~No need for that, Harv.~ GOTO 22#NoNeed
++ ~Yeah alright...~ EXTERN PLAYER1 22#YeahAlright
END

IF ~~ THEN BEGIN 22#NoNeed
SAY ~Fair enough.~ COPY_TRANS PLAYER1 33
END

END


APPEND PLAYER1

IF ~~ THEN BEGIN 22#YeahAlright
SAY ~Harvey appears to have sh*t himself.~ COPY_TRANS PLAYER1 33
END

END



Basically, within that APPEND HARVEYJ statement (and before the END statement that ends the APPENDing) then you can just write standard dialogue with GOTOs as within it then HARVEYJ is doing the SAYing. However, when you want PLAYER1 to say something (that's the dialogue when your character is thinking something as opposed to a PC option) then I have to APPEND PLAYER1 to add the new state and then EXTERN to PLAYER1. Hope that makes sense.

Note: Instead of APPENDing I could have written each of them as a CHAIN but I'd have to make sure that they were at the end of the dialogue file.
e.g. Instead of writing:

APPEND PLAYER1

IF ~~ THEN BEGIN 22#YeahAlright
SAY ~Harvey appears to have sh*t himself.~ COPY_TRANS PLAYER1 33
END

END

I could write:

CHAIN PLAYER1 22#YeahAlright
~Harvey appears to have sh*t himself.~
COPY_TRANS PLAYER1 33
"You alone can make my song take flight..."

#18 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 27 March 2004 - 06:27 AM

Thank you, Grim! I understand that now. Yay! But I have another question. I am having trouble compiling this:

+ ~RandomNum(4,1)~ + ~(18. Blah!) ~ + LateTSJBlah1
+ ~RandomNum(4,2)~ + ~(18. Blah!) ~ + LateTSJBlah2
+ ~RandomNum(4,3)~ + ~(18. Blah!) ~ + LateTSJBlah3
+ ~RandomNum(4,4)~ + ~(18. Blah!) ~ + LateTSJBlah4



++ ~19. (Leave Tsujatha be.)~ EXIT
END

+ ~ RandomNum(4,1)
OR(10)
AreaCheck("AR0704")
AreaCheck("AR0709")
AreaCheck("AR0406")
AreaCheck("AR0513")
AreaCheck("AR0509")
AreaCheck("AR0021")
AreaCheck("AR0313")
AreaCheck("AR1105")
AreaCheck("AR2010")
AreaCheck("AR1602") ~+ ~(20. Bathe with Tsujatha.) ~ + LateTSJTsuBathIn1

It says it has trouble with the + in front of ~RandomNum(4,1). I do go on to have the other three, but I do not know what is wrong. I copied it exactly from the example. Sigh. Please help!

Sillara

Check out my RPG forum!

#19 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 27 March 2004 - 09:12 AM

The END should go at the end of the state rather than in the middle. (btw, why are you numbering your flirts? You're going to end up with 18. 18. Blah!)

#20 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 27 March 2004 - 05:57 PM

Oh dear. Does that mean that if I number my PC responses in the B file I will end up with double numbers, too? Or only in the J? (Please let it only be the J!) :unsure:

And now I have some MORE questions. After Kismet fixed that problem for me (Thank you, Kismet!), I have some problems that I do not understand. My debug file has this in it:


WARNING: cannot verify trigger ~Global("TsujathaRomanceActive","GLOBAL",1)
SEE(Player1)
!StateCheck(Player1,STATE_SLEEPING)
CombatCounter(0)
GlobalTimerExpired(?TsujathaRandomFlirtTimer?)~: Failure("lexing: empty token")
WARNING: cannot verify trigger ~IsGabber(Player1)
CombatCounter(0)
Global(?TsujathaNotChaste?,?GLOBAL?,1)
Global("TsujathaRomanceActive","GLOBAL",2)~: Failure("lexing: empty token")
WARNING: cannot verify trigger ~IsGabber(Player1)
CombatCounter(0)
Global(?TsujathaChaste?,?GLOBAL?,1)
Global("TsujathaRomanceActive","GLOBAL",2)~: Failure("lexing: empty token")


I do not know how to make it verify the triggers. What do I have to do? Also, I do not know what "lexing: empty token" means. I think that with setting my romance parameters in the TSUJATH.baf, I should have verifiable triggers, yes? Now, my random flirt timer is NOT set in the TSUJATH.baf. Is that where I ought to put it? My NotChaste and Chaste variables I set within the B file, based on PC choices. Do I have to have a base variable in the TSUJATH.baf to work from? I also set the TsujathaRomanceActive to 2 in the B file based on PC responses. Is that wrong?

I apologize if I ought to have posted this elsewhere, but I am stumped.

Sillara

Check out my RPG forum!