temnix Posted April 26, 2020 Share Posted April 26, 2020 There is this line of code, which probably everyone uses to select NPC companions or not NPC companions in patching: PATCH_IF FILE_CONTAINS_EVALUATED (~pdialog.2da~ ~%deathvar%~), "deathvar" being the script name. For some reason this keeps returning true for creatures without a script name or with "None" there. Why? Quote Link to comment
subtledoctor Posted April 26, 2020 Share Posted April 26, 2020 Not sure - maybe the variable doesn't get properly populated in every instance? Might save yourself some time and use code already developed by others: Put the DEFINE_ACTION_MACRO in your ALWAYS block, and then any time you want to treat joinable or non-joinable NPCs, you just LAM JOINABLE_NPC_ARRAYS ACTION_PHP_EACH JOINABLE_NPC_ARRAY AS j_cre => dv BEGIN COPY_EXISTING ~%j_cre%~ ~override~ //your patching code END or LAM JOINABLE_NPC_ARRAYS ACTION_PHP_EACH NON_JOINABLE_NPC_ARRAY AS n_j_cre => dv BEGIN COPY_EXISTING ~%n_j_cre%~ ~override~ //your patching code END I think this has been pretty robust, as far as I've seen anyway. Quote Link to comment
Jarno Mikkola Posted April 26, 2020 Share Posted April 26, 2020 This happens probably because the file table contains a space, and that equals to empty variable. It's not meant for usage with COPY_EXISTING_REGEXP GLOB ~*.cre~ ~override~ -commands. Quote Link to comment
subtledoctor Posted April 26, 2020 Share Posted April 26, 2020 3 minutes ago, Jarno Mikkola said: This happens probably because the file table contains a space, and that equals to empty variable. It's not meant for usage with COPY_EXISTING_REGEXP GLOB ~*.cre~ ~override~ -commands. I mean, there's no reason it can't be used that way. Maybe need to tighten it up a bit - add a PATCH_IF (VARIABLE_IS_SET %deathvar%) here or there. My suggestion was purely for the purpose of saving time/effort. Quote Link to comment
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.