Jump to content

Parse error plague


La Scura

Recommended Posts

:(Could someone please help me?

I'm trying to mod my first NPC, and I'm getting the error below when I run it. Feel free to have a laugh at my expense if I've done something obviously silly, I only decided to give this a go a couple of days back :)

 

The error

WeiDU v 157 Log

 

D:\Program Files\BG2 - SoA\setup-Berdine.exe

[./Chitin.key] loaded, 590551 bytes

[./Chitin.key] 182 BIFFs, 41793 resources

[dialog.tlk] loaded, 9824886 bytes

[dialog.tlk] 80280 string entries

[./Mplaynow.ini] loaded, 230 bytes

[./Autorun.ini] loaded, 1452 bytes

[./Keymap.ini] loaded, 5615 bytes

[./baldur.ini] loaded, 3604 bytes

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD1\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD2\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD2\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD3\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD4\]

Possible HD/CD Path: [D:\Program Files\BG2 - SoA\CD5\]

[dialog.tlk] claims to be writeable.

[dialog.tlk] claims to be a regular file.

[WeiDU.log] parsed

 

[sETUP-BERDINE.TP2] LEXER ERROR at line 15 column 29-36

Near Text: \

invalid character [\]

 

[sETUP-BERDINE.TP2] ERROR at line 15 column 29-36

Near Text: \

Parsing.Parse_error

ERROR: parsing [sETUP-BERDINE.TP2]: Parsing.Parse_error

ERROR: problem parsing TP file [sETUP-BERDINE.TP2]: Parsing.Parse_error

 

ERROR: Parsing.Parse_error

 

WeiDU Timings

TOTAL 4.997 s

load TLK 3.645 s

loading files 3.645 s

unmarshal TLK 0.842 s

unmarshal KEY 0.340 s

loading files 0.160 s

parsing .log files 0.010 s

parsing .tp2 files 0.000 s

 

And the tp2:

BACKUP ~NewNPC\backup~

 

BEGIN ~BERDINE NPC~

 

COPY ~NewNPC\BERDINE5.cre~ ~override\BERDINE5.cre~

SAY NAME1 ~Berdine~

SAY NAME2 ~Berdine~

 

COMPILE ~NewNPC\Berdine.d~

USING ~~

 

COMPILE ~NewNPC\Berdine.baf

 

EXTEND_BOTTOM ~AR1000.bcs~ ~NewNPC\BerAR1000.baf~

 

APPEND ~pdialog.2da~

~Berdine BerdineP~

UNLESS ~Berdine~

Link to comment

Heya,

 

You're just missing the closing tilde (~) on the following line:

 

COMPILE ~NewNPC\Berdine.baf

 

:( Good luck with your NPC!

 

PS- with 'lexer errors', you can usually assume that WeiDU is trying to read one of your directories or filenames as a WeiDU command- so it's likely that you're missing the closing tilde or quotation mark on one of the previous lines. :)

Link to comment

:) Thanks for that Cliffette, I'll slow down my proof reading.

 

I've been following The Beginners Guide to NPC creation on Pocketplane. My new problem is the dialogue, even though I've pared it down to the absolute bare basics. The NPC approaches the PC and initiates dialogue OK, the initial block works, but then it seems to revert to multig.dlg. Unfortunately, nothing I've tried has fixed it and I'm out of ideas.

 

BEGIN Berdine

 

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting

SAY ~Greetings! I'm Berdine.~

IF ~~ THEN REPLY ~Howdy~ GOTO Greet

IF ~~ THEN REPLY ~Go Away.~ GOTO GoAway

END

 

IF ~~ THEN BEGIN Greet

SAY ~Want me to join?~

