Jump to content

Photo

help me figure out how to structure this spell


7 replies to this topic

#1 subtledoctor

subtledoctor
  • Modders
  • 2854 posts
  • Gender:Male

Posted 16 October 2018 - 02:56 PM

I'm trying to recreate the IWD spell Produce Fire as a semi-psionic ability.  The key thing about my psionic abilities is, they sap the caster of max hp; and if the caster doesn't have enough hp to survive such a decrease, the ability should not fire.  Currently the ability is structured like this:

 

Spell1 has:

- header target = any location

- no projectile

- effect 1 = opcode 146, cast spell, target = self, resource = SubspellA

- effect 2 = opcode 318, target = self, condition = not enough hp, resource = Spell1

- effect 3 = opcode 148, cast spell at point, target = preset target, resource = SubspellB

 

SubspellA has

- target = self, 6 points damage, reduce max hp by 6

 

SubspellB has:

- header target = any location

- projectile = Produce Fire projectile (affects anyone in ~15' diameter

- effect 1 = fire damage, target = preset target

 

For whatever reason, it seems like anyone affected by the Produce Fire projectile is losing 6 hp/max hp - they're being affected by SubspellA.  I think there's some kind of problem with having no projectile, and a 148 effect, and a subspell with a projectile.  But I can't put the projectile in SpellA because the 146 and 318 effects need to target the caster.  When the projectile was in Spell1, the "self" target of the 146 and 318 effects seemed to transfer to the projectile targets, instead applying to the caster.

 

Hmm, maybe I can put the projectile in Spell1, and those effects can use target 9 "original caster?"


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#2 Ulb

Ulb
  • Members
  • 195 posts
  • Gender:Male

Posted 16 October 2018 - 04:43 PM

Spell1 has:

- header target = any location

- no projectile

- effect 1 = opcode 146, cast spell, target = self, resource = SubspellA

- effect 2 = opcode 318, target = self, condition = not enough hp, resource = Spell1

- effect 3 = opcode 148, cast spell at point, target = preset target, resource = SubspellB

 

SubspellA has

- target = self, 6 points damage, reduce max hp by 6

 

SubspellB has:

- header target = any location

- projectile = Produce Fire projectile (affects anyone in ~15' diameter

- effect 1 = fire damage, target = preset target

 

 

Maybe I'm missing something but I'm really confused how your spell1's second effect is supposed to protect the caster from its first effect in any case?

 

For whatever reason, it seems like anyone affected by the Produce Fire projectile is losing 6 hp/max hp - they're being affected by SubspellA.

 

Are they really though? I would assume everyone is affected by Spell1. You could test this by just reducing subB's projectile range to 1 or something and see if targets outside are still affected.

 

For me it looks like your Spell1 with its target set to any point within range will affect anyone within your set range (which makes sense) and since your second effect can never protect anyone from the first effect- which will already have been resolved at that point- anyone gets hit by SubspellA.



#3 subtledoctor

subtledoctor
  • Modders
  • 2854 posts
  • Gender:Male

Posted 16 October 2018 - 04:59 PM

Maybe I'm missing something but I'm really confused how your spell1's second effect is supposed to protect the caster from its first effect in any case?


It doesn't. SubspellA reducing the caster's hp should be cast no matter what. Thus, the 146 effect comes first. The 318 effect is next, and if the conditions are met (not enough hp) then the rest of the spell - the actual Produce Fire part - doesn't happen. The idea is, if you try the use the ability without enough energy reserves, it misfires and you get hurt. (SubspellA has conditions handling this... basically it does nonlethal damage to you, so you knock yourself unconscious.)

Are they really though? I would assume everyone is affected by Spell1. You could test this by just reducing subB's projectile range to 1 or something and see if targets outside are still affected.
 
For me it looks like your Spell1 with its target set to any point within range will affect anyone within your set range (which makes sense) and since your second effect can never protect anyone from the first effect- which will already have been resolved at that point- anyone gets hit by SubspellA.


Ah, I think you're right. Effect target "self" isn't good enough; maybe I need a header targeting "caster." I just don't onow how to structure that such that you also get an ability targeting "any point in range." Is this just asking too much of the engine's spell structure?

It's weird, I have this working just fine for single-target abilities; I target a creature, and the main spell affects me while a subspell affects the creature. For some reason going from single-target to an area effect is throwing me. Presumably because the latter requires use of a projectile while the former doesn't.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#4 Ulb

Ulb
  • Members
  • 195 posts
  • Gender:Male

Posted 16 October 2018 - 09:17 PM

 

It doesn't. SubspellA reducing the caster's hp should be cast no matter what. Thus, the 146 effect comes first. The 318 effect is next, and if the conditions are met (not enough hp) then the rest of the spell - the actual Produce Fire part - doesn't happen. The idea is, if you try the use the ability without enough energy reserves, it misfires and you get hurt. (SubspellA has conditions handling this... basically it does nonlethal damage to you, so you knock yourself unconscious.)
 

 

Ah, okay didn't get that it is supposed to always damage and that the spell takes care about preventing leathal.

 

As for your problem, have you tried simply chaning the target to original caster? I would assume that works.

 

It's weird, I have this working just fine for single-target abilities; I target a creature, and the main spell affects me while a subspell affects the creature. For some reason going from single-target to an area effect is throwing me. Presumably because the latter requires use of a projectile while the former doesn't.

 

Yeah, I can only guess but maybe the engine handles that "at any point" as if the spell was an area projectile affecting anyone within range of target point. I agree though it is inconsistent with what one would expectr from how single target spells work. On the other hand.. if it worked like that the spell should also make all creatures cast subspellB, is that the case?


Edited by Ulb, 16 October 2018 - 09:19 PM.


#5 subtledoctor

subtledoctor
  • Modders
  • 2854 posts
  • Gender:Male

Posted 17 October 2018 - 05:53 AM

Yeah, I can only guess but maybe the engine handles that "at any point" as if the spell was an area projectile affecting anyone within range of target point. I agree though it is inconsistent with what one would expectr from how single target spells work. On the other hand.. if it worked like that the spell should also make all creatures cast subspellB, is that the case?

Right. At first when I wasn't using a subspell, I just had a spell with a projectile, and target = any point.  I (foolishly) though setting the effect targets variously to "self" vs. "preset target" would allow the effects to distinguish between the caster and targets.  But it doesn't.  Instead the 146 effect was fired from every target hit by the projectile. 

 

I hoped using several subspells could separate the effects enough that the caster-focused stuff would stay on the caster, and the target-focused stuff would travel through a projectile.  But clearly that is easier said than done.


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#6 kjeron

kjeron
  • Members
  • 136 posts

Posted 17 October 2018 - 07:46 AM

Which casting mode are each of the opcode 146/148 effects using?
Is "Spell1" being cast manually or by another spell/opcode?

This should work:
Spell1 has:
- header target = any location
- projectile "None - 1"
- effect 1 = opcode 146, cast spell, target = self, param2=1, resource = SubspellA
- effect 2 = opcode 318, target = self, condition = not enough hp, resource = Spell1
- effect 3 = opcode 148, cast spell at point, target = self, param2=(0 or 1), resource = SubspellB

SubspellA has
- projectile "None - 1"
- target = self, 6 points damage, reduce max hp by 6

SubspellB has:
- header target = irrelevant
- projectile = Produce Fire projectile (affects anyone in ~15' diameter)
- effect 1 = fire damage, target = preset target

 



#7 subtledoctor

subtledoctor
  • Modders
  • 2854 posts
  • Gender:Male

Posted 17 October 2018 - 09:54 AM

Is "Spell1" being cast manually or by another spell/opcode?

Looks like it is actually cast by another spell.  The whole system runs via opcode 214 so I have to temporarily populate my wizard spellbook with wizard spells, and those wizard spells cast my psionic abilities, which are innate abilities.  I honestly don't remember why I didn't simply make the psionic abilities into wizard spells. (EDIT - oh right, because these are being cast by a thief and a wizard spell would not take caster level into account.)
 
The wizard spell - call it Spell0 - uses header target 4 "any point" and, looking more closely, it seems to be using a projectile, with the "c0" prefix...??  Wtf happened here?  Isn't that Artemius_1's modder prefix?  How did one of my abilities get patched to use his projectile??
 

effect 3 = opcode 148, cast spell at point, target = self,


That's not something I would have tried. I'll see how it works.  And stripping out the weird projectile from Spell0.


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#8 subtledoctor

subtledoctor
  • Modders
  • 2854 posts
  • Gender:Male

Posted 17 October 2018 - 01:01 PM

I think it finally works.  I removed the spurious projectile from the wizard spell, and more or less set it up as kjeron suggested, except moving everything out to the main wizard spell.  (The offensive subspell is still an innate so, maybe that will reflect my caster level?)

 

EDIT - except targets are taking double damage.  When I try on the two ogrillons south of beregost.  I suspect that the damage is getting repeated for each person hit by the projectile (sorry Imoen, you're about to be sacrificed to test this). 

 

Sigh.  I'm seriously deficient when it comes to understanding and modding projectiles...


Edited by subtledoctor, 17 October 2018 - 01:03 PM.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users