• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Hero Check

Status
Not open for further replies.
Level 9
Joined
Apr 4, 2004
Messages
519
Okay, I'm having a little bit of trouble with getting my map finished. I'm currently working on an AoS kind of map with a duel arena.

My problem is that sometimes the triggers put the "selection circle" which you can choose a hero with into the arena instead of the players hero.

How can I specify that it should check that if the player is playing and that the unit is a hero before it puts it there?

I currently got:

  • Events
    • Time - Timer expires
  • Conditions
  • Actions
    • Unit - Pause all units
    • Countdown Timer - Pause Timer
    • Game - Display to (All players) the text: Time for duel!
    • Unit - Move (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red)))) instantly to (Center of Fighter 1 <gen>)
    • Unit - Move (Random unit from (Units owned by (Random player from (All allies of Player 6 (Green)))) instantly to (Center of Fighter 2 <gen>)
    • Unit Group - Pick every unit in (Units in Duel Arena <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Set life of (Picked unit) to 100.00%
        • Unit - Set mana of (Picked unit) to 100.00%
    • Wait 2.00 seconds
    • Game - Display to (All players) the text: Duel starts in...
    • Wait 2.00 seconds
    • Game - Display to (All players) the text: 3
    • Wait 2.00 seconds
    • Game - Display to (All players) the text: 2
    • Wait 2.00 seconds
    • Game - Display to (All players) the text: 1
    • Wait 2.00 seconds
    • Game - Display to (All players) the text: Fight!
    • Trigger - Run Duel Time <gen> (ignoring conditions)
    • Unit Group - Pick every unit in (Units in Duel Arean <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Unpause (Picked unit)
*EDIT*

I am also having a problem with integers, seeing as I'm completely new to it and reading from a tutorial for the basic stuff. This is for making a -random mode for players.

  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Player - Set (Picked player) Current gold to 750
        • Player - Set (Picked player) Current lumber to 100
        • Camera - Pan camera for (Picked player) to (Position of Tavern 0000 ) over 0.00 seconds
        • Player - Set (Picked player) Food cap to 6
    • Set Total_Heroes = 8
    • Set Random_Count = 8
    • Set Hero_Array[1] = Alchemist
    • Set Hero_Array[2] = Naga Sea Witch
    • Set Hero_Array[3] = Tinker
    • Set Hero_Array[4] = Beastmaster
    • Set Hero_Array[5] = Dark Ranger
    • Set Hero_Array[6] = Firelord
    • Set Hero_Array[7] = Pandaren Brewmaster
    • Set Hero_Array[8] = Pit Lord
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • Set Random_Data[(Integer A)] = (Integer A)
This is what I'm doing, but how do I know what type of Variabel I need for those seperate heroes? Is it a string, integer, unit-type?

Thankful for answers.

~Archideas
 
Last edited:
1. one way to do it will be picking all allied heros like this

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units owned by (Random player from (All allies of Player 1 (Red))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Move (Random unit from (Last created unit group)) instantly to (Center of (Playable map area))

[Notice] If you don't know whats that Custom Script, pay a visit to the "Things That Leak" sticky thread.


A second way would be using your heros variable which leads me to the second question.

2. Since a String is a one or more characters, does it have anything to do with units ?
Since a Integer is a variable of full numbers (Ex. 1 , 4968, -39573) does it have anything to do with units ?

So, of course your variable would be Unit Type, and a hint of that would be by setting them to those unit names.
Alchemist for example isn't a number right ? and it isn't a string too right ? its a name of a unit in warcraft, and terefor would be a Unit Type variable.
 
I got the Variable thing solved. Thanks anyway. :D

But the first part is still a problem. Now it doesn't move the Selection Circles used to pick a hero at the start, but it doesn't move any hero either, except for one of the teams, meaning that there's only one hero in the arena without an opponent.
 
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units owned by (Random player from (All allies of Player 1 (Red))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Move (Random unit from (Last created unit group)) instantly to (Center of (Duel_Region_One))
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units owned by (Random player from (All allies of Player 6 (Orange))) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Move (Random unit from (Last created unit group)) instantly to (Center of (Duel_Region_Two))
 
Status
Not open for further replies.
Back
Top