WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
87 stars 19 forks source link

can't handle PST animate.ids...in dialogs, at least #199

Open burner1024 opened 3 years ago

burner1024 commented 3 years ago

animate.ids looks like this

0x6050 (cl 4) Thokola
0x6051 (cl 1) Nameless One, Severed Arm
0x6052 (cl 1) Nameless as Zombie

Error

[action list near line 131, column 2 of DINCAR2.DLG] PARSE WARNING at line 132 column 1-33
Near Text: )
    [PolymorphEx] argument [(cl 1)
Nameless One, Severed Arm] not found in [Animate.IDS]
4Luke4 commented 3 years ago

Might be related to this...

burner1024 commented 3 years ago

Man, weidu is too smart for its own good... + seems easy enough to add, but for the life of me I can't figure out how to make it parse pst's animate.ids. Edit: actually, there's special code for animate.ids already, but it looks like for some reason parentheses or comma in ids symbol confuses d/baf action parser.

D action looks like this

Polymorph(24647)
SetAnimState("Vhail", ANIM_MIMEATTACK1)

The relevant weidu code is just

COPY_EXISTING_REGEXP GLOB ~^.+\.dlg$~ ~override~
  DECOMPILE_AND_PATCH BEGIN x = 0 END
BUT_ONLY
FredrikLindgren commented 2 years ago

This happens because Dlg.save_dlg invokes Dlg.convert_raw_text on the action, which replaces the final space in "(cl 1) " with a newline, which cases the future Hashtbl lookup to fail, resulting in the parse warning. The D file is created fine, with Polymorph(123) in the action list. It appears to be the compiler that expands the IDS code into its symbol.

FredrikLindgren commented 2 years ago

And this should be fixed in 65964c284be95ce6f22c78c49934213e32ad4e03.

FredrikLindgren commented 2 years ago

This is back on because regexps suck.

burner1024 commented 2 years ago

So, uhm, any examples of strings that should and should not be caught by the regex? Maybe I'll think of one.