Jump to content


Photo

Banter problem


  • Please log in to reply
14 replies to this topic

#1 Lykainon

Lykainon

    Extraordinary in a way your puny mortal brain cannot grasp.

  • Member
  • 198 posts

Posted 27 November 2008 - 11:52 AM

I'm attempting to write NPC banters for the very first time and have, naturally, come upon some problems. The code is pretty much just cut'n'pasted from a tutorial (not to mentioned checked against said tutorial a million times) and seems more or less identical to various banter codes I've seen around the forums but apparently there's some difference since they are working and mine isn't.
When I try to install the mod (which worked perfectly before) I get a parsing error at line 10 ("~Cason, take your...") when WeiDu tries to compile the file. Since I know the error messages aren't always accurate I've checked the entire file lots and lots of times but I can't seem to find the problem. When I disabled the first block of code I got the same error regarding line 27 which is the same line in the second block. Thus, I hope someone else (hopefully someone who bests my two weeks of modding experience) has an idea.

BEGIN FtCasonB

//Viconia Banter
CHAIN
IF ~InParty(?FtCason?)
InParty(?Viconia?)
!ActuallyInCombat
Global(?CasVicTalk?,?GLOBAL?,0)
THEN BVICONI CasVic1
~Cason, take your eyes of me. Now.~
DO ~SetGlobal(CasVicTalk?,?GLOBAL?,1)
== FtCasonB ~Ah, and what would happen if I didn't? Would you... punish me perhaps?~
== BVICONI ~Most certainly, male. You would not enjoy it. I know things that would make even a drow crumble in pain and you, rivvin, is no drow.~
= ~I can't deny that but I assure you, I can most certainly take a beating or two for a...eh, greater good, gal.~
= BVICONI ~You dare calling me 'gal'? I am drow, not some tavern wench. You better...~
= ~What? You go around calling everyone and their ugly uncle 'male'. I get that you could get confused in the dark but here on the surface we are quite sure about our gender. And others' as well...~
= BVICONI ~Learn to keep your words and eyes to yourself or make sure you never turn your back on me again, male.~
= ~I wouldn't dream of it, woman.~
EXIT

CHAIN
IF ~InParty(?FtCason?)
InParty(?Viconia?)
!ActuallyInCombat
Global(?CasVicTalk?,?GLOBAL?,1)
THEN FtCasonB CasVic2
~I'm curious about something, Viconia.~
DO ~SetGlobal(CasVicTalk?,?GLOBAL?,2)
== BVICONI ~I am not suprised. It astonish me that you can grasp which end of the sword to hold, rivvin.~
== FtCasonB ~Lovely. Anyway, you doesn't seem to appreciate the... directness of my compliments about your lovely curves.~
= BVICONI ~Now that, you have fully grasped.~
= ~But from what I've heard about the drow, your kind doesn't have much finesse when it comes to matters of the intimate nature.~
= BVICONI ~It is quite simple, Cason. You are not drow and even if you were, it is not a male's place to initiate discussions about these matters as you call them.~
= ~Ah, but I'm no girl (although that's a thought worth thinking about at night) so how am I supposed to express my appreciation for your physique?~
= BVICONI ~That is easy, male. You will not. Now be quiet and let us proceed to more important things.~
EXIT

I'm not sure whether I need to add BVICONI to every line or just the first but I've tried it both ways and it hasn't affected this problem.
"Humans need fantasy to be human. To be the place where the falling angel meet the rising ape."

- Death, Hogfather (Terry Pratchett)


Arr! There be a pirate in the making!

#2 Icendoan

Icendoan

    "An Infinite Deal of Nothing"

  • Member
  • 1723 posts

Posted 27 November 2008 - 12:16 PM

Yes, you do, as well as add the other dialogue name.

IE, it would be:

== BVICONI ~I am not surprised....~
== FtCasonB ~text~ for every single ==.

= doesn't count, as that is multisay.

== is used to start a new person, = is adding to the text of the last, until an end is found.

Here is my error reports:

BEGIN FtCasonB

