Jump to content


Photo

Target filters for effects


  • Please log in to reply
9 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 22 August 2016 - 09:24 AM

Sometimes a spell is only meant to be cast on friendly creatures, with the green circle, or on anyone but enemies. The Target field has some filters I can use, but not quite enough, and their meaning is less than obvious. For example, does "Party" only include Players 1-6, or does it also include summoned and charmed creatures? What is the "Caster Group?" What is the "Target Group?" And how do you further filter effects application? When I want some creatures to be excluded from the effects of a spell, I usually put a Protection From Spell effect for 3 seconds in the beginning of that spell's list of effects, choose the creature type and enter that very spell's name there, so it makes these creatures immune to itself first thing. With this method, however, they also become immune to all consequent effects of the spell, to all other powers it triggers, which is not always what I want. In that case I have to either put the immunity in the middle of the effects list, after the ones I want to be universal but before the ones I want to be exclusive, or go a longer way - contain those extra effects in a different spell to be cast along with the first, or else delay them for a few seconds until the immunity runs out.

 

Another way I haven't tried yet would be to preface the effects in the Spell Ability with a combination of area-wide immunities from the Global effects list. For these I need to make sure the spell isn't Hostile, otherwise the whole map will rebel against me. But that means that if some of the effects are offensive after all, and I want the fact recognized, I have to make a further spell to be cast from within the first one, which only serves as a shell, and put all of the offense in that next spell. If you are thinking, why not use an Apply Effects List and choose who the spell will apply to there, then the answer is, usually I have to do a lot more excluding from effects than including in them, so things like applying the effect only to evil creatures or only to humanoids are too generic. The ready categories are strange, too. For example, effects that work on Humanoids don't work on Giant Humanoids, and while that follows the logic from pen-and-paper for spells like Hold Person, I can think of a lot of Enchantment spells that *should* work on giants just as well as halflings. Then, if I have a different class of creatures in mind I want my spell to affect, I have to do one of two things. The first option is to compile "lists" of eligible creatures, usually Races, and use Apply Effects List for each of them. That allows great customization, because you can also enter saving throw adjustments for each, but it's a huge drag. The other possibility is to exclude a few Races or other groups by giving them an immunity, and I found this to be much faster, but with the drawbacks described above.   

 

These options sometimes do just what I want in the end. For instance, my Taunt spell is not even supposed to anger inhuman creatures like elementals or undead, so it has no Hostile check set, and they are excluded from its effects by an immunity early in the list. Taunt a group of them as much as you like, no one will even have to make a saving throw or turn red. But a second spell cast from the bottom of the list is Hostile, and that one gets through to the appropriate creatures in a mixed group. So that works rather nicely. On the whole, however, these are all very awkward ways of filtering, and I have to puzzle over this every time I start something new. If you have better methods of quickly weeding out creatures that you use, what are they? Maybe a tried-and-true combination of Global effects and effects in the Spell Ability?



#2 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 22 August 2016 - 03:43 PM

Opcode #177 (Use EFF File) lets you target specific types of creatures and apply one .EFF to them.

 

Opcode #146 (Cast Spell at Creature) lets you cast a different spell.

 

Opcode #206 (Protection from Spell) lets you provide immunity to a spell.

 

 

You can chain #177 into #146 to apply multiple effects only to certain creatures.

 

You can use #177 with #206 to provide immunity to the main spell or to sub-spells that the main spell casts via #146, if you want certain creatures to be totally or partially immune to the effects.



#3 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 22 August 2016 - 06:33 PM

Great info. Could you give me a specific example from a mod that does this so I can see the code? Some of this is fairly obtuse for me without examples.

#4 temnix

temnix
  • Member
  • 983 posts

Posted 23 August 2016 - 06:19 AM

Are you asking Mike or me?



#5 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 25 August 2016 - 05:48 PM

Great info. Could you give me a specific example from a mod that does this so I can see the code? Some of this is fairly obtuse for me without examples.

Spell Revisions' Firestorm (sppr705.spl) is an interesting example. The spell deals X fire damage every round for 4 rounds in a 30-foot area, but creatures within 10 feet of the caster are protected.

First, sppr705.spl uses #177 to target fire elementals in the 30-foot area and provides them immunity to sppr705.spl via #206. While fire elementals would normally suffer no damage because they have 100% fire resistance, if I recall correctly, even suffering 0 damage can interrupt spellcasts (in the non-EE engine).

Second, sppr705.spl uses #146 to cast sppr705d.spl targeted on the caster. sppr705d.spl uses 4 instances of #146 to cast sppr705e.spl, delayed so that one is triggered each round. sppr705e.spl uses a 10-foot projectile with #206 to provide immunity to sppr705.spl for one round.

Finally, sppr705.spl uses #12 to deal its damage to creatures in the 30-foot area that have not received immunity.


Like me, you may wonder how the damage happens every round, since there are no delayed effects for it. It turns out that the Meteor Swarm projectile used by sppr705.spl (metswarm.pro) repeats 4 times. I suspect that the effects other than damage also repeat every round. However, the #146 effect might be an exception to this because it's using Target: Self instead of the preset target of the projectile. (I can't otherwise explain why the delayed effects in sppr705d.spl are needed.) I'll send Demi a link to this thread and if he's around, he may be able to shed some light on the issue.

#6 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 25 August 2016 - 11:14 PM

Ah, right. I was thinking of using something similar for skill-use-penalties-near-combat, but have it filtered so certain IDSs (a thief kit, specifically) were unaffected.

You're right on the PRO. I think ice storm does the same thing (DoT). Original, Fixpack, and EE only have it for 3 rounds instead of the listed 4. PRO as a timed effect-delivery method is severely underrated, imo.

#7 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 26 August 2016 - 02:16 AM

Not really underrated, it just doesn't have many useful applications outside of ticking area effects, as it's not very customizable. You can use it for a multi-charged trap, though.
 
As far as EEs are concerned, there's new opcode 328, that can do much wider in scope filtering than 177 and call a SPL instead of EFF.

EDIT It's 326, not 328...

Edited by GeN1e, 27 August 2016 - 07:11 AM.

Retired from modding.


#8 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 26 August 2016 - 01:08 PM

Is there a way to get the collected patch notes w/o re-installing bg2ee?


Edited by Fiann of the Silver Hand, 26 August 2016 - 01:28 PM.


#9 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 26 August 2016 - 01:14 PM

As far as EEs are concerned, there's new opcode 328, that can do much wider in scope filtering than 177 and call a SPL instead of EFF.

I only go by what's in IESDP. Got a current one that lists 328?

Lynx made this, and the direct link, while that info is here.

It's the IESDP. Notice the period at the end there. :devil:


Edited by The Imp, 26 August 2016 - 01:31 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#10 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Member
  • 286 posts

Posted 26 August 2016 - 01:29 PM

Groovy. Thanks.

 

[edit]  Dang.  I forgot I changed the css on my local copy.  I had all those tedious re-iterations behind spoiler tags.  There's not a changelog anywhere for the differences between the old IESDP and this, is there?


Edited by Fiann of the Silver Hand, 26 August 2016 - 01:35 PM.