Creepin Posted April 9, 2006 Share Posted April 9, 2006 I need to patch, among other things, some weapons of Bio cre's. The problem is that to ensure maximum possible compatibility I want to check first if this weapon is left intact or already patched by some other mod. If creature still has it's original weapon, I want to replace it for good, but if it was already changed to some other mod's content, I'd prefer to keep both items as potential additions to player's collection. So, I ended up with construction like this: COPY_EXISTING ~example.cre~ ~override~ ACTION_IF creature has staff01.itm among it's posessions THEN BEGIN REPLACE_TEXTUALLY CASE_INSENSITIVE EXACT_MATCH ~staff01~ ~newstaff~ ( 8 ) END ELSE BEGIN ADD_CRE_ITEM ~newstaff~ #0 #0 #0 ~None~ ~weapon1~ END I marked green the part I don't know how to write in WeiDU, so any advice on it would be appreciated. Link to comment
the bigg Posted April 9, 2006 Share Posted April 9, 2006 COUNT_REGEXP_INSTANCES CASE_INSENSITIVE EXACT_MATCH ~staf01~ has_staf01 PATCH_IF has_staf01 BEGIN // replace staf01 END ELSE BEGIN ADD_CRE_ITEM END Link to comment
the bigg Posted April 9, 2006 Share Posted April 9, 2006 Your snippet is OK, except that you should use PATCH_IF rather than ACTION_IF (and remove the THEN, it's not needed in P_I). Also, there's no need for the > 0, since all values except 0 evaluate as true. Link to comment
Creepin Posted April 9, 2006 Author Share Posted April 9, 2006 I understand this few seconds after I posted my answer actually, so seems like I cut my answer to "Thank you" the wery same moment you were answering it Any way, now I hopefully understand this trick Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.