• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Build X Buildings = Victory

Status
Not open for further replies.
Level 1
Joined
Jul 7, 2010
Messages
1
Hi I just registered. I wont to make a map where you build a certain amount of buildings like etc 4 farms and 1 barracks. This is what i have so far hopefully some of its right-

Events
Unit - A unit owned by player 1 (Red) Finishes construction
Conditions
(Unit-type of (Triggering unit)) Equal to Orc Burrow
Actions
Set Integer = 1
if (Integer Equal to 4)then do (Game - Victory Player 1 (Red) )Show dialogs. Show scores)) else (Do nothing)
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

First of all: Welcome to hive - hope you will have a good time here!

So let's get into it: First of all create an -integer- variable, with array! ( I named it VictoryAmount in this example )

Now first of all you create this trigger:
  • TestTrig541
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to <YOUR BUILDING>
    • Actions
      • Set VictoryAmount[(Player number of (Owner of (Triggering unit)))] = (VictoryAmount[(Player number of (Owner of (Triggering unit)))] + 1)

1) Create a new triggeraction. Use the action: Set Variable, and pick your variable and click ok.

2) Now you see after the variable [Index]. Click on it and in the new window you search in the function list for "Player - Player Number" and select this.

3) Now you see there (Triggering Player). Click on it and in the new window you search in the function list for: "Owner of Unit"

4) Now press twice ok and the first part is finished. Now we we after the = the Value and click on it.

5) In the new windows you select in the function list: "Arithmetic" and again there's Value and click this. Now select your variable in the new window and do the same points ( 1 - 4 ) again

6) Done


Ok after you have everything in the "Set Variable" part you add the following action to your trigger [AFTER the Set Variable part]
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • VictoryAmount[(Player number of (Owner of (Triggering unit)))] Equal to 4
    • Then - Actions
      • Game - Victory (Owner of (Triggering unit)) (Show dialogs, Show scores)
    • Else - Actions
So at the end we have this:
  • TestTrig541
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to <YOUR BUILDING>
    • Actions
      • Set VictoryAmount[(Player number of (Owner of (Triggering unit)))] = (VictoryAmount[(Player number of (Owner of (Triggering unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • VictoryAmount[(Player number of (Owner of (Triggering unit)))] Equal to 4
        • Then - Actions
          • Game - Victory (Owner of (Triggering unit)) (Show dialogs, Show scores)
        • Else - Actions
Edit: I'm still surprised that no one helped you with that over 5 days -_-

Greetings
~ The Bomb King > Dr. Boom
 
Last edited:
Status
Not open for further replies.
Top