Jump to content

How to add save penalty to spells?


Recommended Posts

I want to make a mod for the Beastmaster kit. One of the changes I want to make is that the Charm Animal ability that all rangers get is better for Beastmasters.

When one uses it I want the target to have a -2 penalty to the save at level 1 and the penalty should increase at levels 6, 12 and 18.

I found the file for Charm Animal: spcl311.spl. 

 

So to make sure I know what I'm doing:

I could make a copy of the spell, assign it to the kit instead of the original. 

Add opcode #37 to it to add a -2 penalty. Do I put Cumulative Modifier so that something like greater malison can stack? Or would Flat Modifier still allow this?

And it should be possible to add a level override right? Adding it again with a higher minimum level?

Link to comment

Rather than using opcode #37, look at all the other opcodes for the spell. For example, spcl311.spl has opcodes #142, #5, and #215. Each opcode has its own individual saving throw setting - look here in DLTCEP (but it's the same for NI if you're using that, just the UI layout is different):

DLTCEP_0HtEoQbidt.png

Change the saving throw and bonus values on each opcode to match instead - it's how everything else in the game is handled, and is less likely to cause problems (...although if you have a particularly complex spell with hundreds of opcodes used, it can be pretty annoying to change every single one without some automated way of doing it - I do it via hex, other people whip up patching code instead).

