Jump to content

Issues with 'any point within range'-spells and projectiles


Shin

Recommended Posts

I'm noticing that spells and projectiles with 'any point within range (4)' as target can lead to some quirky behaviour. Essentially I have an item working a bit like a grenade, that is able to be thrown anywhere on the ground, displaying a travel projectile, displaying a central fire animation similar to a melf meteor on the point where it lands, and then spreading a gas cloud around it.

The problems arise seemingly as a combination of targeting: if I use opcode 215 to display an effect at the target point and designate the target within that opcode as 'self (1)', the animation will display before the travel projectile reaches the target point. If I use 'preset target (2)' as target the animation displays correctly once the travel projectile gets there, but only if there are eligible targets within range. If no targets are nearby, the animation again won't display. These issues are of course solved if I make it so the item has to be targeted on a specific actor rather than being cast anywhere on the ground, but that's also not optimal. Any obvious solutions for this? I feel a bit like there's a specific combination of targeting and projectile use that would solve the issue and make the item castable anywhere and still display all its effects only after the initial travel projectile hits.

Another seeming quirk with 'target anywhere' items that cast spells seems to be that if you target them out of range, rather than the PC moving into range to cast them, the item will simply deplete or use up a charge without anything happening.

Link to comment
1 hour ago, lynx said:

You always want the boom to display, so why not set that up in the projectile? You can have the secondary/aoe then apply the spell.

I've tried that too, but the issue is that I want the boom to be aoe damage (applied once), so it has to be an aoe projectile, but I don't want the graphical effect to display on top of every target the way aoe projectiles tend to do. Any other way to bake an animation into an aoe projectile file, but have it only display at the target point, regardless of whether there are targets in range or not? I then apply the gas cloud with a secondary aoe spell.

Edit: after more testing it all seems to come down to irregularities in opcode 148, that is used to deliver the spell effects: if this opcode is targeted to none(0) or preset target(2), the spells will fire correctly, but only as long as there are actual targets within range, but the timing will be correct as they fire only after the initial projectile arrives. If targeted to self (1), the spells will fire correctly everywhere (even without targets in range), but here the timing will be off as they will always fire instantly at the target location rather than after the travel projectile arrives.

So. Is there a way to make all of the effects always play at the target location, regardless of whether any actual targets are there, and only after the initial travel projectile hits?

Edited by Shin
Link to comment

The visual effect targeting quirk is inherent to opcode 215, it's not about "Any point." For your application add a secondary Cast spell at point effect to the item, target Self, as usual. This spell needs to have a custom AOE-type projectile, make it something very large just in case, Explosion area 3000 or so, "Ignore LOS." In the effects of the spell put your 215, target "Original caster."

Link to comment
41 minutes ago, Shin said:

I want the boom to be aoe damage (applied once), so it has to be an aoe projectile, but I don't want the graphical effect to display on top of every target

I feel like I had this problem in my psionics mod, and solved it. But I don’t remember the details. It was with my recreation of the Earthquake spell, and possibly also the Produce Flame ability. They need to do a lot: cast a subspell on the caster (once), then deliver a projectile that affects every enemy within range (once), and display the projectile’s animation (once). I recall that being difficult to set up with an AoE spell.

You can install the mod and take a look at the finished product if you like. If I have time I can try to take a look and remember more details. 

EDIT - or maybe it’s just a weird opcode 215 thing. I don’t know if my spells use 215, so maybe this is inapposite anyway. 

Edited by subtledoctor
Link to comment
4 hours ago, temnix said:

The visual effect targeting quirk is inherent to opcode 215, it's not about "Any point." For your application add a secondary Cast spell at point effect to the item, target Self, as usual. This spell needs to have a custom AOE-type projectile, make it something very large just in case, Explosion area 3000 or so, "Ignore LOS." In the effects of the spell put your 215, target "Original caster."

That seems to have done the trick for the animation, thanks.

 

Edit: for posterity, I've seemingly gotten it all into place with some convoluted workarounds. In the end I put the graphical effect into a separate cast from the ITM as per temnix's advice; the gas cloud graphical effect into the original projectile that I turned into an aoe; the ticking/repeating gas cloud spell effects into a secondary spell cast by opcode 146 at preset target(2), and the one-time explosion damage into a tertiary spell cast by opcode 146, also at preset target. This tertiary spell also contains a short-term opcode 206 immunity to itself so its damage won't apply every time the motherspell ticks.

The net result is that the graphical parts (explosion and gas cloud) now always display no matter if targets are present or not, whereas the (non-graphical) damage and gas effects will only be applied (or rather be cast at all) if there are nearby targets, which of course is fine.

I also can't quite believe the effort that ended up going into something that seemed so simple when I first came up with it. Grenade-like items that are targeted on creatures rather than on the ground seem a whole lot easier to work with.

Edited by Shin
Link to comment

Don't be so surprised, Shin. This is the order of business for these things: if you want to make a complicated spell or item, you may need this many effects and projectiles or more. But you could probably tuck in some stuff better if you tried. It's not usually worth the trouble, though, to reduce the number of subspells to an absolute minimum. It's not like there is a prize for elegance, only for results.

Link to comment
29 minutes ago, temnix said:

Don't be so surprised, Shin. This is the order of business for these things: if you want to make a complicated spell or item, you may need this many effects and projectiles or more. But you could probably tuck in some stuff better if you tried. It's not usually worth the trouble, though, to reduce the number of subspells to an absolute minimum. It's not like there is a prize for elegance, only for results.

Yeah, I don't doubt that at all. The thing was more that this didn't seem like it would be complicated -- just a little more so than e.g. a potion of explosions, when I first thought about it.

Link to comment

Had you gone about this the way you are supposed to, you would have made a simple AOE with your explosion in the center, no blending effects or drawing control, and been content. But you wanted more than basic-level effects, so pay the toll to cross the bridge. There is going to be much more of this if you intend to make complicated effects or spells that do more than "save or take 1d6 damage."

You could make a permanent explosion, for example, with a zero-speed missile. Like this: Any point, in the effects put 72 (change AI type), pick an impossible combination, like a switch to NIETHER gender and WOLF race, target Self. This only needs to be one for a few ticks. In the same list add Cast spell at point, Self, a huge custom projectile as in my last tip, but on the first page of the projectile set the flags "IWD style check," "Neg. IDS1" and "Neg. IDS2." In the menus below pull the combination you chose. This will be the only variety of target explosion projectiles, the ones that deliver the payload for the AOE, will be emitted for. Now go to the AOE page and in "Explosion projectile" choose something other than "None," something with a file, like MAGMIS. It needs to be a single-target projectile. Edit this one: give it speed 0 and some considerable projectile width (try 100 for size), set "Face target" and "Pass target" as well. You can pick a different BAM for the projectile in those properties, too. The one that's the most fun will be the lightning bolt, because it has a direction. Now save everything and cast your spell at some point away, and walk about like Satan. Fun, right? This will expire when the party leaves the area or reload the game. Tick "Allow saving" in all of the projectiles to enable saving in the first place.

And if you want something permanent for your effects, you may have to resort to summoning invisible minions at the target point, carrying While equipped items and scripted to do what you want. This is how beauty begins in these games. But you should have a concept to go with all this, a name, a story. Ramalaksha's Lightning Hound, Paprika Gas, Caltrops (here you would just give the item ability more than one target to toss out bunches of them.) Something fun!

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...