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

Help with tavern

Status
Not open for further replies.
Level 3
Joined
Sep 29, 2012
Messages
37
  • Tavern Hero Chosen
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Herochosenbyplayer[(Player number of (Picked player))] = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by (Owner of (Sold unit)) matching (((Triggering unit) is A Hero) Equal to True))) Equal to 1
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
          • Game - Display to (All players) the text: You already chose a...
        • Else - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Sold unit))) + ( has selected + (Name of (Sold unit))))
          • Unit - Remove (Buying unit) from the game
          • 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)


  • 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 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) 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
    • Actions
      • Set TempUnitGroup = (Units owned by (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Player Group - Pick every player in (Player group((Triggering player))) and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Lost Soul for (Triggering player) at (Random point in Tarven <gen>) facing Default building facing degrees
              • 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 (Triggering player))] = False
              • Selection - Clear selection for (Triggering player)
              • Selection - Add Tavern 0018 <gen> to selection for (Triggering player)
              • Camera - Pan camera for (Triggering player) to (Center of Tarven <gen>) over 0.00 seconds
              • Set PlayerRepicked[(Player number of (Triggering player))] = False
        • Else - Actions


  • Tavern Hero Random
    • Events
      • Player - Player 2 (Blue) types a chat message containing -random as An exact match
      • Player - Player 3 (Teal) types a chat message containing -random as An exact match
      • Player - Player 4 (Purple) types a chat message containing -random as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
      • Player - Player 6 (Orange) types a chat message containing -random as An exact match
      • Player - Player 8 (Pink) types a chat message containing -random as An exact match
      • Player - Player 9 (Gray) types a chat message containing -random as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
      • Player - Player 12 (Brown) types a chat message containing -random as An exact match
    • Conditions
    • Actions
      • Set MaxHero = 8
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Lost Soul) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • If ((Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) then do (Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tarven <gen>) facing Default building facing degrees) else do (Do nothing)

After i choose a hero i cant repick and i still can choose another hero by typing -random.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • Tavern Hero Repick
    • (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1
The trigger didn't realize who is (Owner of (Triggering Unit)), there's no (Triggering Unit) since the event is about player. Change the (Owner of (Triggering Unit)) to (Triggering Player).

Result :
  • (Number of units in (Units owned by (Triggering Player)) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1

  • Random
    • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Lost Soul) and do (Actions)
the same as above, there's no (Owner of (Triggering Unit)).

  • Unit Group - Pick every unit in (Units owned by (Triggering Player)) of type Lost Soul) and do (Actions)
next time use [HIDDEN*] [/HIDDEN*] tags please, the trigger stretched the page and make it looks really bad.

Note : Change all (Owner of (Triggering Unit)) to (Triggering Player).
 
Last edited:
Level 3
Joined
Sep 29, 2012
Messages
37
Tavern Hero Random
Events
Player - Player 2 (Blue) types a chat message containing -random as An exact match
Player - Player 3 (Teal) types a chat message containing -random as An exact match
Player - Player 4 (Purple) types a chat message containing -random as An exact match
Player - Player 5 (Yellow) types a chat message containing -random as An exact match
Player - Player 6 (Orange) types a chat message containing -random as An exact match
Player - Player 8 (Pink) types a chat message containing -random as An exact match
Player - Player 9 (Gray) types a chat message containing -random as An exact match
Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
Player - Player 12 (Brown) types a chat message containing -random as An exact match
Conditions
Actions
Set MaxHero = 8
Unit Group - Pick every unit in (Units owned by (Triggering player) of type Lost Soul) and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
If ((Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) then do (Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tarven <gen>) facing Default building facing degrees) else do (Do nothing)
Game - Display to (All players) for 5.00 seconds the text: ((Name of (Triggering player)) + ( has randomed + (Name of (Triggering unit))))


The last part how do i make the name of randomed unit.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • If ((Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) then do (Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tarven <gen>) facing Default building facing degrees) else do (Do nothing)
  • Game - Display to (All players) for 5.00 seconds the text: ((Name of (Triggering player)) + ( has randomed + (Name of (Triggering unit))))
there's no (Triggering Unit) like what i told u before.
use Multiple Functions and change it to (Last Created Unit).

result :

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0)
    • Then - Actions
      • (Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tarven <gen>) facing Default building facing degrees)
      • Game - Display to (All players) for 5.00 seconds the text: ((Name of (Triggering player)) + ( has randomed + (Name of (Last Created Unit))))
    • Else - Actions
P.S use [Hidden*] [/Hidden*] tags pleaseeeeeeeeeeeeeeeeeeee.........
 
Level 3
Joined
Sep 29, 2012
Messages
37
  • Repick
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: ((Player_Colors[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r has repicked + (Name of (Owner of (Last created unit)))))
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • Repick
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: ((Player_Colors[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r has repicked + (Name of (Owner of (Last created unit)))))

you cannot use that there
.

because when you repick hero, there is no hero created while the random has that.

  • Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tavern <gen>) facing Default building facing degrees
Solution :

add a new trigger to check if the unit had already picked a hero. like this :

  • Any Name
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Herochosenbyplayer[(Player number of (Owner of (Triggering Unit))] Equal to True
    • Actions
      • Game - Display to (All players) the text: Game - Display to (All players) the text: ((Player_Colors[(Player number of (Owner of (Triggering Unit))] + (Name of (Owner of (Triggering Unit))) + (|r has repicked + (Name of (Sold unit)))))
and then add a condition to your trigger "Tavern Hero Chosen"

  • Herochosenbyplayer[(Player number of (Owner of (Triggering Unit))] Equal to False
 
Last edited:
Level 3
Joined
Sep 29, 2012
Messages
37
How to prevent from show game text after i pick a hero when i type -random



  • Tavern Hero Random
    • Events
      • Player - Player 2 (Blue) types a chat message containing -random as An exact match
      • Player - Player 3 (Teal) types a chat message containing -random as An exact match
      • Player - Player 4 (Purple) types a chat message containing -random as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
      • Player - Player 6 (Orange) types a chat message containing -random as An exact match
      • Player - Player 8 (Pink) types a chat message containing -random as An exact match
      • Player - Player 9 (Gray) types a chat message containing -random as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
      • Player - Player 12 (Brown) types a chat message containing -random as An exact match
    • Conditions
    • Actions
      • Set MaxHero = 8
      • Unit Group - Pick every unit in (Units owned by (Triggering player) of type Lost Soul) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • If ((Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) then do (Unit - Create 1 Tavern1Heroes[(Random integer number between 1 and MaxHero)] for (Triggering player) at (Center of Tarven <gen>) facing Default building facing degrees) else do (Do nothing)
      • Game - Display to (All players) the text: ((Player_Colors[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r has randomed + (Name of (Last created unit))))
 
Status
Not open for further replies.
Top