Author Topic: CLONE_EFFECT header_type  (Read 124 times)

Offline subtledoctor

  • Planewalker
  • *****
  • Posts: 119
CLONE_EFFECT header_type
« on: March 12, 2020, 11:25:47 AM »
This code:
Code: [Select]
COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 header_type = 1 opcode = 318 target = 2 parameter1 = 121 parameter2 = 110 timing = 0 duration = 0 STR_VAR resource = EVAL ~%SOURCE_RES%~ insert = ~first~ END
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 header_type = 2 opcode = 318 target = 2 parameter1 = 121 parameter2 = 110 timing = 0 duration = 0 STR_VAR resource = EVAL ~%SOURCE_RES%~ insert = ~first~ END
  END
IF_EXISTS BUT_ONLY
...is designed to clone one effect in each melee and ranged weapon header. This the "header_type = 1/2."  But it adds both 318 effects to the item's equipping effects as well as to melee and ranged headers.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1078
Re: CLONE_EFFECT header_type
« Reply #1 on: March 12, 2020, 01:25:48 PM »
I can reproduce a problem, but not the one you are describing. When I run your code, two effects are inserted among the global effects, but none on the abilities. If you set check_globals to 0, the global effects are not added, but no effect is cloned. You do not use any of the match_* variables, so nothing is matched. Back to the drawing board, or am I missing something? I'll look into why effects are created with check_globals set to 1; that does not seem right.

Offline subtledoctor

  • Planewalker
  • *****
  • Posts: 119
Re: CLONE_EFFECT header_type
« Reply #2 on: March 13, 2020, 10:58:06 PM »
It works fine for me - hmm, can we not upload screenshots here?  Anyway, after installing this on BG2EE, the Stonefire Axe gets a 318 effect inserted before its extra +2 fire damage.  The generic Axe +2 has no header for on-hit effects, so it is not patched.

I didn't even notice the check_globals variable.  That fixes things on my end, though in general, global effects probably shouldn't be cloned when header_type is specified.

 

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.

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)?: