subtledoctor Posted September 9, 2021 Posted September 9, 2021 On 6/15/2019 at 8:26 PM, DavidW said: Define a function that reads savebonus, adds something, writes it back. Then run ALTER_EFFECT I've long wished for a "READ_EFFECT" companion to the ALTER_, CLONE_, and DELETE_EFFECT. Always end up just doing it manually with GET_OFFSET_ARRAY instead of clamoring for this, but boy would it be handy for casual use. Quote
DavidW Posted September 9, 2021 Author Posted September 9, 2021 The return interface is a bit tricky. Is one returning just the last result obtained, or an array of all of them? Quote
subtledoctor Posted September 9, 2021 Posted September 9, 2021 2 hours ago, DavidW said: The return interface is a bit tricky. Is one returning just the last result obtained, or an array of all of them? I don't have anything specific in mind, I just thought it would be nice to do something like COPY_EXISTING ~spell.spl~ ~override~ LPF READ_EFFECT INT_VAR match_opcode = 0 RET duration END Something like that. Looking at it, I see right off it could be problematic if there are two matching instances (such as multiple opcode 0 effects). Anyway, I'm mostly just musing. I always thought something like that would be nice. But I'm not sure it's worth anyone putting real time into. Quote
subtledoctor Posted September 21, 2021 Posted September 21, 2021 (edited) More relevant question: I have used this in one of my mods where I needed to ALTER_EFFECT something to a negative value. Works great - thank you! But I am a bit worried about dropping this in /lib/ and INCLUDEing it; I have a zillion other instances where I use the traditional *_EFFECT functions, and if they suddenly switch to using this version, with arguments assuming the old version, I don't want something to go astray. My current solution is to simply rename these enhanced functions to ALTER_EFFECT_DW, CLONE_EFFECT_DW, etc. Works like a charm* and has the side-effect of clearly showing where credit for the work goes. But maybe I am being too cautious? Should I just suck it up and completely overwrite the original Weidu functions with these? What worked on the old ones will work on the new ones? ... * (Wait, do charms actually work??) Edited September 21, 2021 by subtledoctor Quote
DavidW Posted September 22, 2021 Author Posted September 22, 2021 They ought to be fine. I use Cam's code (the one included in WEIDU) as a base and then just add other functionality. If you don't use that other functionality, the results should be identical. It's always possible I broke something, of course, but I don't think so (I've been using these modified functions for a while, including in SCS and (iirc) Ascension, and problems haven't arisen. Quote
RoyalProtector Posted September 3, 2024 Posted September 3, 2024 The link no longer works. Is this modified function found somewhere? Quote
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.