//Viconia Banter
CHAIN
IF ~InParty(?FtCason?)
InParty(?Viconia?)
!ActuallyInCombat()
Global(?CasVicTalk?,?GLOBAL?,0)~ //MISSING ~
THEN BVICONI CasVic1
~Cason, take your eyes of me. Now.~
DO ~SetGlobal(CasVicTalk?,?GLOBAL?,1)~ //MISSING ~
== FtCasonB ~Ah, and what would happen if I didn't? Would you... punish me perhaps?~
== BVICONI ~Most certainly, male. You would not enjoy it. I know things that would make even a drow crumble in pain and you, rivvin, are no drow.~
== FtCasonB ~I can't deny that but I assure you, I can most certainly take a beating or two for a... eh, greater good, gal.~
== BVICONI ~You dare calling me 'gal'? I am drow, not some tavern wench. You better...~
== FtCasonB ~What? You go around calling everyone and their ugly uncle 'male'. I get that you could get confused in the dark, but here on the surface we are quite sure about our gender. And others' as well...~
== BVICONI ~Learn to keep your words and eyes to yourself or make sure you never turn your back on me again, male.~
== FtCasonB ~I wouldn't dream of it, woman.~ 
EXIT

CHAIN
IF ~InParty(?Viconia?)
!ActuallyInCombat()
Global(?CasVicTalk?,?GLOBAL?,1)~ //MISSING ~
THEN FtCasonB CasVic2
~I'm curious about something, Viconia.~
DO ~SetGlobal(CasVicTalk?,?GLOBAL?,2)~ //MISSING ~!
== BVICONI ~I am not suprised. It astonish me that you can grasp which end of the sword to hold, rivvin.~
== FtCasonB ~Lovely. Anyway, you doesn't seem to appreciate the... directness of my compliments about your lovely curves.~
== BVICONI ~Now that, you have fully grasped.~
== FtCasonB ~But from what I've heard about the drow, your kind doesn't have much finesse when it comes to matters of the intimate nature.~
== BVICONI ~It is quite simple, Cason. You are not drow and even if you were, it is not a male's place to initiate discussions about these matters as you call them.~
== FtCasonB ~Ah, but I'm no girl (although that's a thought worth thinking about at night) so how am I supposed to express my appreciation for your physique?~
== BVICONI ~That is easy, male. You will not. Now be quiet and let us proceed to more important things.~
EXIT

Above is corrected, to the best of my knowledege, and grammar/spelling.

Icen
Proud member of the 'I HATE Elminster!' Club!

Mods in development: Keeping Yoshimo

#3 Lykainon

Lykainon

    Extraordinary in a way your puny mortal brain cannot grasp.

  • Member
  • 198 posts

Posted 27 November 2008 - 12:41 PM

Ah, thanks a lot, Icen. It seems that was the problem.

Seems like I got some new problems though (although I suppose these are existing problems that was hiding behind the first problem...). When I install I get this lovely log...

Installing [Cason]
Copying and patching 1 file ...
[Cason\FtCason.cre] loaded, 2688 bytes
Copied [Cason\FtCason.cre] to [override\FtCason.cre]
Copying and patching 1 file ...
[Cason\FtCourt.cre] loaded, 1096 bytes
Copied [Cason\FtCourt.cre] to [override\FtCourt.cre]
Compiling 1 dialogue file ...
Processing 1 dialogues/scripts ...
Adding FTCASON to internal list of available DLGs
Adding FTCASONP to internal list of available DLGs
[FTCASONP.DLG] saved	2 states, 4 trans, 2 strig, 0 ttrig, 3 actions
[FTCASON.DLG] saved	16 states, 33 trans, 2 strig, 0 ttrig, 1 actions
Compiling 1 dialogue file ...
WARNING: cannot verify trigger ~InParty(?FtCason?)
InParty(?Viconia?)
!ActuallyInCombat()
Global(?CasVicTalk?,?GLOBAL?,0)~: Failure("lexing: empty token")
Warning at src/dparser.mly.49
WARNING: cannot verify action ~SetGlobal(CasVicTalk?,?GLOBAL?,1)~: Failure("lexing: empty token")
Warning at src/dparser.mly.69
WARNING: cannot verify trigger ~InParty(?Viconia?)
!ActuallyInCombat()
Global(?CasVicTalk?,?GLOBAL?,1)~: Failure("lexing: empty token")
Warning at src/dparser.mly.49
WARNING: cannot verify action ~SetGlobal(CasVicTalk?,?GLOBAL?,2)~: Failure("lexing: empty token")
Warning at src/dparser.mly.69
Processing 1 dialogues/scripts ...
Adding FTCASONB to internal list of available DLGs
[./override/BVICONI.DLG] loaded, 52934 bytes
[BVICONI.DLG] loaded
[FTCASONB.DLG] saved	8 states, 8 trans, 1 strig, 0 ttrig, 1 actions
[BVICONI.DLG] saved	632 states, 915 trans, 59 strig, 27 ttrig, 67 actions
override/BVICONI.dlg copied to Cason/backup/0/BVICONI.dlg, 52934 bytes
Compiling 1 dialogue file ...
Processing 1 dialogues/scripts ...

