Jump to content

A Script Will Not Compile Properly...


Domi

Recommended Posts

In the native IWD2 script, the following trigger is used:

 

!IsAnimationID(LastMarkedObject,Mummy, Histachii)

 

Where Mummy, Histachii is a type of animation.

 

When I try to compile similar script from BAF:

 

IsAnimationID("prachi",Mummy, Histachii)

 

WeiDU complains that IsAnimationID has too many arguments, and the compiled script looks like:

 

IsAnimationID("prachi",Mummy)

 

but Mummy is a different animation ID.

 

Is there any way I can use an opcode directly in the script, ie something like:

 

IsAnimationID("prachi",0xE39C)

 

(This one gives a parse error)

 

Thank you in advance!

Link to comment

I'd check if you can decompile/recompile the existing game script that uses IsAnimationID - this trigger isn't in the BG line of Infinity Engines and WeiDU may not know how to handle it correctly (i.e. since no one mods IWD2, no one noticed and it's a thing for the bigg to fix with various nasty interim workarounds).

 

Opcodes can't be used directly in scripts, they can only be called from spell effects.

Link to comment

No, I cannot decompile/recompile the script. I just tried to do it for Replace_Textually, and WeiDU mangled the "Mummy,Histachii" into "Mummy" in the original script as well.

 

So, that's a cry for help to the Bigg, then? :)

Link to comment

WeiDU doesn't currently parse hexadecimal numbers in BAF (bug in the lexer). Are you double and triple sure that you get parser errors and not lexer ones?

 

EDIT: commas in scripts suck hard, so I'd find it unlikely that I'd fix those.

Link to comment

You can always use the decimal value (you can find it in an original BCS that uses the value, convert it yourself, or use Near Infinity's IDS browser).

 

I'd always assumed that using hex values just wasn't supported. :( Does it work in D files in the current build then (makes sense, I guess, since Icewind has some DLGs that use hex)?

Link to comment

It's a parse error, WeiDU wants IsAnimationID to take only two arguments (unless the native script compilier is wrong, wouldn't be the first time).

 

I'd recommend compiling the script with Near Infinity and just copying over the .bcs for now.

Link to comment
I'd always assumed that using hex values just wasn't supported. :)

I've updated the BAF lexer to allow real hexadecimal numbers; before, it was using

| '-'?("0x")?['0'-'9']* -> { adj lexbuf;
  let str = string_of lexbuf in
  INTEGER((Int32.of_string str)) }

which is IMHO proof enough that Weimer wanted to allow hexadecimal numbers, but forgot to add the 'a'-'f''A'-'F' ranges. A fixed version is uploaded in the beta section of WeiDU.org (Domi, if you're interested in that, tell me and I'll PM you the link).

Link to comment
Additionally, weidu could use escape sequence \, to handle commas in symbols.

that's a possibility to investigate as well. I don't know if it'd be more dangerous to do this rather than trying to seek in the BAF parameters queue and see if (printf "%s,%s" par1 par2) is a valid IDS entry. In particular, `Mummy' is a valid entry, making the guessing process even more awkard to write.

Link to comment
which is IMHO proof enough that Weimer wanted to allow hexadecimal numbers, but forgot to add the 'a'-'f''A'-'F' ranges. A fixed version is uploaded in the beta section of WeiDU.org (Domi, if you're interested in that, tell me and I'll PM you the link).

 

Yes, please! So with this update I should be able to use

 

IsAnimationID("prachi",0xE39C)

 

and for the native script, just replace textually the original Mummy,Histachii with the 0xE39C ?

 

I'm sorry if it's a dumb question :)

Link to comment

You can do that right now by writing it as

IsAnimationID("prachi",58268)

:) Bigg's update will allow you to write the numeral either in decimal as it is there, or in hexadecimal as it is in the .ids file.

 

You won't need to modify any in game scripts unless you decompile/recompile them; if so you can run

DECOMPILE_BCS_TO_BAF
 REPLACE_TEXTUALLY ~!IsAnimationID(LastMarkedObject,Mummy.+~ ~!IsAnimationID(LastMarkedObject,58268)~
COMPILE_BAF_TO_BCS

 

and clean up the oddball issues.

Link to comment

Coolness, thank you, this works just great! I don't want to change all the scripts, just the one I am trying to modify! Which is probably the only one that uses it, but heh!

Link to comment

Archived

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

×
×
  • Create New...