HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Researchable upgrades on computer ally player?

04-06-2004, 09:18 PM#1
eva01
Is there an easier way to have access to a research upgrade building on a computer control ally? I wrote 4 triggers to do it. Trigger one just changes the ownership of that building when you enter a region that is underneath it. Trigger 2 changes owndership back to the computer(Player 1) when they leave.

I was just wondering if there is an easier way without 4 triggers or with less than 4 triggers because this method is 4 triggers just for 1 upgrade and I have 3 of those research buildings on my map. I just want control of that building for the ally player control heroes to upgrade armor,spells,damage etc...

Here are the triggers that I wrote.

Trigger 1
Code:
Research 001
    Events
        Unit - A unit enters HuntersHall W <gen>
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 2 (Blue))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 3 (Teal))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 4 (Purple))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 5 (Yellow))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 6 (Orange))
    Actions
        Unit - Change ownership of Hunter's Hall 0187 <gen> to (Owner of (Triggering unit)) and Retain color

Trigger 2
Code:
Research 001b
    Events
        Unit - A unit leaves HuntersHall W <gen>
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 2 (Blue))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 3 (Teal))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 4 (Purple))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 5 (Yellow))
                (((Triggering unit) is A Hero) Equal to True) and ((Owner of (Triggering unit)) Equal to Player 6 (Orange))
    Actions
        Unit - Change ownership of Hunter's Hall 0187 <gen> to Player 1 (Red) and Retain color

Trigger 3
Code:
Research 001c
    Events
        Unit - A unit Begins research
    Conditions
        (Researched tech-type) Equal to Moon Armor
    Actions
        Trigger - Turn off Research 001 <gen>
        Trigger - Turn off Research 001b <gen>
        Unit - Change ownership of Hunter's Hall 0187 <gen> to Player 1 (Red) and Retain color
        Player - Add 150 to Player 1 (Red) Current gold
        Unit - Order Hunter's Hall 0187 <gen> to research Moon Armor

Trigger 4
Code:
Research 001d
    Events
        Unit - A unit owned by Player 1 (Red) Finishes research
    Conditions
        (Researched tech-type) Equal to Moon Armor
    Actions
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Player - Set the current research level of Moon Armor to (Current research level of Moon Armor for Player 1 (Red)) for (Player((Integer A)))
        Trigger - Turn on Research 001 <gen>
        Trigger - Turn on Research 001b <gen>
04-06-2004, 10:39 PM#2
BattleBotv8.2
Maybe make a building sell units with the upgrade info. If a unit trains a unit, and it equals to XDummyUnit, then remove unit from the game, order XUpgradeCenter to start work on XUpgrade.
04-07-2004, 12:35 AM#3
eva01
Quote:
Originally Posted by BattleBotv8.2
Maybe make a building sell units with the upgrade info. If a unit trains a unit, and it equals to XDummyUnit, then remove unit from the game, order XUpgradeCenter to start work on XUpgrade.

Thank you for the help BattleBotv8.2 I got it to do what you suggested however i'm having some difficulties with an upgrade higher than level 1. I'm trying to get the building to stop selling units if the current research level is at 3.