Skip to content

READ_BYTE, READ_SHORT, READ_LONG

CallirgosCallirgos Member Posts: 105
Hi

I'm trying to remove the spellcasting restriction on all light armor.
I'm using WEIDU. I've chosen to identify the appropriate files by the Ground Icon used in the .ITM.
However, I'm not sure what "READ_*" command I'm supposed to use.

I'm looking for a BAM file to validate the patch action. That is 8 bits (resref)
That's larger than READ_LONG.
What should I do here?

Here is what I currently have. (below)


COPY_EXISTING_REGEXP ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x44 bam

PATCH_IF (bam = GLEAT01) BEGIN
LPF ~DELETE_ITEM_EQEFFECT~
INT_VAR
opcode_to_delete = 145 // disable spellcasting
END
END
BUT_ONLY_IF_IT_CHANGES

Comments

  • OlvynChuruOlvynChuru Member Posts: 3,075
    Do this:

    READ_ASCII 0x44 bam
  • kjeronkjeron Member Posts: 2,367
    edited February 2020
    COPY_EXISTING_REGEXP ~^.+\.itm$~ override
    	READ_ASCII 0x44 bam ELSE ~~ (8)
    	//	reads 8 bytes, as a string, not integer (default is 8 bytes, so the (8) can be omitted here)
    	PATCH_IF ~%bam%~ STR_EQ ~GLEAT01~	BEGIN
    	//	string equality cannot be done by '=' in weidu
    		LPF	DELETE_EFFECT INT_VAR check_headers = 0	match_opcode = 145	END
    	END
    BUT_ONLY
    
Sign In or Register to comment.