• 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.

[Trigger] About Axis and Building

Status
Not open for further replies.
Level 3
Joined
May 24, 2008
Messages
27
Hey guys, I Need to post a question about an idea i had. I sit here Stumbling on using triggers for my question, how to make a formula for a Cubical area on the Axis of my map. i havent searched this bc of the way i ask it so here it is...

I want to make a trigger for the creation of building

i want a square of towers[This meaning that you build towers so that there is and equal amount of space between them, each being place as four corners]

Then i would like all the towers[ built, forming the square ] to become 1 building as a whole[ in the very center of the square ] ...

The new building therefore will replace the four towers built

Please help, Thankyou
 
Level 9
Joined
May 27, 2006
Messages
498
You would just have to store to point, where the building (from the tab) is being built, then remove it, create 4 towers using polar projection to define their position based on the location where the main building was placed, set their construction progress to 1%, order the builder to right-click on one of towers, and somehow keep the rest building too... Altough i have no idea how to do this certain part right now. Then, after the buildings are constructed, remove the towers and create the building you wanted to build at the location you stored at the beggining.

...Yeah, "just", duh...
 
Level 3
Joined
May 24, 2008
Messages
27
Hey

You would just have to store to point, where the building (from the tab) is being built, then remove it, create 4 towers using polar projection to define their position based on the location where the main building was placed, set their construction progress to 1%, order the builder to right-click on one of towers, and somehow keep the rest building too... Altough i have no idea how to do this certain part right now. Then, after the buildings are constructed, remove the towers and create the building you wanted to build at the location you stored at the beggining.

...Yeah, "just", duh...


I dont understand this at all, i would appreciate if you set up a trigger for me as example. BTW the 4 towers are built by the builders and then become one new structure.

I dont know how to store points and my question is not solved yet
 
Level 9
Joined
May 27, 2006
Messages
498
Well, you see, i wanted you to think how to make trigger on your own, to let you at least learn something from it... But, oh well.

You see, you can store point using variables. Variables are something like sheets of paper, on which you can write any information. In that case our information would be a point. So you have to go to the variable editor (ctrl+b) and create a new point-type variable.

Im not going to write you entire step-by-step tutorial on how to do the trigger. Instead, look:
  • Blah
    • Events
      • Unit - A unit begins construction
    • Conditions
      • Unit type of (Constructed unit) Equal to YourFinalBuilding
    • Actions
      • Set TempPoint = (Position of(Constructed unit))
      • Unit - Remove (Constructed unit) from the game
      • For each (Integer A) from 1 to 4 do (Actions)
        • Set TempPoint2 = (TempPoint polar offset by 100 towards (90 x (Integer A)) degrees
        • Unit - Create 1 Tower for (Player(Owner of(Triggering unit))) at TempPoint2 facing blah
        • Set Tower[(Integer A)] = (Last Created unit)
        • Unit - Set (Last Created unit) construction progress to 1%
        • Unit - Create 1 DummyBuilder for (Player(Owner of(Triggering unit))) at TempPont2 fafcing blah
        • Set DummyBuilder[(Integer A)] = (Last Created unit)
        • Unit - Order (Last Created unit) to R-click Tower[(Integer A)]
        • Custom script: call RemoveLocation(udg_TempPoint2)
      • Wait X seconds // the time your builders need to finish building the towers.
      • For each (Integer A) from 1 to 4 do (Actions)
        • Unit - Remove Tower[(Integer A)] from the game
        • Unit - Remove DummyBuilder[(Integer A)] from the game
        • Unit - Create 1 YourFinalBuilding for (Player(Owner of(Triggering unti))) at TempPoint facing blah
      • Custom script: call RemoveLocation(udg_TempPoint)
(this trigger contains two arrayed unit-type variables)

This is merely a raw idea on how to do this trigger, hope you can learn enough to complete it on your own?
And btw, its not MUI, meaning only one player can build the building at one time and keep everything working.
 
Status
Not open for further replies.
Top