Skip to content

Small bit of help needed with some Weidu syntax

lujolujo Member Posts: 236
So, I'm looking to just rejigger this bit of code to hit all .cre files in order to debug the "Journal Portrait Conversations" to hit all critters. It currently hits 999 out of 1093 and some of the ones it doesn't hit are named quest givers.

It's trivial to do, I just happen to not know exactly how. This is the relevant code:

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~ READ_ASCII 0x02cc dialoguefile ELSE 0 READ_ASCII 0x0034 portraitfile ELSE 0 READ_BYTE 0x0273 creclass ELSE 0 READ_STRREF 0x0008 Crefullname ELSE 0 READ_SHORT 0x28 animationindex ELSE 0 PATCH_IF ((FILE_EXISTS_IN_GAME ~%dialoguefile%.dlg~)) BEGIN // Creature has a valid dialogue file INNER_ACTION BEGIN OUTER_SPRINT ~Crename~ ~%SOURCE_RES%~ LAF TO_HEX_NUMBER INT_VAR value = animationindex RET hexNumber END OUTER_TEXT_SPRINT valueHex ~%hexNumber%~ ACTION_IF ((FILE_EXISTS_IN_GAME ~%valueHex%.ini~)) THEN BEGIN COPY_EXISTING - ~%valueHex%.INI~ ~override~ LPF GET_BESTIARY_NUMBER INT_VAR startOfs = 0 endOfs = SOURCE_SIZE STR_VAR keyName = "bestiary" RET number END PATCH_IF (number >= 0) BEGIN SPRINT Filename $cre_imageKnown("%number%") END PATCH_IF (number < 0) BEGIN SPRINT Filename ~default~ END END LAM AddBestiarypic END // INNER ACTION END END // PATCH_IF END BUT_ONLY

And if I'm not much mistaken the only thing that needs fiddling with is this line:

PATCH_IF ((FILE_EXISTS_IN_GAME ~%dialoguefile%.dlg~)) BEGIN

But I could be wrong.

Does anyone more experienced know how to just make whatever happens to files which have .dlg files, simply happen to all .cre files?
Sign In or Register to comment.