• 🏆 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!

[Trigger] Check for researching/upgrading?

Status
Not open for further replies.
Level 8
Joined
Sep 13, 2006
Messages
431
That would be wonderful, if you have the time. Please and thank you...

I suppose I could just use custom values for the unit in addition to the (begins/finishes researching), but I am hoping there is a cleaner way of doing it.
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Here it is, it uses HandleVars, so make sure you have them in your map's custom sript section. It also uses two global variables:
TempUnit unit
IsResearching boolean

  • ResearchEvent
    • Events
      • Unit - A unit Begins research
      • Unit - A unit Cancels research
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • Custom script: call SetHandleBoolean(GetTriggerUnit(), "Research", GetTriggerEventId() == EVENT_PLAYER_UNIT_RESEARCH_START)
  • ResearchCheck
    • Events
      • ...
    • Conditions
    • Actions
      • Set TempUnit = <The unit you want to check>
      • Custom script: set udg_IsResearching = GetHandleBoolean(udg_TempUnit, "Research")
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsResearching Equal to True
        • Then - Actions
          • -------- TempUnit is researching --------
        • Else - Actions
 
Status
Not open for further replies.
Top