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

Help whit triggers...

Status
Not open for further replies.
Level 5
Joined
Oct 9, 2008
Messages
134
Hi, i wanna add a hero seleccion to my map, but i have a problem...

i have a trigger saying this:

  • other stuff
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Pause Uber Immortal (Giant) 0519 <gen>
      • Game - Turn the day/night cycle Off
      • Player Group - Make (All players controlled by a User player) treat (All players controlled by a User player) as an Ally with shared vision
      • Game - Set the time of day to 16.00
      • Set Hero[1] = King Leonidas 0015 <gen>
      • Set Hero[2] = Spartan Crosbowmen 0274 <gen>
      • Set Hero[3] = Spartan Crosbowmen 0272 <gen>
      • Set Hero[4] = Spartan Captain 0332 <gen>
      • Set Hero[5] = Spartan Captain 0324 <gen>
      • Set Hero[6] = Spartan Captain 0331 <gen>
      • Set Hero[7] = Spartan Captain 0325 <gen>
      • Set Hero[8] = Spartan Captain 0330 <gen>
      • Set Hero[9] = Spartan Captain 0326 <gen>
      • Set Hero[10] = Spartan Captain 0329 <gen>

if i delete it , something pass in the map??


and, i can build a seleccion tavern, and puting something like that?
 
Last edited:
Level 12
Joined
Aug 22, 2008
Messages
911
You need a region array (or a unit array in case you want circles of power). Regions are mostly preferred. Anyway the numbers are in a matching order so Hero[1] will be in front of Region[1].
  • Events
    • Time - Every 0.20 seconds of game time
  • Conditions
  • Actions
    • For each (Integer A) between 0 and (Length of Array) do (Actions)
      • Loop - Actions
        • -------- Now it depends whether you want to refer to units or regions. --------
        • -------- The way with regions is: --------
        • Unit Group - Pick every unit in (Units in Array[Integer A] matching ((Unit-type of (Matching Unit)) equal to Hero Picker)) and do (Actions)
        • -------- However, the way with units is: --------
        • Unit Group - Pick every unit in (Units within 100.00 range of Array[Integer A] matching ((Unit-type of (Matching unit)) equal to Hero Picker))...
        • -------- Anyway, we now get to the actions: --------
          • Loop - Actions
            • Unit - Create 1 (Unit-type of Hero[Integer A])for (Owner of (Picked Unit)) at WHATEVER facing WHATEVER
            • Unit - Remove (Picked Unit) from the game
I hope it's not too complex for you and that you get the idea.
What?

PLEASE TALK RIGHT
That's not very nice.
 
Level 5
Joined
Oct 9, 2008
Messages
134
You need a region array (or a unit array in case you want circles of power). Regions are mostly preferred. Anyway the numbers are in a matching order so Hero[1] will be in front of Region[1].
  • Events
    • Time - Every 0.20 seconds of game time
  • Conditions
  • Actions
    • For each (Integer A) between 0 and (Length of Array) do (Actions)
      • Loop - Actions
        • -------- Now it depends whether you want to refer to units or regions. --------
        • -------- The way with regions is: --------
        • Unit Group - Pick every unit in (Units in Array[Integer A] matching ((Unit-type of (Matching Unit)) equal to Hero Picker)) and do (Actions)
        • -------- However, the way with units is: --------
        • Unit Group - Pick every unit in (Units within 100.00 range of Array[Integer A] matching ((Unit-type of (Matching unit)) equal to Hero Picker))...
        • -------- Anyway, we now get to the actions: --------
          • Loop - Actions
            • Unit - Create 1 (Unit-type of Hero[Integer A])for (Owner of (Picked Unit)) at WHATEVER facing WHATEVER
            • Unit - Remove (Picked Unit) from the game
I hope it's not too complex for you and that you get the idea.

That's not very nice.



thks, i have a little idea, but have 2 questions


1) i have only 3 types of heros in the game, and 10 players to choose hero, so i cant remove the picked units, i need a trigger who say " no more than 1 hero per player " ¿no?

2) the idea is to use a tavern, 1 for each player , whit each 3 heros, when you pick the hero, the tavern will stay here to revive it when he dead...


do you have the idea who i say? plz i wait your answer, thanks
 
Level 5
Joined
Oct 9, 2008
Messages
134
Well little problem here,
the heros summon, okay, but

1) they dont teleport when spawn to their respectibe palces

