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

[Trigger] Targetable Hero Resurrection.

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
I tried everything.
Been working on this (what I thought) simple thing.. And it just doesn't work.

First I made 3 triggers that combined together worked out very good..
A hero could be resurrected by the targettable spell with X health and Y mana. But! I had to set the Hero's death time to 20 seconds... But that isn't enough! However... 20 sec is max you can select... So I started this:

When a unit dies and the conditions are fine (didn't make the conditions yet because I first want the actions to work.) this happens:
  • Actions
    • Hero - Instantly revive (Triggering unit) at (Position of (Triggering unit)), Hide revival graphics
    • Hero - Disable experience gain for (Triggering unit)
    • Unit - Add classification of Dead to (Triggering unit)
    • Unit - Remove All buffs from (Triggering unit)
    • Unit - Pause (Triggering unit)
    • Unit - Set life of (Triggering unit) to 1.00
    • Unit - Set mana of (Triggering unit) to 0.00
    • Unit - Make (Triggering unit) Invulnerable
    • Animation - Play (Triggering unit)'s death animation
    • Unit - Add Locust to (Triggering unit)
This part works fine. It looks like the corpse of the hero withoud decaying or Dissipating.

However now I have to change my spell triggers a bit.

For the resurrection spell I edited the Channel spell.
It's ground targetable and has a 6sec channel time.

I used 2 triggers for the spell with 2 different events:

Unit begins channeling an ability and unit finishes casting an ability.

At the begin of the cast I wanted to make the trigger set the Variable ResTarget[PlayerNumberofOwnerof(CastingUnit)]
I did it like this:
  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True)) and (((Matching unit Greater than (>) 0
    • Then - Actions
  • Set ResTarget[PlayerNumberofOwnerof(CastingUnit)] = Random Unit from (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True))
    • Else - Actions
      • Unit - Order (Triggering unit) to Stop
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (==) (Owner of (Matching unit)))) the text: |cffffcc00You need to target an allied dead hero for this spell.|r
And here's the finished trigger that has to 'Resurrect' the unit.
ResTarget[...] Means ResTarget[number of owner of casting unit]
  • Actions
    • Unit - Unpause ResTarget[...]
    • Unit - Remove Locust from ResTarget[...]
    • Unit - Remove classification of Dead from ResTarget[...]
    • Unit - Make ResTarget[...] Vulnerable
    • Unit - Set life of ResTarget[...] to 30.00%
    • Unit - Set mana of ResTarget[...] to 5.00%
    • Hero - Enable experience gain for ResTarget[...]

I tried like Everything!
I even changed the triggers so when a hero dies there comes a rect/region under him. And when the hero casts the ability in the region he would become the 'ResTarget' unit...
I used UnitGroups too. To add a unit to a variable UnitGroupDeadHeroes when he dies.

