Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Replacing a units "upgrades to" unit

Discussion in 'World Editor Help Zone' started by sarumanthecursed, Jun 29, 2016.

  1. sarumanthecursed

    sarumanthecursed

    Joined:
    Jun 10, 2013
    Messages:
    472
    Resources:
    0
    Resources:
    0
    hey is there any way to trigger when an upgrade is researched that a units "upgrades to" unit is replaced with an other "upgrades to" unit for example:

    defend upgrade is finished being researched --> Scout towers "upgrades to" unit (which is the guard tower) is replaced with a "spirit tower".

    so now the "scout tower" can only upgrade to a "spirit tower" and no longer the "guard tower".
     
  2. Alright

    Alright

    Joined:
    May 20, 2014
    Messages:
    230
    Resources:
    0
    Resources:
    0
    Can't you base it on upgrade troll hunters to berserks upgrade?
     
  3. Emm-A-

    Emm-A-

    Joined:
    Jul 1, 2008
    Messages:
    1,312
    Resources:
    0
    Resources:
    0
    I would suggest making two scout towers in the object editor. One can only upgrade to the spirit tower and one to the guard tower.

    Upon the event "A unit finishes research" and the Condition "Researched tech-type == Defend", you pick all units owned by the owner of the triggering unit, that are of type scout tower (guard upgrade). Replace them with a scout tower (spirit) (action in generic unit actions).

    Please note, that replacing units means, that you have to re-asign any variables that this unit might have been stored to. Also, it could mess up ongoing things, you will have to try if this is suitable for you.
     
  4. pick-a-chew

    pick-a-chew

    Joined:
    Jul 15, 2007
    Messages:
    733
    Resources:
    4
    Icons:
    2
    Maps:
    2
    Resources:
    4
    Since it's a Research, when a player finishes a research, you can enable the production of Spirit Towers and disabled the production of Guard Towers via triggers.

    At map initialization you disable Spirit Towers for all players assuming all players start with no tech.

    If you want to upgrade all pre-existing Guard Towers to Spirit Towers you'll need to listen to Emm-A-.
     
  5. sarumanthecursed

    sarumanthecursed

    Joined:
    Jun 10, 2013
    Messages:
    472
    Resources:
    0
    Resources:
    0
    Thanks all I went with Emm-A-'s idea and it worked fine