Thrown object impact DSA?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Thrown object impact DSA?

Post by Toni Y »

Is there some way to get a DSA to fire when an object you've thrown hits something? I tried looking at the filter documentation but couldn't find a suitable one.

Specifically I'd like to implement a new type of bomb potion.

I can see one way of implementing that, but it's so much work for both me and the DSA that I'm hoping there would be an easy way that I've just overlooked :P (when the cursor filter says that you've thrown the bomb, start scanning each tick the horizontal/vertical line for signs of the bomb appearing on a tile or in monster's possession... Please tell me there is that easier way I'm hoping for...)
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

This filter is missing. I thought several times about asking Paul, but cowardly kept quiet because of the whole new world of possibilities it would open.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

It is rather complex. Lots of ways
to add a bug to the code if we
attempt anything complicated.

There is a very particular place
in the code where it is determined
that a Missile has contacted a
Monster. I could certainly call
a filter DSA when this occurs.
The filter would be allowed to
abort any further processing.
If the operation were aborted then
it would be as if the missile passed
through the monster (like a dagger
through a Non-material monster).

The DSA would have to determine
if the missile (and the object contained
within the missile) are somehow special.
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Post by Toni Y »

Would that fire also with walls, doors and whatever else a thrown thing can hit? If so, I'd love to have it. If not, it does only half of what I need :/
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

ConstructTorch.zip has an example of
a 'Missile Encounter Filter'. Throw some
Ashes at the monster, then a Stick. The
DSA subpresses damage except by a Stick.

If this is useful, we can begin to extend it
to other missile encounters with walls, doors,
and the party.
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Post by Toni Y »

I've had a play with it now, and it seems to fit the bill exactly (well, after it's been extended to all encounters, right now my bomb explodes only on impact with the monsters, but that part is working very nicely already :))
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

after it's been extended to all encounters
If you provide a little test dungeon
with a playfile and tell me what
should work, but which does
not work, I can use it to find the
places in the code to add more filter
access. Hopefully we can add the
necessary hooks one-at-a -time in
this manner.
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Post by Toni Y »

http://viila.lethalcode.net/~tylisirn/d ... Filter.rar

Here's a simplified version and the playfile.

Basically, what happens at the screamer is what should happen in all test cases marked so.

Of course, I'm not averse to having a trigger even in the cases where the ful bomb is non-interactive. (ie, flying through an illusionary wall, or flying through the holes in the door.) That would open even more possibilities. (Bottled Zo-spell? :P) However, this is a minimal set that would be very useful.
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

10_071
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Post by Toni Y »

Absolutely stellar! Thank you very much :)
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

No problem, you Old-School designer, you.

DSA? Bah! Humbug!

:wink:
User avatar
Toni Y
Adept
Posts: 221
Joined: Sat Feb 07, 2004 8:54 am
Location: Finland

Post by Toni Y »

Paul Stevens wrote:Lots of ways
to add a bug to the code if we
attempt anything complicated.
It appears that we've managed to do just that.

I was testing in a dungeon without any DSAs for damages done by thrown and shot objects, and it seems we've rendered monsters invulnerable to projectiles... :P

Both Screamers and Mummies suffered no damage from arrows from any sort of bow, rocks, daggers or throwing stars with 10.071. Using an older exe (10.006), they lost HPs as expected.
Toni Ylisirniö
Author of Grave of King Millias, Return of Chaos, and DM2 dungeons.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

TY wrote:we've rendered monsters invulnerable to projectiles
Don't you just HATE it when that happens?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I appear to have out-clevered myself.

10_072 seems better.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”