Dungeons can cast spells at the player, like some mausoleum entrances.
While a flash can be seen and a zap can be heard (the shock missile is harder to see, but it can be observed in the editor), I don't remember having my health damaged by one such trap.
I'm not entirely sure why; I suspect that sometimes the player capsule is not on the trajectory of the missile, or already collides with the spawned missile, but even when the colliders are correctly aligned, they get thru one another.
I suspect the issue is that such "environmental" missiles use the player as the caster, so the player is excluded from collisions, but I've yet to verify this hypothesis (what caster can be used?)
PS I just proved the hypothesis by removing the two lines that exclude collisions with the player if (s)he is the caster. Still don't know what caster to use however.
Zap traps not damaging player
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Zap traps not damaging player
- Attachments
-
- SAVE563.zip
- (225.11 KiB) Downloaded 127 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Zap traps not damaging player
I assume the goal was to cast environment spells of the same "level" as the player; However using the player as the caster here is incorrect in several ways (beside above problem, I assume the player could get damage say from his own spell reflection).
I was thinking about a fix that would involve create a "clone" of the player, delegating its properties to the player object but discarding all mutations (like a read only clone of the player); That way it's a different object from the player, and it prevents spell reflection bug.
I'm not sure how many properties of DaggerfallEntityBehavior and DaggerfallEntity need to be delegated though. It may also feel like an overengineered solution...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Zap traps not damaging player
Most of the effect system was engineered to work without a caster. I've not done that for the missile class, which seems to be a mistake on my part.
Only a small number of changes are required to support caster-less missiles, and it doesn't really affect anything more than spell being cast at magnitude of level 1. Oh, and area around caster can't work, but trap spells don't use those in any case.
I'll push some changes now for you to review.
Only a small number of changes are required to support caster-less missiles, and it doesn't really affect anything more than spell being cast at magnitude of level 1. Oh, and area around caster can't work, but trap spells don't use those in any case.
I'll push some changes now for you to review.
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Zap traps not damaging player
Checks like if (!caster) return in Update() convinced me that a caster was needed, but seems not (with the few adjustments you made).
Anyway, zap trap seems to work as it should now, I'm happy
Anyway, zap trap seems to work as it should now, I'm happy
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- King of Worms
- Posts: 4753
- Joined: Mon Oct 17, 2016 11:18 pm
- Location: Scourg Barrow (CZ)
- Contact:
Re: Zap traps not damaging player
Nice job finding this bug and dealing with it, Ive never noticed it
DREAM Nexus https://www.nexusmods.com/users/73250038?tab=user+files
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
DREAM Forums viewtopic.php?f=27&t=1168
DISCORD: king_of_worms_cz
- Baler
- Posts: 225
- Joined: Thu May 23, 2019 1:39 am
- Location: Earth
Re: Zap traps not damaging player
Awww I've been exploiting this bug for a long time to farm certain crypts/dungeons
well I guess it's better that it get's fixed..
well I guess it's better that it get's fixed..
Hidden Gem Mods - Enhanced Sky - Forgotten Quest Pack
- pango
- Posts: 3359
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Zap traps not damaging player
Well, it's not impossible to avoid getting zapped, it's just its own minigame
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart