Jump to content

Installer reports parse error, but I don't see it


ericp07

Recommended Posts

The section in EP#Mel.baf that relates to the previously-mentioned errors is:

 

// Red Wizards
IF
InParty("Edwin")
Global("EP#MelRedWizHostile","GLOBAL",0)
THEN
RESPONSE #100
SG("EP#MelRedWizHostile",1)
END

// Invokers
IF
OR(6) Kit(Player1,MAGESCHOOL_INVOKER) Kit(Player2,MAGESCHOOL_INVOKER) Kit(Player3,MAGESCHOOL_INVOKER) Kit(Player4,MAGESCHOOL_INVOKER) Kit(Player5,MAGESCHOOL_INVOKER) Kit(Player6,MAGESCHOOL_INVOKER)
Global("EP#MelInvokHostile","GLOBAL",0)
THEN
RESPONSE #100
SG("EP#MelInvokHostile",1)
END

// Necromancers
IF
OR(6) Kit(Player1,MAGESCHOOL_NECROMANCER) Kit(Player2,MAGESCHOOL_NECROMANCER) Kit(Player3,MAGESCHOOL_NECROMANCER) Kit(Player4,MAGESCHOOL_NECROMANCER) Kit(Player5,MAGESCHOOL_NECROMANCER) Kit(Player6,MAGESCHOOL_NECROMANCER)
Global("EP#MelNecroHostile","GLOBAL",0)
THEN
RESPONSE #100
SG("EP#MelNecroHostile",1)
END

// Evil Drow
IF
OR(2) InParty(VICONIA) InParty(xulaye)
GLOBAL("EP#MelDrowHostile","GLOBAL",0)
THEN
RESPONSE #100
SG("EP#MelDrowHostile",1)
END

 

Weidu apparently sees nothing wrong with the Edwin portion, so OK there. I thought I should structure the other blocks the same way, but something is "broken" between this and the content in EP#Mel.d (as posted previously).

 

One thought: do I need to add a line after setting the variable to 1, just before END? Or is this all set up properly, and the error still lies in the way I coded it in EP#Mel.d?

 

Thanks,

Eric

Link to comment

No need to set a line... these two are equivalent:

 

IF
 OR(2) 
 InParty("viconia") 
 InParty("xulaye")
 GLOBAL("EP#MelDrowHostile","GLOBAL",0)
THEN
 RESPONSE #100
	SetGlobal("EP#MelDrowHostile",",GLOBAL",1)
END

and

IF OR(2) InParty("viconia") InParty("xulaye") GLOBAL("EP#MelDrowHostile","GLOBAL",0) THEN RESPONSE #100 SetGlobal("EP#MelDrowHostile",",GLOBAL",1) END

 

You could try doing a full long-form SetGlobal instead of SG, but I have an alternate suggestion that might serve just as well, and be easier than trying to deal with script blocks... add the conditions to the dialog itself. Example:

 

IF ~~ EP#MelInitial
 SAY ~What's your name?~
 ++ ~My name is <CHARNAME>. Well to you, Meleryn.~ + EP#MelPreJoin1
 ++ ~I'm sorry, but I don't have time to talk with you right now.~ + EP#MelEndTalk
 ++ ~Perhaps later.~ + EP#MelFirstMeetDenied
 ++ ~A ranger, by the look of you. What's your combat specialty?~ + EP#MelFirstMeetCombatStyle
 + ~GlobalLT("Chapter","GLOBAL",3)~ + ~I don't need your services now, but perhaps you could help me. I'm looking for a mage named Irenicus. Have you heard of him?~ + EP#MelFirstMeetIren
 + ~GlobalGT("Chapter","GLOBAL",2)~ + ~I'm not sure I need another hand. What are your skills?~ + EP#MelFirstMeetSkills
 + ~RandomNum(3,1)~ + ~Leave me be.~ + EP#MelRefused1
 IF ~InParty("Edwin")~ THEN GOTO EP#MelRedWizHostile
 IF ~OR(6) Kit(Player1,MAGESCHOOL_INVOKER) Kit(Player2,MAGESCHOOL_INVOKER) Kit(Player3,MAGESCHOOL_INVOKER) Kit(Player4,MAGESCHOOL_INVOKER) Kit(Player5,MAGESCHOOL_INVOKER) Kit(Player6,MAGESCHOOL_INVOKER)~ THEN GOTO EP#MelInvokHostile
 IF ~OR(6) Kit(Player1,MAGESCHOOL_NECROMANCER) Kit(Player2,MAGESCHOOL_NECROMANCER) Kit(Player3,MAGESCHOOL_NECROMANCER) Kit(Player4,MAGESCHOOL_NECROMANCER) Kit(Player5,MAGESCHOOL_NECROMANCER) Kit(Player6,MAGESCHOOL_NECROMANCER)~ THEN GOTO EP#MelNecroHostile
 IF ~OR(2) InParty("viconia") InParty("xulaye")~ THEN GOTO EP#MelDrowHostile
