• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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