Quantcast
Channel: The Battle for Wesnoth Forums
Viewing all articles
Browse latest Browse all 578

WML Workshop • Re: v1.18 have_unit and die event

$
0
0
A "die" event is triggered automatically by the engine when a unit has 0 hitpoints. Raising the unit's hitpoints during that event causes it to not finish doing its work. (That was a choice by developers obviously, but it makes sense.) On the other hand, [kill] is fired manually by the coder who wants a unit not to be there any more. Raising the unit's hitpoints in the "die" event works as expected, but then control is passed back to [kill], and the unit is removed as the coder requested. It doesn't make much sense to me that you could prevent [kill] from finishing just by raising the unit's hitpoints. That would actually be less consistent in my opinion. If you need it, you could request a key inside [kill] that prevents it from terminating, but that would be a separate feature.

Statistics: Posted by beetlenaut — Yesterday, 7:22 pm



Viewing all articles
Browse latest Browse all 578

Trending Articles