Check upgrade

Status
Not open for further replies.
Level 19
Joined
Oct 7, 2014
Messages
2,209
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