2) they dont have the items they need to have.

3) you can have more than 3 of them.

here are the triggers:

  • Hero selection
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
  • Hero moves
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Summoning unit)) Equal to Hero chooser
    • Actions
      • Unit - Move (Sold unit) instantly to (Center of Hero Spawns <gen>)
      • Hero - Create Ancestral Staff and give it to (Sold unit)
      • Hero - Create Potion of Greater Healing and give it to (Sold unit)
      • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero Spawns <gen>) over 0.20 seconds
  • Hero dead
    • Events
      • Unit - King Leonidas 0015 <gen> Dies
    • Conditions
    • Actions
      • Camera - Pan camera for Player 1 (Red) to (Center of Hero choosers <gen>) over 0.20 seconds
 
Level 5
Joined
Oct 9, 2008
Messages
134
Well little problem here,
the heros summon, okay, but

1) they dont teleport when spawn to their respectibe palces

2) they dont have the items they need to have.

3) you can have more than 3 of them.

here are the triggers:

  • Hero selection
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
  • Hero moves
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Summoning unit)) Equal to Hero chooser
    • Actions
      • Unit - Move (Sold unit) instantly to (Center of Hero Spawns <gen>)
      • Hero - Create Ancestral Staff and give it to (Sold unit)
      • Hero - Create Potion of Greater Healing and give it to (Sold unit)
      • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero Spawns <gen>) over 0.20 seconds
  • Hero dead
    • Events
      • Unit - King Leonidas 0015 <gen> Dies
    • Conditions
    • Actions
      • Camera - Pan camera for Player 1 (Red) to (Center of Hero choosers <gen>) over 0.20 seconds
 
Level 12
Joined
Aug 22, 2008
Messages
911
Firstly, USE THAT EDIT BUTTON!!!!!!!! o_O

Several corrections:
  • (Unit-type of (Selling Unit)) equal to Tavern
Also: Hero dead has a correction... King Leonidas 0015 <gen> refers only to a pre-placed unit, so you'll have to change that. More like:
  • Hero dead
    • Events
      • Unit - A unit dies
    • Conditions
      • (Unit-type of (Triggering Unit)) equal to King Leonidas
    • Actions
      • Camera - Pan camera for (Owner of (Triggering Unit)) to (Center of Hero choosers <gen>) over 0.20 seconds
Also, to limit the construction of heroes, I found these (#1 = Player - Set property):
  • Player - Set (Player) available free heroes to 1
  • or:
  • Player - Limit training of heroes to 1 for (Player)
 
Level 5
Joined
Oct 9, 2008
Messages
134
Firstly, USE THAT EDIT BUTTON!!!!!!!! o_O

Several corrections:
  • (Unit-type of (Selling Unit)) equal to Tavern
Well, i think this dont work because

a) i sell the heros on the human hero altar

b) its called "Hero chooser"


----------------------------------------------
EDIT:

Is this other okay?:

  • Hero selection
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Available free Heroes to 1)
      • Player Group - Pick every player in (All players) and do (Player - Limit training of Heroes to 1 for (Picked player))
 
Level 11
Joined
Feb 14, 2009
Messages
884
Firstly, USE THAT EDIT BUTTON!!!!!!!! o_O

Several corrections:
  • (Unit-type of (Selling Unit)) equal to Tavern

"Tavern" is an example name. Change it to "Hero Chooser" if you wish.

kamermanbr said:
Is this other okay?:

  • Hero selection
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Player - Set (Picked player) Available free Heroes to 1)
    • Player Group - Pick every player in (All players) and do (Player - Limit training of Heroes to 1 for (Picked player))

This trigger leaks. Change it to this:

  • Hero selection
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set HumanPlayers = (All allies of Player 1 (Red))
    • Player Group - Pick every player in (HumanPlayers) and do (Player - Set (Picked player) Available free Heroes to 1)
    • Player Group - Pick every player in (HumanPlayers) and do (Player - Limit training of Heroes to 1 for (Picked player))
    • Custom script: call DestroyGroup(HumanPlayers)
There ye go!
 
Level 5
Joined
Oct 9, 2008
Messages
134
whyy i think i can do it, its anyting like this??

  • Hero selection
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set HumanPlayers = (All allies of Player 1 (Red))
      • Player Group - Pick every player in HumanPlayers and do (Player - Set (Picked player) Available free Heroes to 1)
      • Player Group - Pick every player in HumanPlayers and do (Player - Limit training of Heroes to 1 for (Picked player))
      • Custom script: call DestroyGroup(HumanPlayers)