Note that the saving throw type (and I THINK bonus value although I'm not 100% absolutely certain on that, somebody else would know for sure) should match if you want the same throwing throw roll to be used for the same spell. If you have a spell that has separate effects for different types of saving throws (for example, save vs. breath for damage, save vs. spell for some additional side-effect), then you make the associated opcodes for each separate effect match instead.

Edited by Bartimaeus
Link to comment
24 minutes ago, Bartimaeus said:

Change the saving throw and bonus values on each opcode to match instead

 

24 minutes ago, Bartimaeus said:

Note that the saving throw type should match if you want the same throwing throw roll to be used for the same spell.

What do you mean?

cant I just change the bonus for opcode 5 since thats the one with the charm effect?

Link to comment
29 minutes ago, gamemaster76 said:

 

What do you mean?

cant I just change the bonus for opcode 5 since thats the one with the charm effect?

Let's say you did that - you add a -2 saving throw to *just* opcode 5 (charm). So you cast the spell on an eligible creature, and they fail their saving throw for the charm effect - but NOT the others, because the saving throw/bonus for them was different and the creature successfully saved against them. So now the creature is charmed, but the other opcodes, #142 (Display Special Effect Icon) and #215 (Play 3D Effect), do not fire. For this particular spell, this just means some graphical effects will not play so ultimately it will be visually inconsistent but relatively harmless. For other spells where multiple effects are necessary for the spell to completely function, you can start to imagine where you might start running into issues. Even for simple spells like this, if your intended effect has other associated opcodes (such as display portrait icon, play 3D effect, play sound, display string, apply lighting effect, to name just a few of the most frequently occurring), you should make the saving throw consistent across all effects unless you truly do not care if the effects will be inconsistently applied. I personally would not want a spell that only sometimes plays the intended graphical effect that shows it was successfully applied instead of all the time, but if you're doing spells and abilities just for yourself, you can make your own decisions on what's worth your time to edit.

Edited by Bartimaeus
Link to comment
Posted (edited)
18 minutes ago, Bartimaeus said:

Let's say you did that - you add a -2 saving throw to *just* opcode 5 (charm). So you cast the spell on an eligible creature, and they fail their saving throw for the charm effect - but NOT the others, because the saving throw/bonus for them was different and the creature successfully saved against them. So now the creature is charmed, but the other opcodes, #142 (Display Special Effect Icon) and #215 (Play 3D Effect), do not fire. For this particular spell, this just means some graphical effects will not play so ultimately it will be visually inconsistent but relatively harmless. For other spells where multiple effects are necessary for the spell to completely function, you can start to imagine where you might start running into issues. Even for simple spells like this, if your intended effect has other associated opcodes (such as display portrait icon, play 3D effect, play sound, display string, apply lighting effect, to name just a few of the most frequently occurring), you should make the saving throw consistent across all effects unless you truly do not care if the effects will be inconsistently applied. I personally would not want a spell that only sometimes plays the intended graphical effect that shows it was successfully applied instead of all the time, but if you're doing spells and abilities just for yourself, you can make your own decisions on what's worth your time to edit.

oh! ok now I get it, thanks!

 

So how would I make it that the bonus increases at certain levels if I did it like that?

Edited by gamemaster76
Link to comment
2 hours ago, gamemaster76 said:

oh! ok now I get it, thanks!

 

So how would I make it that the bonus increases at certain levels if I did it like that?

Poke around with Mirror Image (SPWI212.spl).

https://dl.dropboxusercontent.com/s/1y4kcoku0iejaqw/eZ4Zj4hq0g.mp4

Every header is essentially a new spell, and which one you actually cast is tied to what level the casting character is. The first header (required level 1) does its four opcodes, creating 3 images; the second header (required level 6) also has its opcodes, but they do not necessarily have to be the same opcodes - in this case, they are, except the Mirror Image opcode (#159) is changed to instead create 4 images. You can probably start to get a grasp of how exhausting spell-making can be doing it manually this way when you start to consider that a number of spells have durations of like "1 round/level": every single new level will have its own header with its own effects, and every opcode for the specific header will need to have its duration set individually. So if you have a spell with a duration that changes every experience level, and you have 30 opcodes that are used at each level, and you want it to scale up to level 20, then if it were a first level spell, there'd be 20 headers with 30 opcodes each for a total of 600 opcodes that you have to set the duration for. If this were an offensive spell with a saving throw that scales up with level, you'd also have to change the saving throw for each opcode.

Depending on the spell, it can be utterly insane: that's why I often makes changes via hex editing instead of DLTCEP or NI, since I can automate and make pattern-based changes very quickly. But that's an entirely different subject and one that I'm not about to get into.

Edited by Bartimaeus
Link to comment

To the OP: try this. I'm not sure if it will work, but it has in the past, only I don't remember the settings. If you can't find out the right combination, tag kjeron. He'll know for sure. What you do is this: put opcode 326, Apply effects list, on top of your main spell's effects list. This targets Self, filters through your kit and applies a secondary spell. The secondary spell has no projectile and is either Dead actor or Living actor - try both if one doesn't work - and its only effect is "Save vs. spell bonus," target Preset target. Put the penalty you want on top and make the duration very short, like 2 ticks. With the right settings this will deliver the penalty before the rest of the main spell comes in.

Edited by temnix
Link to comment
Posted (edited)
On 3/2/2021 at 3:48 PM, Bartimaeus said:

Poke around with Mirror Image (SPWI212.spl).

https://dl.dropboxusercontent.com/s/1y4kcoku0iejaqw/eZ4Zj4hq0g.mp4

Every header is essentially a new spell, and which one you actually cast is tied to what level the casting character is. The first header (required level 1) does its four opcodes, creating 3 images; the second header (required level 6) also has its opcodes, but they do not necessarily have to be the same opcodes - in this case, they are, except the Mirror Image opcode (#159) is changed to instead create 4 images. You can probably start to get a grasp of how exhausting spell-making can be doing it manually this way when you start to consider that a number of spells have durations of like "1 round/level": every single new level will have its own header with its own effects, and every opcode for the specific header will need to have its duration set individually. So if you have a spell with a duration that changes every experience level, and you have 30 opcodes that are used at each level, and you want it to scale up to level 20, then if it were a first level spell, there'd be 20 headers with 30 opcodes each for a total of 600 opcodes that you have to set the duration for. If this were an offensive spell with a saving throw that scales up with level, you'd also have to change the saving throw for each opcode.

Depending on the spell, it can be utterly insane: that's why I often makes changes via hex editing instead of DLTCEP or NI, since I can automate and make pattern-based changes very quickly. But that's an entirely different subject and one that I'm not about to get into.

ouf.. ok so I'm trying to do all this in Weidu, I figured out how to add the penalty, but I cant figure out how to clone the entire spell effect. The closest I can find is the CLONE_EFFECT function... but I don't think that actually for ability effects, only the specific opcodes within them.

 

 

Edited by gamemaster76
Link to comment
On 3/2/2021 at 6:56 PM, temnix said:

To the OP: try this. I'm not sure if it will work, but it has in the past, only I don't remember the settings. If you can't find out the right combination, tag kjeron. He'll know for sure. What you do is this: put opcode 326, Apply effects list, on top of your main spell's effects list. This targets Self, filters through your kit and applies a secondary spell. The secondary spell has no projectile and is either Dead actor or Living actor - try both if one doesn't work - and its only effect is "Save vs. spell bonus," target Preset target. Put the penalty you want on top and make the duration very short, like 2 ticks. With the right settings this will deliver the penalty before the rest of the main spell comes in.

Ill keep this one in mind, I already have most of the code I need to make it work otherwise, but if the last part is too complicated ill try this.

Link to comment

There is an ADD_SPELL_HEADER function floating around... you need it if you use the CREATE function to create new spells, since CREATE makes a spell with no ability headers. (Which is weird and annoying.) If you really want to operate 100% by Weidu, you can get comfortable with that. I think Aquadrizzt, for example, likes to operate entirely by code, and create files on the fly.

There is also Camdawg's EXTEND-O-MATIC thing, which I think makes new ability headers with progressing min levels. Not what was asked for, but maybe worth looking at the code.

But in general I don't like to mess with ability headers, other than to ALTER_SPELL_HEADER them. I don't use CREATE for spells - I pack a blank .SPL file with a single ability header, and I add effects to the header with code.  In my new 5E casting conversion, I manually made a .SPL with 40 blank ability headers, and I clone the file and add effects to each header to simulate with might normally be in a CLAB table.  If I need a spell with between 2 and 39 headers, I'll just make the spell manually in NI and simply copy it with Weidu, just like SR.  Using code to patch stuff is convenient and make adjusting things a LOT easier, but I'm not religious about it.

(Sidebar: there's a reason SR sets so many spell durations to 1/2/5/10 turns. Do I really care whether my Mirror Image lasts 84 seconds or 90 seconds? Making that stuff level-dependent is a TON of extra work, for very little gain.)

Link to comment
12 minutes ago, subtledoctor said:

There is an ADD_SPELL_HEADER function floating around... you need it if you use the CREATE function to create new spells, since CREATE makes a spell with no ability headers. (Which is weird and annoying.) If you really want to operate 100% by Weidu, you can get comfortable with that. I think Aquadrizzt, for example, likes to operate entirely by code, and create files on the fly.

There is also Camdawg's EXTEND-O-MATIC thing, which I think makes new ability headers with progressing min levels. Not what was asked for, but maybe worth looking at the code.

But in general I don't like to mess with ability headers, other than to ALTER_SPELL_HEADER them. I don't use CREATE for spells - I pack a blank .SPL file with a single ability header, and I add effects to the header with code.  In my new 5E casting conversion, I manually made a .SPL with 40 blank ability headers, and I clone the file and add effects to each header to simulate with might normally be in a CLAB table.  If I need a spell with between 2 and 39 headers, I'll just make the spell manually in NI and simply copy it with Weidu, just like SR.  Using code to patch stuff is convenient and make adjusting things a LOT easier, but I'm not religious about it.

(Sidebar: there's a reason SR sets so many spell durations to 1/2/5/10 turns. Do I really care whether my Mirror Image lasts 84 seconds or 90 seconds? Making that stuff level-dependent is a TON of extra work, for very little gain.)

ouf good to know...then this might be a case were its better to just make it manually and pack it in with the mod. Thanks!

Link to comment
1 hour ago, subtledoctor said:

(Sidebar: there's a reason SR sets so many spell durations to 1/2/5/10 turns. Do I really care whether my Mirror Image lasts 84 seconds or 90 seconds? Making that stuff level-dependent is a TON of extra work, for very little gain.)

Yeah, I wouldn't have ever bothered with those kinds of spell durations in SRR if I hadn't automated roughly 95% of it via some autohotkey and hex-editing scripts. I think the very worst spell I ever edited was SR's Physical Mirror, which has about an average of ~105 opcodes per header, and requires adds an additional reflected image every additional round it lasts. That little caveat made it very difficult to handle via my scripts, and the ridiculous amount of opcodes didn't help either...

It's no wonder that it's the largest .spl in my override at 150 KB.

Edited by Bartimaeus
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...