END

 

The order of checking from the "engine" point of view would be (greatly simplified)

 

.exe: Heya.

.exe: Oh, a state. Cool. Display string "What's your name?"

.exe: now check the replies, starting with the last one... hmmm...

.exe: Nope, no Viconia, no Xulae. Ok, check the next one. Good thing, or I would have diverted to a new state.

.exe: Nope, I don't see dead people. Or rather, I don't see folks who animate them. Ok, check the next one.

.exe: Nope, no invokers. Pity. They are kind of exciting. OK, check the next one.

.exe: Edwin? Any edwins here? Nope. I have a Grunt, a Miranda, a... hey, is this guy playing BG2 or Mass Effect 2? Anyways, none here. Check the next one.

.exe: OK, I rolled a 2 on a 3-sided die. And that condition says on a three-sided, roll a 1. So nope - don't follow this one, check the next one.

.exe: Hmmm. My information says I'm in Chapter 2, and this one asks for a higher value... nope. Skip, check the next.

.exe: Whoa. My information says I'm in Chapter 2, and this one asks for 1 or 2... ok, we finally get to toss one out there! Print this one out. Do I have to go anywhere else? Nope - not until the reply is selected, because it was using IF ~~ THEN REPLY instead of IF ~~ THEN GOTO or anything else. Print it, check the next.

.exe: Hey! A no-conditioned state! Cool! Display this one and check the next one!

.exe: Hey! A no-conditioned state! Cool! Display this one and check the next one!

.exe: Hey! A no-conditioned state! Cool! Display this one and check the next one!

.exe: Hey! A no-conditioned state! Cool! Display this one and check the next one!

.exe: Hey, I am out of options. OK, wait for the user to input, and follow the one they choose.

Link to comment
[Meleryn/dialogues/EP#Mel.d] ERROR at line 42 column 1-2

Near Text: IF

Parsing.Parse_error

ERROR: parsing [Meleryn/dialogues/EP#Mel.d]: Parsing.Parse_error

ERROR: compiling [Meleryn/dialogues/EP#Mel.d]!

Stopping installation because of error.

this part is the failure on IF ~~ EXIT. It also might be the + ~condition~ + newstate construction.

Link to comment
Don't use SG(). I've never seen anyone use it before - why are you?

 

Put quotes around VICONIA and xulaye. If you don't, it won't work.

 

SG is supposed to be acceptable shorthand, and I haven't seen the installer complain about it.

 

That's another point of uncertainty with me: when to put quotes around the name, and when not to.

 

Thanks,

Eric

Link to comment
[Meleryn/dialogues/EP#Mel.d] ERROR at line 42 column 1-2

Near Text: IF

Parsing.Parse_error

ERROR: parsing [Meleryn/dialogues/EP#Mel.d]: Parsing.Parse_error

ERROR: compiling [Meleryn/dialogues/EP#Mel.d]!

Stopping installation because of error.

this part is the failure on IF ~~ EXIT. It also might be the + ~condition~ + newstate construction.

 

I'm starting to see how this business with the use of + can confuse the interpretation of the script, as well as the scripter. Trying to train my mind to it.

 

Thanks!

- E

Link to comment
SG is supposed to be acceptable shorthand, and I haven't seen the installer complain about it.

The installer won't complain about it - it's a valid command listed in the IESDP. It could even work flawlessly in-game. However, why take the risk? You are having enough trouble tracking down bugs and learning how to do this without experimenting with obscure commands that offer no functional benefit over proven ones.

 

That's another point of uncertainty with me: when to put quotes around the name, and when not to.

If you're using any scripting trigger or action where you identify a specific creature by their death value (aka script name), give it quotes. Don't put quotes around special references like Player3 or Myself.

Link to comment
SG is supposed to be acceptable shorthand, and I haven't seen the installer complain about it.

The installer won't complain about it - it's a valid command listed in the IESDP. It could even work flawlessly in-game. However, why take the risk? You are having enough trouble tracking down bugs and learning how to do this without experimenting with obscure commands that offer no functional benefit over proven ones.

 

That's another point of uncertainty with me: when to put quotes around the name, and when not to.

If you're using any scripting trigger or action where you identify a specific creature by their death value (aka script name), give it quotes. Don't put quotes around special references like Player3 or Myself.

 

Which leads to the next bit: the DV and Myself refer to the same character, right? So, which is customarily used where, and are they interchangeable, so that either could be used all the time, whenever needed?

 

- E

Link to comment

Archived

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

×
×
  • Create New...