• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

HIVE

IcemanBo
ZiBitheWand3r3r
ZiBitheWand3r3r
Your code is beyond my capabilities :) good job, and thanks so much for adding me as author! I have nothing to do with programming in real life and simple vJass and libraries are those I understand and using, but structs emmbarassed me.
However, I see you added .onReviveFinish, so we dont need UnitAlive(.hero) in "callback" function?
Also in "callback" are ITE blocks proper? After first call .destroy() there is IssueTargetOrder(.building, "revive", .hero) so it's refering to .hero, .building, which can be null.
I notice that .owner is not nulled in destroy function?
Also we have to remember that Taverns with immediate revive hero will also fire EVENT_PLAYER_HERO_REVIVE_FINISH event, I dont know for now if it matters, but just in case :)
IcemanBo
IcemanBo
I think it's just the unused syntax that seems a bit confusing. Once you're used to struct like syntax, it's a hell lot easier to read/write than others.^^

Actually we don't need the alive check for hero, yo, but I just let it for safety, that maybe a treiggered revival would be detected, too. In scenearion that the player clicks the icon, and a trigger for what ever reason revives then the hero between this 0.1 seconds. But not very likeley I guess.

The first destroy() won't fire the event, it's just to destroy the instance, in case the building has died, or the hero became alive somehow.
And then the normal "revive" order check comes.

.owner doesn't necessarily need to be null, because a "player" can never be destroyed and recylced, which means it's like a static/global handle.

For Taverns, I'm not very sure about this, mind to test what you exactly meant by time? : )
Top