Wounded_Lion Posted October 27, 2006 Share Posted October 27, 2006 This dialogue state: IF ~~ THEN BEGIN 4 SAY #20302 IF ~Alignment(Protagonist,MASK_EVIL)~ THEN REPLY @3 GOTO MGLaugh IF ~~ THEN REPLY @2 DO ~Enemy() TriggerActivation("ILLUSIONDOOR",TRUE)~ EXIT END /* 4 */ returns a parsing error. The error is reported as a syntax error (location: the "IF ~" immediately following "SAY #20302"). What is causing this error? I'm just about ready to say "!@#$ it" and give up the project. I'm so tired of mysterious parsing errors and the near-useless WeiDU readme. - D Link to comment
berelinde Posted October 27, 2006 Share Posted October 27, 2006 I did a test compilation of the following using WeiDU v196, and it compiled properly, as in I got the message RESOURCE [_BIMOEN] NOT FOUND IN KEY or similar, because I was not using WeiDU in an actual game directory, but rather in a document directory that does not contain the game. I put some text in so I could see the spacing better. APPEND ~_BIMOEN~ IF ~~ THEN BEGIN 4 SAY ~Testing~ IF ~Alignment(Protagonist,MASK_EVIL)~ THEN REPLY ~TWIT~ GOTO MGLaugh IF ~~ THEN REPLY ~DIE!~ DO ~Enemy() TriggerActivation("ILLUSIONDOOR",TRUE)~ EXIT END /* 4 */ END Link to comment
jastey Posted October 27, 2006 Share Posted October 27, 2006 I would suspect the error is (a missing END or tilda) somewhere above that script block, which looks OK to me, too. If you want maybe posting the whole .d would help. Link to comment
pro5 Posted October 27, 2006 Share Posted October 27, 2006 Most likely, one of the previous states is missing enclosing ~ symbol. Link to comment
berelinde Posted October 27, 2006 Share Posted October 27, 2006 If you use Crimson Editor, you might want to check out cmorgan's highlighting tool. By switching to check for strings, missing tildes really pop out at you. I can't speak for anyone else, but missing tildes and END or EXIT lines account for 90% of the syntax errors I get. Link to comment
Smoketest Posted October 27, 2006 Share Posted October 27, 2006 This bit... IF ~!InParty("Aerie") !Dead("KalahIllusion") THEN BEGIN 3 SAY #20301 IF ~~ THEN GOTO 4 END /* 3 */ ...is missing a tilde after the state trigger. Edit: you can also leave out THEN and BEGIN if you wish. It can make it harder to read if you're not used to D code, but I like it for its compactness; it lets me focus better on the actual dialog code and less on the wrapper. Edit again: Yes, WeiDU can be a bit dense when reporting errors. For me the line number it reports is often meaningless. Link to comment
berelinde Posted October 27, 2006 Share Posted October 27, 2006 Found it. You're missing a tilde. IF ~!InParty("Aerie") !Dead("KalahIllusion") THEN BEGIN 3 should be IF ~!InParty("Aerie") !Dead("KalahIllusion")~ THEN BEGIN 3 Edit: Smoketest beat me to the post Link to comment
Wounded_Lion Posted October 27, 2006 Author Share Posted October 27, 2006 Thank you, Smoketest and berelinde. Trying to find this type of error within a plain text file is hell on my eyes. I need to experiment with the Crimson Editor that berelinde mentioned. Currently I use Notepad... - D Link to comment
berelinde Posted October 27, 2006 Share Posted October 27, 2006 Crimson editor is free and the highlighter is a powerful tool. It won't wash and wax the car, but it has reduced my syntax errors by something like 90%. I'd get the other 10%, but I still miss ENDs sometimes. Link to comment
Smoketest Posted October 27, 2006 Share Posted October 27, 2006 I hear ya. I recently downloaded Crimson but haven't had time to work with it yet. I ditched Notepad because it fragments long lines when word wrap is enabled (it inserts end of line characters instead of just wrapping the line). I have been using Word but I had to disable all of its character replacement options in order to maintain a straight text file. Ugh. At least it doesn't fragment long lines. Link to comment
Wounded_Lion Posted October 27, 2006 Author Share Posted October 27, 2006 Is the highlighting tool that you mentioned an add-on/plug-in? If so, where do find it? - D Link to comment
berelinde Posted October 27, 2006 Share Posted October 27, 2006 It's on the Wiki, under Modder Utilities. Here's a link to the page. http://dev.gibberlings3.net/index.php/Main_Page Link to comment
cmorgan Posted October 27, 2006 Share Posted October 27, 2006 Hey, Wounded Lion, drop an email message to svowles at comcast dot net and I will send you the package I sent berelinde - it is even easier to use than the Development Wikki version, as everything is already named correctly - it is pretty much a drag and drop from .rar. JCompton told me about this editor, and I now pretty much just use this one with highlighters, only droping into TextPad for regexp changes (newline, etc, stuff that Crimson doesn't support). I like ConTEXT, but the highlighters bog down even on fast machines, while Crimson has had every single BG1 NPC file (a little over 1000 files) open, all highlighted, with little slowdown. Link to comment
Wounded_Lion Posted October 27, 2006 Author Share Posted October 27, 2006 Cheers and thanks to cmorgan for creating and posting the CE highlighters! - D Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.