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

Hero Revival & Lives

Status
Not open for further replies.
Level 1
Joined
Aug 11, 2007
Messages
3
Alright, before I start i'd like you to know i'm new at this. I'd also like to mention that i'm not asking you to do it all for me, just to give me a basic idea on what to do which could help me out here; otherwise I won't learn. :smile:

So the thing is, i'm trying to make it so when a Hero dies, he/she will revival after a certain period of time at the center of a region: also showing a countdown for how long he/she has left till he/she revives, whilst still able to show timers of other people that are currently dead. I've looked around and the only help that I found was custom scripts which I have completely no clue about:

http://world-editor-tutorials.thehelper.net/revive.php

I've tried this and it would've been great if the author went into more detail about how it worked, aswell as the fact I don't really know how to change the position of where the hero revives :confused:


And another thing, because the players are cooperating here, their lives are shared. The problem i'm having here is how will I make it so that when a hero dies, a life is lost and a building gets destroyed? I've already got a leaderboard showing the amount of lives remaining and how many kills a player has got.

May seem like a bit much to ask, but help would be GREATLY appreciated, thanks. :grin:
 
Level 9
Joined
Jun 18, 2004
Messages
565
This is a bit much. But...I'm quite bored and waiting for replies to my thread in the modeling section about Milkshape exporting and animations that I'm having so much trouble with and would love some help. However, to justify my shallow, shallow pleas for help and hijacking of the thread, I shall help you.


Hero revival...is actually quite simple. Here's a trigger I made.

  • Hero Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Justicar
        • Then - Actions
          • Countdown Timer - Start JusticarTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
          • Set JusticarTimer = (Last started timer)
          • Countdown Timer - Create a timer window for JusticarTimer with title Justicar
          • Set JusticarTimerWindow = (Last created timer window)
        • Else - Actions
          • Do nothing
It's a little complex at first sight, but I'll 'splain it. I have the basic Event at the top, checking if a unit dies. My If/Then/Else checks which hero it was (This is for an AoS Map, I have a Unit Variable named "Justicar" set to the hero) and then...my favourite.

Rather than having a boring, static hero timer that is always the same whether you're level 1 or level 100, I use a simple formula to calculate time. If you're only level 1 and you die, you simply wait 5 seconds, Because my Forumula is [Hero's Level X 5]. This is deadly useful, since new players to a map may have trouble, and having them wait minutes is boring. And, when you're higher leveled and understand the game, it makes losing your hero a more costly business.

Then, after I've made the time, I create a CountDown Timer. Since the timer would be invisible, I have to create a timer window. I set a variable on the deuce, and I'm done with that!

To revive them, simply...

  • Hero Revive JUSTICAR
    • Events
      • Time - JusticarTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy JusticarTimerWindow
      • Hero - Instantly revive Justicar at (Center of HeroRevive <gen>), Show revival graphics
And done.


How to lower lives and destroy a building?

  • Lives
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Set Lives = (Lives - 1)
          • Unit - Kill (Your Building)
        • Else - Actions
          • Do nothing
"Lives" is an interger variable, and I just subtract 1 from it. Then I do an Action that kills the building.




If I'm not clear on anything, please reply.

iron_warrior.

EDIT: Geez, I wrote a novel here...
 
Level 1
Joined
Aug 11, 2007
Messages
3
This is a bit much. But...I'm quite bored and waiting for replies to my thread in the modeling section about Milkshape exporting and animations that I'm having so much trouble with and would love some help. However, to justify my shallow, shallow pleas for help and hijacking of the thread, I shall help you.


Hero revival...is actually quite simple. Here's a trigger I made.

  • Hero Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Justicar
        • Then - Actions
          • Countdown Timer - Start JusticarTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
          • Set JusticarTimer = (Last started timer)
          • Countdown Timer - Create a timer window for JusticarTimer with title Justicar
          • Set JusticarTimerWindow = (Last created timer window)
        • Else - Actions
          • Do nothing
It's a little complex at first sight, but I'll 'splain it. I have the basic Event at the top, checking if a unit dies. My If/Then/Else checks which hero it was (This is for an AoS Map, I have a Unit Variable named "Justicar" set to the hero) and then...my favourite.

Rather than having a boring, static hero timer that is always the same whether you're level 1 or level 100, I use a simple formula to calculate time. If you're only level 1 and you die, you simply wait 5 seconds, Because my Forumula is [Hero's Level X 5]. This is deadly useful, since new players to a map may have trouble, and having them wait minutes is boring. And, when you're higher leveled and understand the game, it makes losing your hero a more costly business.

Then, after I've made the time, I create a CountDown Timer. Since the timer would be invisible, I have to create a timer window. I set a variable on the deuce, and I'm done with that!

To revive them, simply...

  • Hero Revive JUSTICAR
    • Events
      • Time - JusticarTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy JusticarTimerWindow
      • Hero - Instantly revive Justicar at (Center of HeroRevive <gen>), Show revival graphics
And done.


How to lower lives and destroy a building?

  • Lives
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Set Lives = (Lives - 1)
          • Unit - Kill (Your Building)
        • Else - Actions
          • Do nothing
"Lives" is an interger variable, and I just subtract 1 from it. Then I do an Action that kills the building.




If I'm not clear on anything, please reply.

iron_warrior.

EDIT: Geez, I wrote a novel here...

Thank you, this has helped alot. :grin:

There's just 2 things i'm kind confused about;

The Justicar variable - because there's different types of heroes, what would the variable look like? Couldn't get my head around it :confused:

And the last, there's 25 of the same building (sorry for not saying this earlier), will that trigger work by only destroying 1 of those buildings?

I greatly appreciate the fact you spent alot of time explaining this to me :wink:
 
Level 9
Joined
Jun 18, 2004
Messages
565
Is there only 1 hero of each type on the map? If so, just make a variable for each of them and an If/Then/Else Action that checks which hero, and starts the correct timer.

25 of each building? Just randomly select one of them to be executed...like so...

  • Actions
    • Unit Group - Pick every unit in (Random 1 units from (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Your Building))) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
 
Level 1
Joined
Aug 11, 2007
Messages
3
Thank you very much for the help you gave me, these solutions have worked and I am extremely grateful. :grin:
 
Level 4
Joined
Jul 30, 2007
Messages
79
the other option for the hero variable is have it set when a player picks his hero and assign it to the players number

i dont have the exact triggers but something like
Event: A hero is purchased
Set (HeroVar(PlayerNumberOfPurchasingPlayer) to Purchased Hero



then your for your hero death timer and revival you could do

  • Hero Death
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • For each Integer 1 - (number of players)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to HeroVar(integerA)
        • Then - Actions
          • Countdown Timer - Start HeroRevive(integerA) as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
          • Set HeroRevive(integerA) = (Last started timer)
          • Countdown Timer - Create a timer window for HeroRevive(integerA) with title Player name of owner of dieing unit
          • Set HeroReviveWindow(integerA) = (Last created timer window)
        • Else - Actions
          • Do nothing
 
Status
Not open for further replies.
Top