• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Random Pick

Status
Not open for further replies.
Level 3
Joined
Dec 3, 2009
Messages
39
1.Ok so i have a hero tavern in my map how do i make it so that after say 20 sec if you haven't chosen a hero it randomly picks 1 for you, thanks in advance :D

2.how do I make it so that the timers don't go all the way across the screen like at most i might have 5 timer windows up(for hero revival) how do i make them stack underneath each other instead of going across the screen. here is my trigger.

  • Revive timer Sea Hunter
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Sea Hunter
    • Actions
      • Player - Set (Triggering player) Current gold to 750
      • Countdown Timer - Start Timer_2 as a One-shot timer that will expire in 180.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Sea Hunter
      • Set Timer_window2 = (Last created timer window)
      • Countdown Timer - Show Timer_window2
      • Wait 180.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of Region 003 <gen>), Hide revival graphics
      • Countdown Timer - Destroy Timer_window2
 
Last edited:
Level 20
Joined
Jan 6, 2008
Messages
2,627
make a variale, Unit Type with array called Heroes, then you set all the hero types, and then make an Event, Time - Elapsed time equal to 20 and then create 1 Heroes[Math - Random Number between 1-Maxheroes, 6 ?] for the players, but i would use a boolean to check if they got a hero or not.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
thats impossible, but a Multiboard could stimulate it, you make a multiboard with 5 rows 2 colums, if you got 5 timers, please check a tutorial for it tho, and then make in column 2 make the timer, and update it to -1 every second, and set +1 more row for the multiboard and add the new timer.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
Ill make a sample map and post triggers..

I couldnt recycle it, but if you make it like the NextWave trigger with another event and edit the time goes down, then you will achieve it... look at the nextwave trigger to see how it is done, do a trigger like that with all players if you dont find a simple way, im abit lazy now, i need to work on my own map :p, but you will get how it is done.. Basicly you make a number of every single action, so player ones hero is 1, player 2 is 2, and etc....
¨

  • Ini
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 1 rows, titled Timers
      • Set Multiboard = (Last created multiboard)
      • Multiboard - Set the display style for Multiboard item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 2, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 3, row 1 to Show text and Hide icons
      • Multiboard - Set the width for Multiboard item in column 1, row 1 to 14.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row 1 to 0.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row 1 to 0.00% of the total screen width
      • Multiboard - Set the text for Multiboard item in column 1, row 1 to Timer window by Sla...
      • Multiboard - Show Multiboard
  • Next Wave
    • Events
      • Time - Elapsed game time is 0.15 seconds
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Execution count of (This trigger)) Equal to 1
        • Then - Actions
          • Multiboard - Change the number of rows for Multiboard to ((Number of rows in Multiboard) + 1)
        • Else - Actions
      • Set NextWaveInteger = 2
      • Multiboard - Set the display style for Multiboard item in column 1, row NextWaveInteger to Hide text and Show icons
      • Multiboard - Set the display style for Multiboard item in column 2, row NextWaveInteger to Show text and Hide icons
      • Multiboard - Set the display style for Multiboard item in column 3, row NextWaveInteger to Show text and Hide icons
      • Multiboard - Set the width for Multiboard item in column 1, row NextWaveInteger to 1.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 2, row NextWaveInteger to 10.00% of the total screen width
      • Multiboard - Set the width for Multiboard item in column 3, row NextWaveInteger to 3.00% of the total screen width
      • Multiboard - Set the icon for Multiboard item in column 1, row NextWaveInteger to ReplaceableTextures\CommandButtons\BTNWindWalkOff.blp
      • Multiboard - Set the text for Multiboard item in column 2, row NextWaveInteger to Next Wave in:
      • Multiboard - Set the text for Multiboard item in column 3, row NextWaveInteger to (String(Time[NextWaveInteger]))
      • Set Time[NextWaveInteger] = 25
  • Time goes Down
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Rowsinuse = (Number of rows in Multiboard)
      • For each (Integer A) from 2 to Rowsinuse, do (Actions)
        • Loop - Actions
          • Set Time[(Integer A)] = (Time[(Integer A)] - 1)
          • Multiboard - Set the text for Multiboard item in column 3, row (Integer A) to (String(Time[(Integer A)]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Time[(Integer A)] Equal to 0
            • Then - Actions
              • Multiboard - Set the width for Multiboard item in column 1, row (Integer A) to 0.00% of the total screen width
              • Multiboard - Set the width for Multiboard item in column 2, row (Integer A) to 0.00% of the total screen width
              • Multiboard - Set the width for Multiboard item in column 3, row (Integer A) to 0.00% of the total screen width
              • Multiboard - Set the display style for Multiboard item in column 1, row (Integer A) to Hide text and Hide icons
              • Multiboard - Set the display style for Multiboard item in column 2, row (Integer A) to Hide text and Hide icons
              • Multiboard - Set the display style for Multiboard item in column 3, row (Integer A) to Hide text and Hide icons
            • Else - Actions
 

Attachments

  • MultiboardTimers.w3x
    17.8 KB · Views: 49
Last edited:
Level 3
Joined
Dec 3, 2009
Messages
39
Thanks, you don't have to do this im sure i might firgure it out in a day or so lol but, mine is to revive a hero sort of thing couldn't i just make it when the hero dies they multiboard is created and then the 3 min timer for the hero starts so like this

Hero:3:00
Hero2:0:50
hero3:1:00
Ect

then when it finishs the heros name gets removed from the multibord, i have already made the timer could i just make the multiboard show the timer?
Hmm also i wouldn't know how to do that so if you could just tell me how to make the multiboard show the timer i made in my first post that'd be great if thats possiblr
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
basics of hero revival, not the best but hey it works ...

revivecode.jpg


edit

taken from the helper editor site, credit them if you use it
 
Level 3
Joined
Dec 3, 2009
Messages
39
Baassee theres nothing in your post?
Also slaydon your triggers were for a wave mine are for at the end of that timer the hero comes back?

Also all i want now is for the timer i made in my first post to be in a multiboard isn't there away to do that?
 
Last edited:
Level 1
Joined
Dec 23, 2009
Messages
2
okay, if you want a hero to be selected for a player if they don't select one themselves after 20 seconds make a trigger that basically states:

Event: Time elapsed 20
Conditions: (none)
Action:
Loop for A from 1-12
Select all units for player [integer A] matching picked unit is [A hero]
(something that counts the units selected by player [integer A] matching is [a hero])
If (that count variable) > 0
then
Create unit (random unit from [Unit array] of heros) for player [integer A]
set player [integer A] property = player [integer A] property - (cost of hero)
else
Do nothing
endif

for the hero respawn timers use a multiboard with an arrayed variable for the different players and the times their heros die for.
 
Status
Not open for further replies.
Top