Upgrade with triggers

Jonny-Reaper

Active Member
Reaction score
0
I have a building like a town hall, its the main building. At the start of the game about 10 seconds in i want it to upgrade to a level 2 building, but i have many different upgrades set to the town hall already and i want it to pick one of them at random every game, can any one help? thanks :), oh yeah i only want it to do this if the player is filled by the Computer, thanks :)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
What kind of upgrades? Basic improvements to the level 2 building? Or multiple different buildings to upgrade to?
 

Kayoss666

Member
Reaction score
7
Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TownHallUpgrade[1] = Town HallL2.1
      • Set TownHallUpgrade[1] = Town HallL2.2
      • Set TownHallUpgrade[1] = Town HallL2.3
      • Set TownHallUpgrade[1] = Town HallL2.4
      • Set TownHallUpgrade[1] = Town HallL2.5
      • Set TownHallUpgrade[1] = Town HallL2.6
      • Set TownHallUpgrade[1] = Town HallL2.7
      • Set TownHallUpgrade[1] = Town HallL2.8
      • Set TownHallUpgrade[1] = Town HallL2.9
      • Set TownHallUpgrade[1] = Town HallL2.10
      • Set townhall[1] = Town Hall 0000 <gen>
      • Set townhall[2] = Town Hall 0001 <gen>
      • Set townhall[3] = Town Hall 0002 <gen>
      • Set townhall[4] = Town Hall 0003 <gen>
      • Set townhall[5] = Town Hall 0004 <gen>
      • Set townhall[6] = Town Hall 0005 <gen>
      • Set townhall[7] = Town Hall 0006 <gen>
      • Set townhall[8] = Town Hall 0007 <gen>
      • Set townhall[9] = Town Hall 0008 <gen>
      • Set townhall[10] = Town Hall 0009 <gen>
      • Set townhall[11] = Town Hall 0010 <gen>
      • Set townhall[12] = Town Hall 0011 <gen>
      • Set TownHallPosition[1] = (Position of Town Hall 0000 <gen>)
      • Set TownHallPosition[2] = (Position of Town Hall 0001 <gen>)
      • Set TownHallPosition[3] = (Position of Town Hall 0002 <gen>)
      • Set TownHallPosition[4] = (Position of Town Hall 0003 <gen>)
      • Set TownHallPosition[5] = (Position of Town Hall 0004 <gen>)
      • Set TownHallPosition[6] = (Position of Town Hall 0005 <gen>)
      • Set TownHallPosition[7] = (Position of Town Hall 0006 <gen>)
      • Set TownHallPosition[8] = (Position of Town Hall 0007 <gen>)
      • Set TownHallPosition[9] = (Position of Town Hall 0008 <gen>)
      • Set TownHallPosition[10] = (Position of Town Hall 0009 <gen>)
      • Set TownHallPosition[11] = (Position of Town Hall 0010 <gen>)
      • Set TownHallPosition[12] = (Position of Town Hall 0011 <gen>)

Trigger:
  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) controller) Equal to Computer)) and do (Actions)
        • Loop - Actions
          • Unit - Remove TownHall[(Player number of (Picked player))] from the game
          • Unit - Create 1 TownHallUpgrade[(Random integer number between 1 and 10)] for (Picked player) at TownHallPosition[(Player number of (Picked player))] facing Default building facing degrees


let me know if it worked
 

Jonny-Reaper

Active Member
Reaction score
0
that would work but it clashes with a previous trigger that is set to that building, deleting the building would disable the trigger. It can't be deleted it needs to be upgraded :)
 

Kayoss666

Member
Reaction score
7
i am not sure if that can be done but in my trigger the townhall is not destroyed it is removed but i would think it would be easier to rewrite the other trigger. you could pm me the other trigger or post it here and i will see if i can tweak it.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
There's an ability called Chaos in the Object Editor under Orc, which changes one unit-type into another.
Create one of these for every possible upgrade, and a bunch of dummy unit-types to act as requirements (each ability should have a different dummy-type requirement).
Add all these Chaos abilities to your unit in the Object Editor (they don't show up on the command card, so 10 shouldn't be a problem). Then do something like this:
Trigger:
  • Upgrade Building
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
      • ((Owner of YourUnit) controller) Equal to Computer
    • Actions
      • Set TempPoint = (Position of (YourUnit))
      • Unit - Create 1 DummyType [(Random number between 1 and 10)] for (Owner of YourUnit) at TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)

where YourUnit is your building and DummyType is a unit-type array that stores each of the dummy unit-types in a different array.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top