
Interjections
#1
Posted 24 March 2004 - 05:08 AM
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
#2
-Guest-
Posted 24 March 2004 - 08:06 AM
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
Posted 25 March 2004 - 02:51 AM
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
#4
-Ashara-
Posted 25 March 2004 - 06:30 AM
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
Posted 25 March 2004 - 07:09 AM
#6
-Guest-
Posted 25 March 2004 - 07:43 AM
#7
Posted 25 March 2004 - 08:04 AM
#8
-Ashara-
Posted 25 March 2004 - 09:20 AM
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
Posted 25 March 2004 - 03:24 PM
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
#10
Posted 26 March 2004 - 05:18 AM
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
#11
Posted 26 March 2004 - 05:28 AM
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.
#12
Posted 26 March 2004 - 05:37 AM

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

Sillara
#13
Posted 26 March 2004 - 05:42 AM
#14
Posted 26 March 2004 - 01:41 PM
SofT
#15
Posted 26 March 2004 - 07:00 PM
Thank you in advance!
Sillara
#16
Posted 27 March 2004 - 01:06 AM
Umm--This might be silly, but what if I want the conversation to go on longer? Right now it goes something like this: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
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
#17
Posted 27 March 2004 - 04:18 AM
//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
#18
Posted 27 March 2004 - 06:27 AM
+ ~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
#19
Posted 27 March 2004 - 09:12 AM
#20
Posted 27 March 2004 - 05:57 PM

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