I ended up as "Installed with warnings" so I figured I should try it out but when I tried to force the conversation in the game I got an error message saying it couldn't find FtCasonB.

Once again, I'll be eternally grateful to anyone who got any ideas and quite possibly worship said person as a god among modders for a week or so.
"Humans need fantasy to be human. To be the place where the falling angel meet the rising ape."

- Death, Hogfather (Terry Pratchett)


Arr! There be a pirate in the making!

#4 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 27 November 2008 - 01:38 PM

You forgot to put the " to: CasVicTalk? and so it's not valid, and you need to use the "...", not the ?...? as those are the wrong marks. As you can see, the code will be clear from the big back dots...

So try to use this:
BEGIN FtCasonB

//Viconia Banter
CHAIN
IF ~InParty("FtCason")
	InParty("Viconia")
	!ActuallyInCombat()
	Global("CasVicTalk","GLOBAL",0)~ THEN BVICONI CasVic1
~Cason, take your eyes off from me. Now.~
DO ~SetGlobal("CasVicTalk","GLOBAL",1)~
== FtCasonB ~Ah, and what would happen if I didn't? Would you... punish me perhaps?~
== BVICONI ~Most certainly, male. You would not enjoy it. I know things that would make even a drow crumble in pain and you, rivvin, are no drow.~
== FtCasonB ~I can't deny that but I assure you, I can most certainly take a beating or two for a... eh, greater good, gal.~
== BVICONI ~You dare calling me 'gal'? I am drow, not some tavern wench. You better...~
== FtCasonB ~What? You go around calling everyone and their ugly uncle 'male'. I get that you could get confused in the dark, but here on the surface we are quite sure about our gender. And others' as well...~
== BVICONI ~Learn to keep your words and eyes to yourself or make sure you never turn your back on me again, male.~
== FtCasonB ~I wouldn't dream of it, woman.~
EXIT

CHAIN
IF ~InParty("Viconia")
	!ActuallyInCombat()
	Global("CasVicTalk","GLOBAL",1)~ THEN FtCasonB CasVic2
~I'm curious about something, Viconia.~
DO ~SetGlobal("CasVicTalk","GLOBAL",2)~ 
== BVICONI ~I am not suprised. It astonish me that you can grasp which end of the sword to hold, rivvin.~
== FtCasonB ~Lovely. Anyway, you doesn't seem to appreciate the... directness of my compliments about your lovely curves.~
== BVICONI ~Now that, you have fully grasped.~
== FtCasonB ~But from what I've heard about the drow, your kind doesn't have much finesse when it comes to matters of the intimate nature.~
== BVICONI ~It is quite simple, Cason. You are not drow and even if you were, it is not a male's place to initiate discussions about these matters as you call them.~
== FtCasonB ~Ah, but I'm no girl (although that's a thought worth thinking about at night) so how am I supposed to express my appreciation for your physique?~
== BVICONI ~That is easy, male. You will not. Now be quiet and let us proceed to more important things.~
EXIT

Edited by Jarno Mikkola, 27 November 2008 - 01:59 PM.

Deactivated account. The user today is known as The Imp.


#5 Lykainon

Lykainon

    Extraordinary in a way your puny mortal brain cannot grasp.

  • Member
  • 198 posts

Posted 27 November 2008 - 01:58 PM

Thanks, Jarno. Always nice to have people around to answer one's stupid questions. :cheers:

You forgot to put the " to: CasVicTalk? and so it's not valid,



This I don't quite understand I'm afraid...

and you need to use the "&", not ?&? as those are the wrong marks. As you can see, the code will be clear from the big back dots...


...and this should teach me a lesson about copy-pasting code, I guess.

However, when I try to install it now I get the original parsing error again, at the same line, which confuses the hell out of me since I fixed that with Icen's suggestion (no ~'s lacking this time) but now it's back.
"Humans need fantasy to be human. To be the place where the falling angel meet the rising ape."

