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

I want someone to check this trigger!

Status
Not open for further replies.
Level 15
Joined
Aug 11, 2009
Messages
1,606
Well i have this trigger in my map,i'm not the one who made it!and for some reason the -repick command just doesn't work!Anyone able to see what's wrong?

  • Tavern Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Tavern1Heroes[1] = Kael Fireburn
      • Set Tavern1Heroes[2] = Orc Avenger
      • Set Tavern1Heroes[3] = Draconian Guard
      • Set Tavern1Heroes[4] = Tiger Slicer
      • Set Tavern1Heroes[5] = Royal Captain
      • Set Tavern1Heroes[6] = Shandris Quelthas
      • Set Tavern1Heroes[7] = Void Lord
  • Tavern Hero Chosen
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to Tavern 0011 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: You already chose a...
        • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of HeroSpawn <gen>)
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
          • Camera - Pan camera for (Owner of (Sold unit)) to (Center of HeroSpawn <gen>) over 1.00 seconds
          • Selection - Clear selection for (Owner of (Sold unit))
          • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
  • Tavern Hero Repick
    • Events
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • HeroChosenByPlayer[(Player number of (Triggering player))] Equal to True
          • PlayerRepicked[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set TempUnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Picked unit)) Available for training/construction by (Picked player)
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + has repicked a hero!)
      • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = False
      • Selection - Clear selection for (Triggering player)
      • Selection - Add Tavern 0011 <gen> to selection for (Triggering player)
      • Camera - Pan camera for (Triggering player) to (Center of CameraPanOverTavern <gen>) over 1.00 seconds
      • Set PlayerRepicked[(Player number of (Triggering player))] = True
+rep for the one who fixes my problem and credits in my map http://www.hiveworkshop.com/forums/map-development-202/my-map-the-eternal-battle-140915/
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
I think, you can't pick every unit in a group and then pick every player at the same time
So try to use global veriable for the picked unit like "RepickedHero" without array

Then remove the unit, and then make it available for construction, and clear the used veriable with custom script
That should solve the problem, if not, I will must find one of my maps
where I did the repick thing and show you the way it must be done.
 
Level 7
Joined
May 3, 2007
Messages
210
Is PlayerRepicked automaticely set to FALSE for all players?

Why do you even need to pick every unit if they can only have one hero?
If they're only allowed to have one hero, eliminate the Unit Group loop, and have only the Player Group loop, and replace Picked Unit with TempUnitGroup.
 
Status
Not open for further replies.
Top