Allbrother Posted April 22, 2022 Share Posted April 22, 2022 (edited) Sorry about the title, kinda hard to summarize. Okay here's the deal: I'm trying to make an ability that resets itself upon the caster scoring a kill while it's active. To that end, I added a global effect with opcode #232 (pictured) to recast the ability on actor death. This is when I ran into the first problem. It would fire off okay on the first kill, but then on the second kill it would fire off twice. Next kill, it would fire off 4 times. And it would keep doubling up until eventually lagging up and potentially crashing the game. I tried a bunch of stuff that didn't work until it occured to me to try the special field. I put a 1 in there and that did limit it to a single activation, however now it prints out an annoying "contingency spell activation" message every time. It's an improvement, but I'd still like to get rid of it. I tried numbers 1 through 10 and all odd numbers seem to do the same, while some of the even numbers result in a couple of resets working as intended before starting to stack up again. So, anyone know if any and what number in there would do the job without spamming the log? Or of another way to achieve this effect? Edit: Also worth noting this is 2.5 edit 2: solution here: Edited April 22, 2022 by Allbrother Quote Link to comment
subtledoctor Posted April 22, 2022 Share Posted April 22, 2022 Try going back to 0 in the special field, and adding a 321 effect at the top of the stack of effects? That way when it resets, it will cancel itself and be applied anew, instead of stacking with itself. EE-only, though. Quote Link to comment
Allbrother Posted April 22, 2022 Author Share Posted April 22, 2022 (edited) I have this as the first effect within the spell's ability. Stops the other effects from stacking, but doesn't affect the global effect. I also tried to have it fire off via another on kill global effect, but that didn't do anything. Putting it as a global effect by itself didn't do much better - it removed the duration effects in the spell's ability, but still fired off multiple times. Edit: Also worth noting this is 2.5 Edited April 22, 2022 by Allbrother Quote Link to comment
Dan_P Posted April 22, 2022 Share Posted April 22, 2022 Try having the spell block itself for a few seconds with op206 (as the last effect). You can use a short duration like 2-4 seconds if you want to keep it under a round. I had some doubling effects issues with op272 (Use EFF on condition) and used this to prevent it. Quote Link to comment
Allbrother Posted April 22, 2022 Author Share Posted April 22, 2022 3 minutes ago, Dan_P said: Try having the spell block itself for a few seconds with op206 (as the last effect). You can use a short duration like 2-4 seconds if you want to keep it under a round. I had some doubling effects issues with op272 (Use EFF on condition) and used this to prevent it. As the last effect in the ability header or as the last global effect? Quote Link to comment
Dan_P Posted April 22, 2022 Share Posted April 22, 2022 I put it on the spell itself. So it casts, adds all the effects, then as the last effect, prevents the target from being affected by the same spell for a few seconds. Quote Link to comment
Allbrother Posted April 22, 2022 Author Share Posted April 22, 2022 13 minutes ago, Dan_P said: I put it on the spell itself. So it casts, adds all the effects, then as the last effect, prevents the target from being affected by the same spell for a few seconds. I tried it both ways, it didn't change the effect - it stopped anything within the header ability from firing more than once, but the global effect still stacked per the combat log. Quote Link to comment
Dan_P Posted April 22, 2022 Share Posted April 22, 2022 (edited) I just tried this quickly with a copy of barbarian rage, and it seems to work? I added the op232 to recast, and an op321 to remove effects (but not op206 because it wasn't needed). I'm not getting duplicate messages on EE v2.6. You can try this file. If you're getting multiple castings or messages, it might be a pre-v2.6 issue. TestRage.zip Edit: file above doesn't actually work. See this post for explanation. Edited April 22, 2022 by Dan_P Quote Link to comment
Allbrother Posted April 22, 2022 Author Share Posted April 22, 2022 (edited) 35 minutes ago, Dan_P said: I just tried this quickly with a copy of barbarian rage, and it seems to work? I added the op232 to recast, and an op321 to remove effects (but not op206 because it wasn't needed). I'm not getting duplicate messages on EE v2.6. You can try this file. If you're getting multiple castings or messages, it might be a pre-v2.6 issue. TestRage.zip 756 B · 1 download Must be a 2.5 thing then, because I got hit with "You cannot cast multiple instances of the same contingency spell on yourself." when I tried that. I even tried straight up plugging your working file in my 2da in case I fucked it up somehow, but same thing. Damn... I guess I'll have to live with the cluttered log. Thanks for the help Edited April 22, 2022 by Allbrother Quote Link to comment
kjeron Posted April 22, 2022 Share Posted April 22, 2022 (edited) The feedback string "You cannot cast multiple instances of the same contingency spell on yourself" is no longer displayed in v2.6 (possibly related to this). An instance of op232 will block all subsequent effects with the same parent resource. You need to put op232 in an EFF and call it via op177 to bypass this, while keeping the op321 as the first effect to avoid stacking. Global effects do not register a parent resource, which is why you saw a difference using that. If you want to avoid the feedback "A contingnecy spell has fired", the special field must be an even value. Edited April 22, 2022 by kjeron Quote Link to comment
Dan_P Posted April 22, 2022 Share Posted April 22, 2022 (edited) Spoke too soon. Looks like my file is blocked from being recast. It gives the Barbarian Rage message as if it were being recast, but it's not actually. So basically, it still ends after 30 seconds, probably like the contingency message you were getting. Edit: Looks like kjeron's post above explains why. Edited April 22, 2022 by Dan_P Quote Link to comment
Allbrother Posted April 22, 2022 Author Share Posted April 22, 2022 35 minutes ago, kjeron said: You need to put op232 in an EFF and call it via op177 to bypass this, while keeping the op321 as the first effect to avoid stacking. Global effects do not register a parent resource, which is why you saw a difference using that. Works like a charm now. F me, why didn't I think of trying that?! Thank you very much 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.