Difference between revisions of "Distinguishing Between Physical and Magickal Hits"
Distinguishing Between Physical and Magickal Hits (edit)
Revision as of 23:34, 15 April 2006
, 23:34, 15 April 2006no edit summary
imported>Diablerie (Potential solution) |
imported>Diablerie |
||
Line 30: | Line 30: | ||
</pre> | </pre> | ||
From what I saw, if the actor is hit by a spell, it will trigger both [[OnMagicEffectHit]] and [[OnHit]]. I'm not sure if the block ordering in the script makes any difference, but in my experiments, the ''OnHit'' block always saw the ''bMagicEffect'' variable set in the ''OnMagicEffectHit'' block. Hopefully, the ''GameMode'' block won't cause a performance hit. -- [[User:Diablerie|Diablerie]] 22:11, 15 April 2006 (EDT) | From what I saw, if the actor is hit by a spell, it will trigger both [[OnMagicEffectHit]] and [[OnHit]]. I'm not sure if the block ordering in the script makes any difference, but in my experiments, the ''OnHit'' block always saw the ''bMagicEffect'' variable set in the ''OnMagicEffectHit'' block. Hopefully, the ''GameMode'' block won't cause a performance hit. | ||
-- [[User:Diablerie|Diablerie]] 22:11, 15 April 2006 (EDT) | |||
I think I've found a more elegant solution: | |||
<pre> | |||
scriptname WeaponHitScript | |||
begin OnMagicEffectHit | |||
return | |||
end | |||
begin OnHit Player | |||
<do stuff...> | |||
end | |||
</pre> | |||
It looks like the [[Return]] command terminates the entire ''script'', and not just the block that it's called from. This can be used to have one trigger override another. | |||
-- [[User:Diablerie|Diablerie]] 23:34, 15 April 2006 (EDT) | |||
[[Category:Questions]] | [[Category:Questions]] |