Jump to content

BUT_ONLY_IF_IT_CHANGES


Recommended Posts

Let's say we want to remove the 'lore to identify' value from all items so that we never have to have them identified.

BEGIN ~Identify All Items~
COPY_EXISTING_REGEXP GLOB ~.+\.itm~ ~override~
  WRITE_SHORT 0x42 0x0000
This will modify all item files in the game to set the 'lore to identify' value to 0. However, it will copy (and backup) every item file, including the ones that already have 0 'lore to identify'.

 

By using BUT_ONLY_IF_IT_CHANGES, only the files that actually change will be copied.

BEGIN ~Identify All Items~
COPY_EXISTING_REGEXP GLOB ~.+\.itm~ ~override~
  WRITE_SHORT 0x42 0x0000
  BUT_ONLY_IF_IT_CHANGES
To save space, you can use BUT_ONLY instead of BUT_ONLY_IF_IT_CHANGES for the same effect.

 

 

Note: BUT_ONLY_IF_IT_CHANGES will trip over the iplot0xx items if you use C_E_R to copy all the items. I have added this piece of code to the top of my tp2 to deal with this issue.

ALWAYS
ACTION_IF NOT FILE_EXISTS ~override/iplot01k.itm~
  THEN BEGIN
    COPY ~IKTest/blank.itm~ ~override/iplot01k.itm~
  END
ACTION_IF NOT FILE_EXISTS ~override/iplot04g.itm~
  THEN BEGIN
    COPY ~IKTest/blank.itm~ ~override/iplot04g.itm~
  END
ACTION_IF NOT FILE_EXISTS ~override/iplot04h.itm~
  THEN BEGIN
   COPY ~IKTest/blank.itm~ ~override/iplot04h.itm~
  END
ACTION_IF NOT FILE_EXISTS ~override/iplot04i.itm~
  THEN BEGIN
    COPY ~IKTest/blank.itm~ ~override/iplot04i.itm~
  END
END
I do it like this because then I don't have to remember copy the iplot0xx items everytime I use C_E_R on items. Edited by Mike1072
modernized and removed references to IF_EVAL
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...