Author Topic: [BUG?] Compiler errors when adding new action to action.ids  (Read 1068 times)

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Don't know if this is a bug or a mistake on my side, but when I add the alternative syntax of action 293 to action.ids,
Code: [Select]
APPEND ~action.ids~ ~293 StartDialogOverride(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)~
UNLESS ~293 StartDialogOverride(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)~
then WeiDU's compiler triggers an error message whenever I use the first syntax version in my scripts, although they compile correctly and work in-game.

These are the relevant passages in of my .DEBUG file:
Quote
Appending to files ...
[./override/ACTION.IDS] loaded, 13104 bytes
Appending [293 StartDialogOverride(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)...] to [action.ids] because it does NOT contain [293 StartDialogOverride(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)]
override/action.ids copied to DjinniCompanion/backup/0/action.ids, 13104 bytes
Appended text to [action.ids]

[snip]

Compiling 1 script ...
[DjinniCompanion/scripts/A7afqtlk.baf] loaded, 17733 bytes

[tb#compile_patches/DjinniCompanion/scripts/A7afqtlk.baf] PARSE ERROR at line 149 column 8-45
Near Text: )
    Not enough arguments to [StartDialogOverride]. Recovering.

[tb#compile_patches/DjinniCompanion/scripts/A7afqtlk.baf] PARSE ERROR at line 222 column 8-45
Near Text: )
    Not enough arguments to [StartDialogOverride]. Recovering.

The scripting action in question is:
Code: [Select]
    StartDialogOverride("A7AFQB", Player1)

PS: I'm using WeiDU 231.


Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: [BUG?] Compiler errors when adding new action to action.ids
« Reply #1 on: March 01, 2012, 06:35:35 PM »
Going by memory...

WeiDU uses the last match in associating symbols. If you need an alternate for the same ID but with different arguments, you need a different name (I think that will let it work when compiling).

Be aware that when decompiling that ID, it will revert always to the last symbol given in the IDS (so any code, after your change, will decompile always to S:,O:,I:,I:,I:).

Near Infinity will use the first symbol IIRC, to make matters more confusing (it will always drop your extra arguments when decompiling).

Note that when WeiDU says it has recovered, it fills in the remaining arguments with defaults. In this case, your script code was saved as StartDialogOverride("A7AFQB",Player1,0,0,0). The warnings can be safely ignored (you're only going to get into trouble if you need the extra arguments for something).
« Last Edit: March 01, 2012, 06:43:51 PM by devSin »

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Re: [BUG?] Compiler errors when adding new action to action.ids
« Reply #2 on: March 02, 2012, 05:37:48 AM »
Hmm, that behaviour makes it too unreliable to use. If, for some reason, the signature has already been added to action.ids BEFORE the shorter syntax, the compiler will simply cut off all additional parameters from the longer scripting action and doesn't work as expected in-game.

I guess I have to rename it to something else for the moment, like StartDialogOverrideItem or so. :(

NB: There are at least two more actions which might trigger the same behaviour (ForceSpellRES and ForceSpellPointRES).

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: [BUG?] Compiler errors when adding new action to action.ids
« Reply #3 on: April 08, 2012, 12:26:51 PM »
The alternative synthax must use a different name for it to work. In particular, SpellRES and friends work because the action name is different between different forms.

Code: [Select]
APPEND ~action.ids~ ~293 StartDialogOverrideAsItem(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)~
UNLESS ~293 StartDialogOverrideAsItem(S:DialogFile*,O:Target*,I:Unused,I:Unused,I:ConverseAsItem)~
<...>
    StartDialogOverride("A7AFQB", Player1)
    StartDialogOverrideAsItem("A7AFQB", Player1, 0, 0, 1)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: