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

Hero Tavern (Random Hero Pick) Help!

Status
Not open for further replies.
Level 11
Joined
Nov 1, 2008
Messages
828
How would i make this trigger work?
  • Unit Group - Pick every unit in (Units of type |caabb3000Ancient Beast|r) and do (Unit Group - Add (Picked unit) to randomherogrouplight)
I'm trying to put random units in the group that arn't even on the map but they are in the hero tavern! And how would i be able to remove that unit once picked from the hero tavern? Thankyou!
+rep
 
Last edited:
You can use unit pools. It only requires some custom scripts:


  • Untitled Trigger 080
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local unitpool up = CreateUnitPool()
      • Custom script: call UnitPoolAddUnitType(up, 'Hpal', 1)
      • Custom script: call UnitPoolAddUnitType(up, 'Hmkg', 1)
      • Custom script: call UnitPoolAddUnitType(up, 'Hamg', 1)
      • Custom script: call UnitPoolAddUnitType(up, 'Hblm', 1)
      • Custom script: call SaveUnitPoolHandle(udg_hash, 0, StringHash("unitpool"), up)
  • Untitled Trigger 082
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: local unitpool up = LoadUnitPoolHandle(udg_hash, 0, StringHash("unitpool"))
      • Custom script: set bj_lastCreatedUnit = PlaceRandomUnit(up, GetTriggerPlayer(), 0, 0, 0)
      • Custom script: call UnitPoolRemoveUnitType(up, GetUnitTypeId(bj_lastCreatedUnit))
      • Custom script: set up = null


Add the raw codes of unit types in the first trigger. You also need to create a hashtable variable called hash in the variable editor.

EDIT: Ok, you propably meant this:
  • Untitled Trigger 015
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Limit training of (Unit-type of (Sold unit)) to 0 for (Picked player)
 
I have never used unit pools before =o
Here is my triggers:




  • Hero Random Chosen Light
    • Events
      • Unit - A unit enters Rect 183 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Unit-type of (Triggering unit)) Equal to Random Hero
    • Actions
      • Unit Group - Pick every unit in (Units of type |caabb3000Ancient Beast|r) and do (Unit Group - Add (Picked unit) to randomherogrouplight)
      • Unit Group - Pick every unit in (Random 1 units from randomherogrouplight) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Triggering unit)) at (Center of Region 177 <gen>) facing (Position of (Triggering unit))
          • Unit Group - Remove (Picked unit) from randomherogrouplight
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Hero Picker) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Unit - Remove (Triggering unit) from the game
      • Player - Set (Owner of (Triggering unit)) Current lumber to 1
      • Player - Set (Owner of (Triggering unit)) Current gold to 500
      • Player Group - Add (Owner of (Triggering unit)) to LightSide_Players
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Rect 182 <gen>) over 1.00 seconds
      • Game - Display to (Player group((Owner of (Triggering unit)))) for 15.00 seconds the text: |cffffcc00Choose yo...
 
Status
Not open for further replies.
Back
Top