- Death, Hogfather (Terry Pratchett)


Arr! There be a pirate in the making!

#6 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 27 November 2008 - 02:02 PM

Well, the If sentence needs one ~ at the end, already fixed in the previous post...

You forgot to put the " to: CasVicTalk? and so it's not valid,

This I don't quite understand I'm afraid...

Well, it needs to be:
"CasVicTalk"
Instead of; hih hih
CasVicTalk"

Edited by Jarno Mikkola, 27 November 2008 - 02:05 PM.

Deactivated account. The user today is known as The Imp.


#7 Icendoan

Icendoan

    "An Infinite Deal of Nothing"

  • Member
  • 1723 posts

Posted 27 November 2008 - 02:14 PM

Post your debug log and the banter file, please.

Icen
Proud member of the 'I HATE Elminster!' Club!

Mods in development: Keeping Yoshimo

#8 Lykainon

Lykainon

    Extraordinary in a way your puny mortal brain cannot grasp.

  • Member
  • 198 posts

Posted 27 November 2008 - 02:18 PM

Well, the If sentence needs one ~ at the end, already fixed in the previous post...


Yeah, I noticed that after posting. I think the help has made me spoiled so I didn't check everything.

Well, it needs to be:

"CasVicTalk"
Instead of; hih hih
CasVicTalk"


Ah, silly me. :doh: I thought you wrote "to: CasVicTalk" (as in quoting instead of telling me to add another ").
"Humans need fantasy to be human. To be the place where the falling angel meet the rising ape."

- Death, Hogfather (Terry Pratchett)


Arr! There be a pirate in the making!

#9 Lykainon

Lykainon

    Extraordinary in a way your puny mortal brain cannot grasp.

  • Member
  • 198 posts

Posted 27 November 2008 - 02:28 PM

Yes! At last, it works!

I'll be forever (or for at least like a month) grateful to both of you. Thanks again.

Now... I'm off to write more banters and it seems like I'll be able to focus on the writing instead of the coding for now. Joy! :D
"Humans need fantasy to be human. To be the place where the falling angel meet the rising ape."

- Death, Hogfather (Terry Pratchett)


Arr! There be a pirate in the making!

#10 Icendoan

Icendoan

    "An Infinite Deal of Nothing"

  • Member
  • 1723 posts

Posted 27 November 2008 - 02:31 PM

Try this for a template (CHAIN)
CHAIN
IF
~InParty("DV")
!StateCheck("DV",CD_STATE_NOTVALID)
!CombatCounterGT(0)~ THEN dialogFile stateLabel
~opening text~
DO ~SetGlobal("##BanterHappened","GLOBAL",1)~
== dialogFile2 ~text~
== dialogFile ~text/response~
/* list */
EXIT

Icen
Proud member of the 'I HATE Elminster!' Club!

Mods in development: Keeping Yoshimo

#11 Thanatos.

Thanatos.
  • Member
  • 474 posts

Posted 27 November 2008 - 11:44 PM

Jarno and Icen save yet another Mod from death :)

#12 Icendoan

Icendoan

    "An Infinite Deal of Nothing"

  • Member
  • 1723 posts

Posted 28 November 2008 - 12:09 AM

Heh, that should be my title! Mods Saved from Death: X

Icen
Proud member of the 'I HATE Elminster!' Club!

Mods in development: Keeping Yoshimo

#13 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 28 November 2008 - 03:37 AM

Mods Saved from Dialog Death: X


I have to ask you Icendoan; Will there be any problems incase I reset a Global to 1 if it's might already be 1? As it will not be changed there after... As I just try to avoid too many routes of the almost same dialog.

Deactivated account. The user today is known as The Imp.


#14 Thanatos.

Thanatos.
  • Member
  • 474 posts

Posted 28 November 2008 - 04:42 AM

Jarno asking for help? Your human after all ^_^

#15 Icendoan

Icendoan

    "An Infinite Deal of Nothing"

  • Member
  • 1723 posts

Posted 28 November 2008 - 08:03 AM

No, it simply won't change.

SetGlobal("varName","area",1) if the value is already 1 makes no change.

If this is banter, and it is in the B-File, it is constantly parsed, so resetting that will cause old banters to reoccur if having it GT 1 stops them.

Icen
Proud member of the 'I HATE Elminster!' Club!

Mods in development: Keeping Yoshimo