Jump to content


Photo

Syntax errors?


  • Please log in to reply
29 replies to this topic

#1 Grave

Grave
  • Member
  • 39 posts

Posted 21 March 2004 - 06:38 PM

I'm making a few NPC's for BG1tutu, and I have everything all ready for install.

I click on my "setup-mymod" (renamed from WeiDU), and the first few commands seem to run well.

Then when it's installing one of my .d files, I get this message:

Compiling 1 dialogue ...
[./override/TRIGGER.IDS] loaded, 7717 bytes
[TRIGGER.IDS] parsed
[./override/ACTION.IDS] loaded, 13067 bytes
[ACTION.IDS] parsed

[MulgoreXaviaNPC/xavia.d] PARSE ERROR at line 13 column 1-5
Near Text: ~ THEN BEGIN 1 // from:
SAY ~
syntax error

[MulgoreXaviaNPC/xavia.d] ERROR at line 13 column 1-5
Near Text: ~ THEN BEGIN 1 // from:
SAY ~
Parsing.Parse_error
ERROR: parsing [MulgoreXaviaNPC/xavia.d]: Parsing.Parse_error


Can anybody tell me how to fix this?

Thanks,

Grave

#2 -icelus-

-icelus-
  • Guest

Posted 21 March 2004 - 06:43 PM

You'll need to post the code from the xavia.d file (state 1). There may be some kind of missing punctuation or command word.

#3 Grave

Grave
  • Member
  • 39 posts

Posted 21 March 2004 - 07:40 PM

IF ~~ THEN BEGIN 1 // from:
SAY ~Allow me to introduce myself. I am Xavia of Athkathla, and over there is my bodyguard and faithful companion, Mulgore of Luruar. Say hello, Mulgore.~
~ EXTERN ~MULGORE~ 0
END



I have a feeling it has something to do with EXTERN, but I'm not positive on that.

#4 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 21 March 2004 - 08:18 PM

It should be:

IF ~~ THEN EXTERN MULGORE 0 (although you really shouldn't use numbers for statelabels but should use some descriptive text instead)

#5 Grave

Grave
  • Member
  • 39 posts

Posted 22 March 2004 - 05:08 PM

Nope... didn't work. Although you were right about me needing to fix the EXTERN portion. But I'm still coming up with the same error message:

Here is the part of the .d file it's saying is screwed up:

IF ~~ THEN BEGIN 1 // from:
SAY ~Please, allow me to introduce myself. I am Xavia of Athkathla, and over there is my bodyguard and faithful companion, Mulgore of Luruar. Say hello, Mulgore.~
IF ~~ THEN EXTERN MULGORE 0
END


Here is from the DEBUG file:

[MulgoreXaviaNPC/xavia.d] PARSE ERROR at line 13 column 1-5
Near Text: ~ THEN BEGIN 1 // from:
SAY ~
syntax error

[MulgoreXaviaNPC/xavia.d] ERROR at line 13 column 1-5
Near Text: ~ THEN BEGIN 1 // from:
SAY ~
Parsing.Parse_error
ERROR: parsing [MulgoreXaviaNPC/xavia.d]: Parsing.Parse_error


#6 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 22 March 2004 - 05:31 PM

Did you start off the .d file with:

BEGIN ~xavia~

#7 Grave

Grave
  • Member
  • 39 posts

Posted 22 March 2004 - 05:45 PM

I sure did :)

#8 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 22 March 2004 - 06:26 PM

Check the blocks before that one to make sure you're not missing any ending ~

#9 Grave

Grave
  • Member
  • 39 posts

Posted 22 March 2004 - 08:10 PM

No... everything seems to be in check :huh:

#10 MagusWizardo

MagusWizardo

    Don't ask... please don't ask.

  • Member
  • 201 posts

Posted 22 March 2004 - 09:21 PM

Ok, I just tried that code myself, and it works fine... no errors. What is in the block immediately above this one?

#11 Grave

Grave
  • Member
  • 39 posts

Posted 23 March 2004 - 03:07 AM

Here's everything in xavia.d up to that point:

BEGIN ~XAVIA~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
SAY ~You... you're <CHARNAME>, are you not? I've been... dying... to finally meet you. You've made quite a name for yourself along the Sword Coast, and ever since I first heard about your adventures, well... I've had this burning desire to... meet you.~
IF ~~ THEN REPLY ~And who exactly are you?~ GOTO 1
IF ~~ THEN REPLY ~I don't have time to talk with the likes of you! Now be off ye little girl, lest I send you to meet your maker!~ GOTO Fight
IF ~~ THEN REPLY ~While I would love to sit over a frothy mug of ale and recant my recent adventures to you, alas I fear I do not have the time right now.~ GOTO Goodbye
IF ~~ THEN REPLY ~Let me guess, are you another assassin sent by the Iron Throne to dispatch me? It'll take more than a little girl with a dagger and her smelly half orc companion slouching next to her to take the likes of us out!~ GOTO 10
IF ~~ THEN DO ~SetGlobal("SpokeToXavia","GLOBAL",1)
END