edit bu.. the world editr dont acept te custom script =/

wat to do?
  • Custom script: call DestroyGroup(HumanPlayers)

here is the img:

triggers.jpg
 
Last edited:
Level 5
Joined
Oct 9, 2008
Messages
134
hun... me again xD

1) i do doble post to keep the post up and so you can see it .. so dont ask xDD

2) the problem is, the heros dont where they need to go.. and you can get more than 1

here are the triggers,
  • Hero selection
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set HumanPlayers = (All allies of Player 1 (Red))
      • Player Group - Pick every player in HumanPlayers and do (Player - Set (Picked player) Available free Heroes to 1)
      • Player Group - Pick every player in HumanPlayers and do (Player - Limit training of Heroes to 1 for (Picked player))
      • Custom script: call DestroyForce(udg_HumanPlayers)
  • Hero moves
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Hero chooser
    • Actions
      • Unit - Move (Sold unit) instantly to (Center of Hero Spawns <gen>)
      • Hero - Create Ancestral Staff and give it to (Sold unit)
      • Hero - Create Potion of Greater Healing and give it to (Sold unit)
      • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero Spawns <gen>) over 0.20 seconds









------------------------------------------------------------------------------------------

EDIT:

About the second trigger, i think it now could be solbed

  • Hero moves
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoning unit)) Equal to Hero chooser
    • Actions
      • Unit - Move (Summoned unit) instantly to (Center of Hero Spawns <gen>)
      • Hero - Create Ancestral Staff and give it to (Sold unit)
      • Hero - Create Potion of Greater Healing and give it to (Sold unit)
      • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero Spawns <gen>) over 0.20 seconds







-----------------------------------------------
Edit:


Not... keep not working..
 
Last edited:
Level 11
Joined
Feb 14, 2009
Messages
884
hun... me again xD

1) i do doble post to keep the post up and so you can see it .. so dont ask xDD

Double posting is against the rules, so please stop it.

The heroes are not summoned units. Only units created by spells are considered as "summoned".
The next trigger is taken from "War Chasers", edited to fit your needs.

  • Actions
    • Set HeroPosition = Position of (Last created unit)
    • Hero - Create Ancestral Staff and give it to (Last created unit)
    • Hero - Create Greater Healing and give it to (Last created unit)
    • Camera - Pan camera for (Owner of (Last created unit)) to HeroPosition
    • Custom Script: call RemoveLocation(udg_HeroPosition)
Hope this helps.
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
If the heroes are custom units they are not limited. Add them as a "Techtree - Dependency Equivalent" of an unused existing hero.
Set the Taverns to a variable array, eg. chooser. Then do:
  • Hero moves
  • Events
  • Unit - Chooser[1] Finishes training a unit
  • Conditions
  • Actions
  • Unit - Move (Trained unit) instantly to (Center of Hero Spawns <gen>)
  • Hero - Create Ancestral Staff and give it to (Trained unit)
  • Hero - Create Potion of Greater Healing and give it to (Trained unit)
  • Camera - Pan camera for (Owner of (Trained unit)) to (Center of Hero Spawns <gen>) over 0.20 seconds
@ Kercyn: that trigger has no event, and there is no "Unit Created" event. Also, the hero is not a created unit, it is not created with triggers. That's why War Chasers uses regions to pick heroes.
 
Level 5
Joined
Oct 9, 2008
Messages
134
So, you recommend, clean up all of the hero choosers buldings and put a region hero choosers whits circle of power???

its more easy to config???

Well so if that is it, i will change and put circle of powers hero seleccion, when i go to my home, but have some cuestions

1) i have only 2 differents heros to select and 10 players.

ah and another question... a little stupid.. xD
How to put a hero infront of the circle of power but in NEUTRAL and not in a color ? XDD
put any NEUTRAL unit whit name and Model Changed???


well again thanks for help...
 
Level 11
Joined
Feb 14, 2009
Messages
884
Circle summoning is rather old and it is not preferred by most mappers. Another thing you can do to limit the amount of heroes is to set the food limit to 1 (unless each player controls other units too)

About your seconds question: In your Unit Palette, change the owner to "Neutral Passive" and spawn heroes from there.
 
Status
Not open for further replies.
Top