IF ~~ THEN REPLY ~Yes please.~ DO ~SetGlobal ("BerdineJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~No, leave me alone.~ EXIT //loops back to NPC approaching PC

END

 

IF ~~ THEN BEGIN GoAway

SAY ~OK, I hope you reconsider.~ //loops back to NPC approaching PC

IF ~~ THEN EXIT

END

 

//nothing further works

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue

SAY ~Have you reconsidered?~

IF ~~ THEN REPLY ~Yes, please join our party.~ DO ~SetGlobal("BerdineJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~No, I still don't want you.~ GOTO RefusedAgain

END

 

IF ~~ THEN BEGIN RefusedAgain

SAY ~Refused again? Oh well.~

IF ~~ THEN EXIT

END

 

BEGIN BerdineP

 

IF ~Global("BerdineJoined","LOCALS",1)~ THEN BEGIN KickOut

SAY ~You want me to leave the party?~

IF ~~ THEN REPLY ~No!~ DO ~JoinParty()~ EXIT

IF ~~ THEN REPLY ~Yeah, get lost.~ DO ~SetGlobal("BerdineJoined","LOCALS",0)~ EXIT

END

 

IF ~Global("BerdineJoined","LOCALS",0)~ THEN BEGIN Rejoin

SAY ~You want me to rejoin?~

IF ~~ THEN REPLY ~Yep.~ DO ~SetGlobal("BerdineJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~No.~ EXIT

END

:(

Link to comment

I have a feeling that you just need to reorder your blocks so that all the dialogs with conditions (ie those containing the "IF ~SomethingIsBetweenTheTildes~ THEN BEGIN" as opposed to "IF ~~ THEN BEGIN") are at the top of the dialog. So your new order should look like this:

 

BEGIN Berdine

 

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting

SAY ~Greetings! I'm Berdine.~

IF ~~ THEN REPLY ~Howdy~ GOTO Greet

IF ~~ THEN REPLY ~Go Away.~ GOTO GoAway

END

 

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue

SAY ~Have you reconsidered?~

IF ~~ THEN REPLY ~Yes, please join our party.~ DO ~SetGlobal("BerdineJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~No, I still don't want you.~ GOTO RefusedAgain

END

 

IF ~~ THEN BEGIN Greet

SAY ~Want me to join?~

IF ~~ THEN REPLY ~Yes please.~ DO ~SetGlobal ("BerdineJoined","LOCALS",1)

JoinParty()~ EXIT

IF ~~ THEN REPLY ~No, leave me alone.~ EXIT //loops back to NPC approaching PC

END

 

IF ~~ THEN BEGIN GoAway

SAY ~OK, I hope you reconsider.~ //loops back to NPC approaching PC

IF ~~ THEN EXIT

END

 

IF ~~ THEN BEGIN RefusedAgain

SAY ~Refused again? Oh well.~

IF ~~ THEN EXIT

END

 

 

 

It's not very neat, but I think that only dlg blocks that contain conditions can be triggered, so they should all be at the top.

Link to comment

Sadly that hasn't worked either! I've looked at other simple NPC d files and I think it must be something else, but I don't know what that something else could be! :)

 

Anyone got any other suggestions? Help is greatly appreciated

Link to comment

We should probably check and see if it's a missed dialogue file assignment or a bad trigger--try changing the NumTimesTalkedToGT(0) to True() and see if that gets the block to trigger. If it does, there's something screwy with the trigger. If not, it's something screwy with the dialogue file assignment. Also doublecheck that the cre file has the correct scriptname (or death variable, whichever you like to call it) of Berdine.

 

After looking at your tp2 again, I think you're not APPENDing enough information to PDIALOG.2da--you should also be assigning dialogues in INTERDIA.2da as well. Also, the USING ~~ any time you compile something is redundant, and it can be removed. :)

 

Try this for the APPENDs:

 

APPEND ~pdialog.2da~ // SoA version
 ~BERDINE        BERDINEP             BERDINEJ            BERDINED~
   UNLESS ~BERDINE~
   UNLESS ~25POST~

APPEND ~pdialog.2da~ // ToB version
 ~BERDINE        BERDINEP             BERDINEJ            BERDINED         BERDI25P             BERDI25J             BERDI25D~
   UNLESS ~BERDINE~
   IF ~25POST~

APPEND ~interdia.2da~ //  SoA version
 ~BERDINE    BBERDINE~
   UNLESS ~BERDINE~
   UNLESS ~25POST~

APPEND ~interdia.2da~ //  ToB version
 ~BERDINE    BBERDINE        BBERDI25~
   UNLESS ~BERDINE~
   IF ~25POST~

 

Any dialogue once she joins would then go into BERDINEJ.

 

One final suggestion would be to register a prefix and start using it before you get too far. :(

Link to comment
I have a feeling that you just need to reorder your blocks so that all the dialogs with conditions (ie those containing the "IF ~SomethingIsBetweenTheTildes~ THEN BEGIN" as opposed to "IF ~~ THEN BEGIN") are at the top of the dialog.

This isn't correct, the game doesn't care how many states without state triggers lie between those that have them.

 

What may be happening is that even though you unchecked the CRE flag, your test game still has the old CRE--like if you saved the game after the CRE was spawned, and/or you forgot to reinstall your mod with the new CRE.

 

Make extra certain sure you're actually using the corrected CRE (and Cam's corrections to your 2DA appending) and then go back to an earlier save where you're positive that your Berdine CRE has not been created.

Link to comment

Oops... sorry about giving you the wrong information before, La Scura.. :( I had read it somewhere before, but it's probably my lack of memory playing tricks on me again.

 

It also means that now my .dlg files can make more chronological sense. :)

 

But yes, make sure the .cre in your override folder has been altered with both CamDawg's and hlidskialf's suggestions.

Link to comment

I had some problems with incorrect flags as well. Make sure your NPC has the following flags set:

 

Class flags: 0X00000000 Normal

State flags: 0X00000000 state_normal

Reaction: 0X80 neutral

General: 0X1 humanoid (If she's not a troll or something :D)

Alignment: 0X22 neutral

 

Then here's what your Script column should look like in DLTCEP:

 

Override Script: NPC (if your NPC's .baf were NPC.baf)

Class script: NONE

Race script: NONE

General script: NONE

Default script: NONE

Dialog: NPC (if your NPC's .d were NPC.d)

Scripting name (Death variable): NPC

 

There are probably other ways to do it, but this is the setup that works for me.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...