• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Check upgrade

Status
Not open for further replies.
Level 19
Joined
Oct 7, 2014
Messages
2,208
I need help for a trigger.
I made an ability when the unit dies with be replaced by another unit but I need to check if the upgrade is finished because the ability must be research first before the ability to occur.

  • Shadow Ascend
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • Trigger - Turn on Shadow Ascend Execute <gen>
  • Shadow Ascend Execute
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Deciever
    • Actions
      • Set DyingUnit = (Dying unit)
      • Set DyingUnit_Position = (Position of DyingUnit)
      • Set DyingUnit_Owner = (Owner of DyingUnit)
      • Unit - Create 1 Shadow for DyingUnit_Owner at DyingUnit_Position facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DyingUnit_Position)
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
I think you need to make a boolean array for each player.
When a certain player finishes the upgrade, set the boolean with player number as index to TRUE.
Then put a condition inShadow Ascend Execute that if that boolean is true, run the code.

EDIT: something like this
shadowAscendUpgraded is false initially

  • Shadow Ascend
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • Set shadowAscendUpgraded[Player Number of Owner of Triggering Unit)] = true
  • Shadow Ascend Execute
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Deciever
      • shadowUpgraded[Player number of Owner of Triggering Unit)] Equal to True
    • Actions
      • Set DyingUnit = (Dying unit)
      • Set DyingUnit_Position = (Position of DyingUnit)
      • Set DyingUnit_Owner = (Owner of DyingUnit)
      • Unit - Create 1 Shadow for DyingUnit_Owner at DyingUnit_Position facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_DyingUnit_Position)
Sorry Im using my phone so it is a struggle to type
 
Status
Not open for further replies.
Top