Jump to content

Removal of EFF applied through opcode 177


Recommended Posts

Hello,

Just like in the topic. Let's say I have a spell_1 that uses opcode 177 to apply eff_1. How can I remove that eff_1? It seems that opcode 321 and setting proper parent_resource doesn't work, I also tried to remove it through opcode 221 (Removal: Remove Secondary Type) but even if I set the same secondary type to spell_1 and to eff_1, I still got that effect running. Tried it with eff_1 showing a portrait icon to get a visual indication if my tests were successful or not.

So is there a way to ensure that I remove eff_1? Am I missing something in my implementation?

Best regards
SparrowJacek

Link to comment

Thanks, I'll check that opcode later today.

Quote

But also, why not apply the effect by a different method if this is critical? Apply a subspell with op146 instead of am EFF with op177. Then you can use op321 to cancel the subspell.

For my purpose I need to use a v2 EFF file, v1 won't be enough. Also opcode 177 has a nice built-in condition, which otherwise would have to be reimplemented using stuff like opcode 318/326.

From opcode 321 description in  IESDP I see that applying eff_1 through opcode 272 instead of 177 should resolve my problem, but then again 272 applies its first effect with a delay and is less flexible in general.

Link to comment

I feel like op321 should actually work. It works for me when I remove proficiencies already applied to NPCs as permanent op233 effects:

Spoiler
COPY ~%MOD_FOLDER%/lib/d5_base.spl~ ~override/d5prfch.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5profz~ END
END

LAM JOINABLE_NPC_ARRAYS

ACTION_PHP_EACH JOINABLE_NPC_ARRAY AS cre => dv BEGIN
// 	PRINT ~%cre% => %dv%~ 
	COPY_EXISTING ~%cre%~ ~override~
	  LPF FJ_CRE_EFF_V2 END
	BUT_ONLY
END

ACTION_PHP_EACH JOINABLE_NPC_ARRAY AS cre => dv BEGIN
	COPY_EXISTING ~%cre%~ ~override~
	  READ_LONG 0x2c4 eff_offset
	  READ_LONG 0x2c8 eff_number
	  WHILE (%eff_number% > 0) BEGIN
		SET eff_number = (%eff_number% - 1)
		READ_LONG (%eff_offset% + 0x08 + (0x108 * %eff_number%)) effect
		READ_SHORT (%eff_offset% + 0x18 + (0x108 * %eff_number%)) prof
		PATCH_IF (effect = 233) BEGIN
		  PATCH_IF (prof = 89) OR (prof = 90) OR (prof = 91) OR (prof = 92) OR (prof = 93) OR (prof = 94) OR (prof = 95) OR (prof = 96) OR (prof = 97) OR (prof = 98) OR (prof = 99) OR (prof = 100) OR (prof = 101) OR (prof = 102) OR (prof = 103) OR (prof = 104) OR (prof = 105) OR (prof = 106) OR (prof = 107) OR (prof = 111) OR (prof = 112) OR (prof = 113) OR (prof = 114) OR (prof = 115) BEGIN
		    WRITE_LONG (%eff_offset% + 0x88 + (0x108 * %eff_number%)) 1
		    WRITE_ASCII (%eff_offset% + 0x8c + (0x108 * %eff_number%)) ~D5PROFZ~ #8
		  END
		END
	  END
	BUT_ONLY
END

What exactly are you trying to remove? It might be something to do with the timing mode you are using in your .EFF - some effects become impossible to remove when applied with certain timing modes. Maybe use timing mode 0 in your EFF, with a very long duration like 100000000 (which is about 25 in-game years, or something).

Link to comment

I remember having tried the external .eff implementation before without any success, both by setting the parent resource and the mschool/msectype within the .eff. You could selectively block effects within an .itm or .spl but you cannot selectively dispel them. I might've discussed this with @kjeron or @Luke before. You cannot have an effect use two mschools/msectypes or resources without some contorted workarounds.

Link to comment

Ehhh... I am sorry, it seems that I've made some mistake when testing yesterday, although I am not sure where. Anyway, you CAN remove effects that are applied through opcode 177 by applying opcode 321 or 221 properly.

The only problem is that you don't have direct access to the effect which is applied through opcode 177, so no matter what school, secondary type or parent resource it has, you can't dispel it directly. This makes the opcode much less flexible, but if you really need that you can always use opcode 146 to cast a subspell that encapsulates just that opcode 177, though this has its own set of issues... 

Link to comment

What I mean is just that I can't make my opcodes interact with and look at that effect directly. Sure, I can remove it, but that's done through removal of opcode 177, which "unlinks" that .eff file from my creature, at least that's how I understand it. I can dispel my effect, but only through dispelling the spell that applies it through opcode 177. I can't however dispel it by using its own spell school, secondary type or parent resource (though I can protect from it using opcode 206 and that same parent resource field).

Link to comment

I still don't entirely understand what you are saying. But see my code above - you definitely can remove effects from creatures directly by means of a parent resource assigned to those effects. But it depends on timing modes. Some effects, when applied with timing mode 1, become permanent changes to a .CRE file rather than effects on that .CRE file, and these cannot be removed by op321, because op321 needs an actual effect to remove. Likewise, Effects applied with timing mode 2 (while equipped) cannot be dispelled by any normal spell-removal means - that is why the Cloak of Nondetection is so much more powerful than the Nondetection spell.

Link to comment
Quote

I still don't entirely understand what you are saying. But see my code above - you definitely can remove effects from creatures directly by means of a parent resource assigned to those effects.

I just tested it and it doesn't work for me. Here's what I did:

1. Created EFF1 which shows portrait icon for 100 seconds (timing mode = 0) and assigned XYZ as its Parent Resource

2. For SPL1 I added opcode 177, which applies EFF1 for 100 seconds (timing mode = 0)

3. For SPL2 I added opcode 321 with resource set to XYZ

4. I cast SPL1 and that new portrait icon appeared as expected

5. I cast SPL2 which should remove EFF1, since it has matching parent resource, but nothing happened

 

Ofc if I set EFF1's parent resource to SPL1 or even left it unset, but changed SPL2's opcode 321 to remove SPL1 instead of XYZ, then I'd remove EFF1, but that's not what I want, I want to affect just EFF1 without touching the spell that applies it.

Link to comment
Posted (edited)

Did you set the 'parent resource type' in the .EFF file? I think it is at 0x90 in the file, needs to be set to 1.

If that still doesn't work, then I guess the actual parent resource is overriding the specified parent resource. In which case I suppose you would have to use subspells.

Edited by subtledoctor
Link to comment
Quote

Did you set the 'parent resource type' in the .EFF file? I think it is at 0x90 in the file, needs to be set to 1.

Good point, this time I forgot about that. I set the value properly (just like IESDP says) but still got no results. The problem is that opcode 321 only looks at effects that are directly attached to the creature, my EFF1 is attached indirectly through opcode 177. When I save the game while running SPL1 and open the save in EE Keeper, I can see only opcode 177 running on my creature, not 142 (portrait icon)

 

Anyway, I can at least remove EFF1 through removing the whole SPL1 through opcode 32, 220 or 221, which is still better than what I hade when starting this thread :) so thank you very much for your help and insightful comments!

Link to comment
29 minutes ago, SparrowJacek said:

When I save the game while running SPL1 and open the save in EE Keeper, I can see only opcode 177 running on my creature, not 142 (portrait icon)

Ah! Now I understand. And yeah, I can see how that would prevent the removal. In which case, I guess you would need to use a subspell via 146 or 326, instead of an EFF via 177.

Good to explore these edge cases, details like this are good to know!

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...