• 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] Basic Triggers Needed

Status
Not open for further replies.
Level 4
Joined
Apr 17, 2008
Messages
84
I posted this in the 'Request' area and just recently noticed this forum. I am sorry if this counts as a double post I just wanted to have it in the right area. A moderator can remove my old topic from the request area if necessary.

Bontrager said:
I have never touched the triggering area of World Editor so I have been reading the tutorials trying to teach myself the basics. If someone can respond with the possible trigger for what is needed or some type of tip I will appreciate it greatly. I hope the following requests are not to complex.

Game Mechanics
Set the camera at a raised height. And some type of text command to reset it to this height

Basically if the building/circle of power is destroyed it will come under the control of the attacker.

Can be built on top of the control point and only the control point. A type of building.


Combat
All units will have mana. When away from the campfire the mana will slowly degrade. When mana reaches zero the unit's health points will slowly decrease until the unit dies or returns to the campfire.

Rejuvenates a units mana


Win Condition
Count down from 30 minutes. At the end of the timer the game will end.

Whoever controls this control point will win the game at the end of the timer.


Event
X amount of hostile units spawn at X location(s)

X amount of hostile units spawn at X location(s)

X amount of hostile units spawn at X location(s)


I will be trying to accomplish this in the mean time. Please if you only respond to one of the triggers I will be more then thankful!
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
As you said, these things are really basic!
Do you know, how to create a new trigger? What is an event, an action, a condition?
Do you know, why and how to create variables?
What is a Countdown-Timer?
If you already know these things, you can trigger many of your wishes above.

For the events for example, there is an event in the editor, which is called "Elapsed Game-Time".
Then you just have to add some actions in this trigger, f.e. spawn some units, found at "Unit - Create Unit" in the actions menu.

I guess you should start looking through the editor!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I'm not really in the mood of creating some of these things, although they're really easy, so I just create the ones I like...
At least this helps you out a little ;)


  • Camera
    • Events
      • Player - Player 1 (Red) types a chat message containing -CamZ as A substring
      • Player - Player 2 (Blue) types a chat message containing -CamZ as A substring
      • Player - Player 3 (Teal) types a chat message containing -CamZ as A substring
      • Player - Player 4 (Purple) types a chat message containing -CamZ as A substring
      • Player - Player 5 (Yellow) types a chat message containing -CamZ as A substring
      • Player - Player 6 (Orange) types a chat message containing -CamZ as A substring
      • ... (do this for all players)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 7, 10)) Equal to Empty String
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • Set Camera_Distance = (Real((Substring((Entered chat string), 7, 10))))
      • Camera - Set (Triggering player)'s camera Distance to target to Camera_Distance over 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Greater than or equal to 3000.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 3000.00 over 0.20 seconds
          • Set Camera_Distance = 3000.00
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed ou...
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Camera_Distance Less than or equal to 500.00
        • Then - Actions
          • Camera - Set (Triggering player)'s camera Distance to target to 500.00 over 0.20 seconds
          • Set Camera_Distance = 500.00
          • Game - Display to (All players matching ((Triggering player) Equal to (Matching player))) for 6.00 seconds the text: |c00ff0000Zoomed in...
        • Else - Actions
          • Do nothing
"CamZ" stands for "Camera Zoom", this lets the user zoom the camera at wish.
The minimum is 500, the maximum is 3000.
E.g.: "-CamZ 2600" will zoom the camera to a distance of 2600.



This is easy, just press Shift + Enter on the mana regen of the units, then you can enter a negative value, this will decrease the mana over time.

Then create a trigger like this:

  • Decrease HP
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to "Number of Players", do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of Hero[(Player number of (Player((Integer A))))]) Equal to 0.00
            • Then - Actions
              • Unit - Set life of Hero[(Player number of (Player((Integer A))))] to ((Life of (Triggering unit)) - 5.00)
            • Else - Actions
  • "Hero": Unit variable, array = number of players
  • At the start of the game, set the "hero" variable to the correct units



  • Control Points
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to Control Point
          • (Unit-type of (Dying unit)) Equal to Castle Control Point
    • Actions
      • Set TempLoc = (Position of (Dying unit))
      • Unit - Create 1 (Unit-type of (Dying unit)) for (Owner of (Killing unit)) at TempLoc facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to Castle Control Point
        • Then - Actions
          • Set OwningPlayer = (Owner of (Killing unit))
        • Else - Actions
  • OwningPlayer: Player variable, we will need it for later
  • TempLoc: Point variable, no array



In the init trigger (you hopefully have one), add these actions:
  • Actions
    • Countdown Timer - Start Timer as a One-shot timer that will expire in 1800.00 seconds
    • Countdown Timer - Create a timer window for Timer with title Game Ens in:
Then create another trigger like this:
  • Victory
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to "number of players", do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • OwningPlayer Equal to (Player((Integer A)))
            • Then - Actions
              • Game - Display to (All players) for 10.00 seconds the text: (Winner: + (Name of (Player((Integer A)))))
              • Wait 5.00 seconds
              • Game - Victory (Player((Integer A))) (Show dialogs, Show scores)
              • Set PlayerGroup = (All players)
              • Player Group - Remove (Player((Integer A))) from PlayerGroup
              • Player Group - Pick every player in PlayerGroup and do (Game - Defeat (Picked player) with the message: Defeat!)
              • Custom script: call DestroyForce(udg_PlayerGroup)
            • Else - Actions
  • OwningPlayer: Player variable, as explained in the previous trigger
  • PlayerGroup: Player Group (force) variable, no array
  • Timer: Timer variable, no array

I've made these triggers in a few minutes, if you need more info, or if anything doesn't work as expected, please say so.
 
Level 4
Joined
Apr 17, 2008
Messages
84
Thank you so much. These visual models are helping out so much. I just have no idea how to work with variables (which I assume is the X= icon in your screenshot)
 
Status
Not open for further replies.
Top