subtledoctor Posted March 4, 2022 Posted March 4, 2022 (edited) Maybe I'm dense... I've had some success using GET_OFFSET_ARRAY to retrieve information about spell and item headers, but it still seems a bit obtuse at times. So, at the moment I have something like this to detect all items with abilities that use the GAZE projectile: OUTER_SET ind = 0 COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN READ_SHORT 0x68 num_ab PATCH_IF (num_ab > 0) BEGIN GET_OFFSET_ARRAY ab_array ITM_V10_HEADERS PHP_EACH ab_array AS int => ab_off BEGIN READ_SHORT (ab_off + 0x2a) itm_proj PATCH_IF (itm_proj = 65) BEGIN SET ind = (ind + 1) [detect which header this is] SPRINT $gazeitems(~%ind%~ ~%SOURCE_RES%~)~%header_#%~ END END END END BUT_ONLY Later I'm going to want to copy the items in that array and patch the particular headers in some way: ACTION_PHP_EACH gazeitems AS ind => head BEGIN COPY_EXISTING ~%ind_1%.itm~ ~override~ LPF ALTER_EFFECT INT_VAR header = %head% match_opcode = x timing = y duration = z END [etc.] IF_EXISTS BUT_ONLY END Question is, how do I record the particular header numbers in the array? Edited March 7, 2022 by subtledoctor Quote
Magus Posted March 7, 2022 Posted March 7, 2022 (edited) Quote PHP_EACH ab_array AS ab_num => ab_off BEGIN ... SPRINT $gazeitems(~%ind%~ ~%SOURCE_RES%~) ~%ab_num%~ or something Edited March 7, 2022 by Magus Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.