It seems there's just something going wrong here with the second trigger.
This part seems like not working:
  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True)) and (((Matching unit Greater than (>) 0
    • Then - Actions
  • Set ResTarget[PlayerNumberofOwnerof(CastingUnit)] = Random Unit from (Units within 100.00 of (Target point of ability being cast) matching (((((Matching unit) is A Hero) Equal to (==) True) and (((Owner of (Matching unit)) is an ally of (Owner of (Triggering unit))) Equal to (==) True))
    • Else - Actions
      • Unit - Order (Triggering unit) to Stop
      • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (==) (Owner of (Matching unit)))) the text: |cffffcc00You need to target an allied dead hero for this spell.|r
Could someone with a littlebit more intellect explain me what's wrong here?:D
I'm getting very frustrated atm because this is ruining my day off:p
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Well. To resurrect the unit, i first need to name him.
I name him to the variable ResTarget.

However I did this:

Set ResTarget = Random unit from units within 100 of target point of ability being cast (resurrection) matching 3 different conditions.

However when I do this it works.
Random unit from units within 100 of point WITHOUD any conditions.
(but with this i can 'resurrect' living units..)

So what's basically going wrong is that the unit in the targetted area can't be tracked with any 'matching' events.. And that's my big frustration..

could it be because of the Pause Unit? or the Locust ability?
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
I did some tests and came to a conclussion...

It doesn't work because of Locust:(

..

Someone knows what I can do to make the unit untargetable withoud adding locust? Guess there is no good other way..

I don't want something like

Event: Player selects a unit.. or something.

I even want to let the selection circle NOT appear when mousing over him..
However I think this is not possible:p
 
Level 9
Joined
May 27, 2006
Messages
498
The only way to make unit untargetable is to add Locust ability to it.
And you cant set a dead unit to a variable. You have to set your hero to the variable and the map initialization/when the hero is created. Then you'll be able to refer to him when he dies and revive him.

You would do something like that:

  • Death
  • Events:
    • Unit - A unit dies
  • Conditions:
    • Or - Any conditions are true
      • (Triggering unit) Equal to Hero[1]
      • (Triggering unit) Equal to Hero[2]
      • (Triggering unit) Equal to Hero[3]
      • (Triggering unit) Equal to Hero[4]
      • (Triggering unit) Equal to Hero[5]
      • and so on...
  • Actions:
    • Unit - Hide (Triggering unit)
    • Set TempPoint = Position of (Triggering unit)
    • Unit - Create 1 hero_corpse_unit for (Owner of (Triggering unit)) at TempPoint facing... blah
    • Set HeroCorpse[(Player number of (Owner of (Triggering unit)))] = (Last Created unit)
    • Custom script: call RemoveLocation(udg_TempPoint)

  • Ress
  • Events:
    • Unit - A unit begins casting an ability
  • Conditions:
    • (Ability being cast) Equal to Your_ressurection_ability
  • Actions:
    • For each (Integer A) from 1 to 10 do (Actions):
      • If/Then/Else - Multiple conditions:
        • If - Conditions:
          • (Target unit of ability being cast) Equal to HeroCorpse[(Integer A)]
        • Then - Actions:
          • Set TempPoint = Position of (HeroCorpse[(Integer A)])
          • Hero - Revive Hero[(Integer A)] at TempPoint, Hide revival graphics
          • Unit - Show Hero[(Integer A)]
          • Unit - Remove HeroCorpse[(Integer A)] from the game
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Set HeroCorpse[(Integer A)] = No unit
        • Else - Actions
hero_corpse_unit would be a unit with an ankh model (without Locust ability so it can be targeted)
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
The only way to make unit untargetable is to add Locust ability to it.
And you cant set a dead unit to a variable. You have to set your hero to the variable and the map initialization/when the hero is created. Then you'll be able to refer to him when he dies and revive him.

You would do something like that:

  • Death
  • Events:
    • Unit - A unit dies
  • Conditions:
    • Or - Any conditions are true
      • (Triggering unit) Equal to Hero[1]
      • (Triggering unit) Equal to Hero[2]
      • (Triggering unit) Equal to Hero[3]
      • (Triggering unit) Equal to Hero[4]
      • (Triggering unit) Equal to Hero[5]
      • and so on...
  • Actions:
    • Unit - Hide (Triggering unit)
    • Set TempPoint = Position of (Triggering unit)
    • Unit - Create 1 hero_corpse_unit for (Owner of (Triggering unit)) at TempPoint facing... blah
    • Set HeroCorpse[(Player number of (Owner of (Triggering unit)))] = (Last Created unit)
    • Custom script: call RemoveLocation(udg_TempPoint)

  • Ress
  • Events:
    • Unit - A unit begins casting an ability
  • Conditions:
    • (Ability being cast) Equal to Your_ressurection_ability
  • Actions:
    • For each (Integer A) from 1 to 10 do (Actions):
      • If/Then/Else - Multiple conditions:
        • If - Conditions:
          • (Target unit of ability being cast) Equal to HeroCorpse[(Integer A)]
        • Then - Actions:
          • Set TempPoint = Position of (HeroCorpse[(Integer A)])
          • Hero - Revive Hero[(Integer A)] at TempPoint, Hide revival graphics
          • Unit - Show Hero[(Integer A)]
          • Unit - Remove HeroCorpse[(Integer A)] from the game
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Set HeroCorpse[(Integer A)] = No unit
        • Else - Actions
hero_corpse_unit would be a unit with an ankh model (without Locust ability so it can be targeted)

Well I had that idea to create an ankh model etc.
But I don't want it.
I want to let the dead model look the same as the hero, and I want others to be able to walk over it (so collosion off) and I want it to be untargetable like it is a real dead unit.

I will figure something out.
Just not now:p
 
Status
Not open for further replies.
Top