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

Floating Text displaying time left for revival

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Title says a lot.

I want to display a 'Floating Text' over 'dead heroes' that displays a countdown timer from 10 to 0, and then revive the unit. I've been trying to do it for a while but I haven't found the way.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Sort of... but seems too complicated :S

Thinking deeper, I think that what i need is like the Alchemist Stun Timer countdown.
- If the hero is revived, the countdown stops (If Alchemist releases the stun, it stops)
- If the countdown reaches to 0, the hero is revived in town (If alchemist doesn't release the stun, he gets stuned/damaged)
- I need it to go from 10 to 0 (Alchemist one goes from 5 to 0)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok... searching around google, I found that Floating Text can read Timers Windows.

I would need to
- Create a timer (I don't know how to do it MUI or at least MPI)
- Create a window for it (Same than before)
- Hide the window (Same than before)
- Create the Floating Text that reads the timer (Also MUI or MPI)
- Change the text of that floating text every second (I Would need to include it in a variable for each unit, wich i don't know how to do either) to the actual timer, since it is supposed to change every second.
- Bla bla, create actions when reaches to 0, or stop if Resurrect if revive is casted.

  • Unit Dyes Start Timer
    • Events
      • Unit - A unit Dies
    • Conditions
      • Triggering Unit is a Hero
    • Actions
      • Countdown Timer - Start DeadTimer as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title DeadTimer
      • Countdown Timer - Hide (Last started timer)
      • Floating Text - Create floating text that reads (String((Remaining time for DeadTimer), 2, 0)) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Something lioke that. I have a headache, i can't think... Hope to find a solution here in the morning. Good Night!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Ok... done... medics drugged me and my head doesn't hury anymore.

Gaias Retaliation has a system where a Cross is created at the position of the dead hero with a BlueBar over it that goes from full to empty (like a timer) over 60 segs, I think. And everything is removed when "Revive" is casted on that cross.

I want that, but without the blue bar, but with a timer, and rev time to 10 segs, and not 60 segs.

Again, I have no idea on how to do it, I don't know how to do interger increase and anything :p
 
Level 9
Joined
Apr 26, 2011
Messages
403
Code:
try it this way (sorry for hard to read text)

Global variable :
DeadTimer[1-12]  // one timer per player
DisplayTimer // only need one timer for everyone 
Player_hero[1-12] // one hero per player 
UnitGroup_DeadHero // keep a list of dead hero waiting for revive

// this trigger will keep running, 
// it do nothing if UnitGroup_DeadHero is empty
Game Start :
  Countdown Timer - Start DisplayTimer as a Period timer every 1 second. 

Trigger 1
Trigger - Unit die
Condition - Triggering Unit is a Hero
Action:
  set temp_integer = player number of triggering player 	
  Countdown Timer - Start DeadTimer[temp_integer ] as a One-shot timer that will expire in 10.00 seconds
 add triggering unit to UnitGroup_DeadHero 


// this trigger will display floating text above every dead hero's head
// every player have their own DeadTimmer with difference remaining time
// this trigger do nothing if UnitGroup_DeadHero is empty
Trigger 2:
event : timer expired
condition : 
  - expired timer = DisplayTimer 
  - count unit in UnitGroup_DeadHero > 0
Action : 
 pick every unit in UnitGroup_DeadHero do
   -set temp_integer = player number of (owner of pick unit) 	    
   -display floating text(Remaining time for DeadTimer[temp_integer]) above pick unit

// this trigger will revive the dead hero
// every player have their own DeadTimmer so you know which hero to revive
Trigger 3:
event : Timer expired
condition : 
   expired timer = DeadTimer[1]
action:
 pause DeadTimer[1]
 revive the Player_hero[1]
 remove Player_hero[1] from UnitGroup_DeadHero 
 
and copy trigger 3 for DeadTimer[2], DeadTimer[3]...DeadTimer[12]
 
Level 9
Joined
Apr 26, 2011
Messages
403
here is example of blue bar :

1, create a string of 20x "I"
IIIIIIIIIIIIIIIIIIII

2, add color to string:
IIIIIIIIIIIIIIIIIIII

3, save string in variable. eg: bar_code = "IIIIIIIIIIIIIIIIIIII"

4, update the variable "bar_code" with difference color base on timer, eg :

IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIII
 
Status
Not open for further replies.
Top