IF ~~ THEN BEGIN 1 // from:
SAY ~Please, allow me to introduce myself. I am Xavia of Athkathla, and over there is my bodyguard and faithful companion, Mulgore of Luruar. Say hello, Mulgore.~
IF ~~ THEN EXTERN MULGORE 0
END


#12 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 23 March 2004 - 03:41 AM

You want to attach the DO statement to the replies:
i.e.

BEGIN ~XAVIA~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
SAY ~You... you're <CHARNAME>, are you not? I've been... dying... to finally meet you. You've made quite a name for yourself along the Sword Coast, and ever since I first heard about your adventures, well... I've had this burning desire to... meet you.~
IF ~~ THEN REPLY ~And who exactly are you?~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO 1
IF ~~ THEN REPLY ~I don't have time to talk with the likes of you! Now be off ye little girl, lest I send you to meet your maker!~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO Fight
IF ~~ THEN REPLY ~While I would love to sit over a frothy mug of ale and recant my recent adventures to you, alas I fear I do not have the time right now.~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO Goodbye
IF ~~ THEN REPLY ~Let me guess, are you another assassin sent by the Iron Throne to dispatch me? It'll take more than a little girl with a dagger and her smelly half orc companion slouching next to her to take the likes of us out!~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO 10
END

IF ~~ THEN BEGIN 1 // from:
SAY ~Please, allow me to introduce myself. I am Xavia of Athkathla, and over there is my bodyguard and faithful companion, Mulgore of Luruar. Say hello, Mulgore.~
IF ~~ THEN EXTERN MULGORE 0
END

// Oh and btw you were missing a tilde at the end of your DO list. Which I've corrected for you.
"You alone can make my song take flight..."

#13 Grave

Grave
  • Member
  • 39 posts

Posted 23 March 2004 - 09:37 AM

Thanks man, I'll try it out this evening and see if it works.

BTW, do I have to add the DO command to every single reply? I just want to make sure before I go in and start modifying my .d files

#14 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 23 March 2004 - 10:43 AM

It depends--in this case if you want the GLOBAL SpokeToXavia to be set to 1 regardless of the response then the DO would need to be attached to every REPLY action. If you only want an action to occur with a specific response, then the DO only needs to be attached to that particular response.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#15 Grave

Grave
  • Member
  • 39 posts

Posted 23 March 2004 - 04:57 PM

Ok, I understand now... because different REPLYS in the same dialog can have different effects, you want to make sure all your replys have. Gotcha.

But do I have to do this with EVERY REPLY in my entire .d file, or just for the first one? Or is it everytime a new dialog thread starts?

#16 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 23 March 2004 - 05:20 PM

If you want to set just the one GLOBAL, then attaching that action to every reply in the first branch will do it (i.e. per Grim's code). A DO action is performed if that particular REPLY is selected--since the player must select one of those responses, you know the GLOBAL will get set. Adding the same DO action to the next batch of responses would be redundant. :)

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#17 Grave

Grave
  • Member
  • 39 posts

Posted 23 March 2004 - 06:22 PM

Ok, I've jumped past that hurdle... now for my next one


I've been tinkering with this for 30 minutes now, but can't figure it out. Here is the DEBUG message:

[MulgoreXaviaNPC/xavia.d] PARSE ERROR at line 70 column 1-2
Near Text: IF
syntax error

[MulgoreXaviaNPC/xavia.d] ERROR at line 70 column 1-2
Near Text: IF
Parsing.Parse_error
ERROR: parsing [MulgoreXaviaNPC/xavia.d]: Parsing.Parse_error


And here is where the problem lies:

IF ~~ THEN BEGIN Fight // from:
SAY ~You dare insult me! I shall drive this dagger deep into your black heart! Mulgore, let's get 'em!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF)~
IF ~~ THEN DO ~Attack(NearestEnemyOf(Myself))~
IF ~~ THEN EXTERN MULGORE 2
END


#18 -icelus-

-icelus-
  • Guest

Posted 23 March 2004 - 06:24 PM

You don't have any transitional commands your first two replies. Think of the IF ~~ THEN for the replies as separate roads. Every road needs a final destination. The three main destinations are EXIT, EXTERN ~otherdialog~, and GOTO.

#19 Grave

Grave
  • Member
  • 39 posts

Posted 23 March 2004 - 07:15 PM

I tried all 3 of those, still getting the same error message.

#20 -icelus-

-icelus-
  • Guest

Posted 23 March 2004 - 07:17 PM

Try this:

IF ~~ THEN BEGIN Fight // from:
SAY ~You dare insult me! I shall drive this dagger deep into your black heart! Mulgore, let's get 'em!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF) Attack(NearestEnemyOf(Myself))~ EXTERN MULGORE 2
END