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

[Trigger] Point Resurrect Spell Problem

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set DeadHero[1] = (Dying unit)
      • Set DeadHeroPoint[1] = (Position of (Dying unit))
My problem here is that I'm not sure how to add a value/variable for the max of 8 players in the game corresponding to each hero that has died belonging to players 1-8. It's confusing me, lol.

  • Ressurect
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Resurect
    • Actions
      • Unit - Make (Casting unit) face (Target point of ability being cast) over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If ((Issued order) Equal to (Order(move))) then do (Trigger - Turn off (This trigger)) else do (Do nothing)
          • Trigger - Turn on (This trigger)
          • Trigger - Turn off Resurrect Effect <gen>
          • Trigger - Turn on Resurrect Effect <gen>
        • Else - Actions
      • Wait 5.00 seconds
      • Hero - Instantly revive DeadHero[1] at (Target point of ability being cast), Show revival graphics
      • Trigger - Turn off Resurrect Effect <gen>
      • Trigger - Turn on Resurrect Effect <gen>
Pretty much a continuation of the 1st problem here. The variable DeadHero[1] only applies to 1 unit, so how do I set it up to cover all 8 players in total? I also need to set up multiple points I guess for all 8 players??

  • Resurrect Effect
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Resurect
    • Actions
      • Special Effect - Create a special effect at DeadHeroPoint[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at DeadHeroPoint[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at DeadHeroPoint[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at DeadHeroPoint[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at DeadHeroPoint[1] using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
This will be easy to fix once I know how to fix the above 2 problems.
 
Level 4
Joined
Jul 30, 2010
Messages
57
Will the players control just one hero? if yes you can use this
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set DeadHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
      • Set DeadHeroPoint[(Player number of (Owner of (Dying unit)))] = (Position of (Dying unit))
This will save in the respective players slots in the variable
And don't forget you will need clean the variable's slots after the spell ends to avoid leaks.
 
Level 8
Joined
Feb 17, 2007
Messages
368
Yeah that's what I did, lol, it didn't work though. The players heroes didn't rez. Hmmm basically what I'm trying to do is to rez the players from the point they die. I guess to do that I need to create a corpse exactly where they die? I don't really want players to be able to target anywhere else besides dead corpses so I guess I will have to change the spell. Not sure how to do this though. I heard that heroes have corpses it's just they go to the edge of the map or something? I'm confused, lol.
 
Level 5
Joined
Jan 4, 2007
Messages
103
The first tigger will work as PauloCesar said, in the second your if-then-else has no conditions and you've put turn off turn on triggers without a wait for both in the if-then-else. Instead of your revive hero:
  • Hero - Instantly revive DeadHero[1] at (Target point of ability being cast), Show revival graphics
Put the same as PauloCesar said:
  • Hero - Instantly revive DeadHero[Player number of (Owner of (Casting Unit)))] at (DeadHeroPoint[(Player number of (Owner of (Casting Unit)))]), Show revival graphics
Hope it helps:)
 
Ok, I made it for you. It uses a script in the map's header, so that you can call it by function: function Resurrect takes unit u, real duration returns nothing, which means:
"call Resurrect (u, r)".

Duration or "r" represents the time, after which the unit is going to be resurrected.
It is MUI and revives the hero at the position they originally died.

JASS:
function fufu takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId (t)
    local unit u = LoadUnitHandle (udg_R_Hash, id, StringHash("hero"))
    local real x = LoadReal (udg_R_Hash, id, StringHash("x"))
    local real y = LoadReal (udg_R_Hash, id, StringHash("y"))
    call ReviveHero (u, x, y, false)
    call FlushChildHashtable (udg_R_Hash, id)
    call DestroyTimer (t)
    set t = null
    set u = null
endfunction

function Resurrect takes unit u, real duration returns nothing
    local timer t = CreateTimer()
    local integer id = GetHandleId (t)
    local real x = GetUnitX (u)
    local real y = GetUnitY (u)
    call SaveReal (udg_R_Hash, id, StringHash("x"), x)
    call SaveReal (udg_R_Hash, id, StringHash("y"), y)
    call SaveUnitHandle (udg_R_Hash, id, StringHash("hero"), u)
    call TimerStart (t, duration, false, function fufu)
    set t = null
    set u = null
endfunction

Test Map:
 

Attachments

  • Resurrection.w3x
    17.4 KB · Views: 55
Level 8
Joined
Feb 17, 2007
Messages
368
Ok so, how would I apply this to work with a specific spell? I was hoping that it would be GUI, not Jass since I don't really know to work with it too well =p So ok, let me say exactly what I want... What I really want is for a player to drop a corpse when the hero dies, and have the resurrection spell only be able to target corpses. I'm going to change the art duration time of the model to around 100 seconds at first, because thats how long I want the corpses to last. I want to be able to specify the radius area over the dead hero's corpse/body of how precise the spell needs to be targeted in order to resurrect the hero. It should be a 5 second channel, and when completed it will resurrect the hero at the precise spot where they died; in other words, where there corpse/body appears. How would this be done?
 
Level 5
Joined
Jan 4, 2007
Messages
103
Ok so, how would I apply this to work with a specific spell? I was hoping that it would be GUI, not Jass since I don't really know to work with it too well =p So ok, let me say exactly what I want... What I really want is for a player to drop a corpse when the hero dies, and have the resurrection spell only be able to target corpses. I'm going to change the art duration time of the model to around 100 seconds at first, because thats how long I want the corpses to last. I want to be able to specify the radius area over the dead hero's corpse/body of how precise the spell needs to be targeted in order to resurrect the hero. It should be a 5 second channel, and when completed it will resurrect the hero at the precise spot where they died; in other words, where there corpse/body appears. How would this be done?

You could use raise dead ability, set only hero targets and friendly and then when you cast it, remove the summoned unit, use Targeted Unit of Ability Being Cast to get the position, then an if-then-else if it's hero#1 then revive hero#1 at Postion of Targeted Unit of Ability Being Cast from your death trigger ect. Or you could use a spell that does noting expect the trigger. When a hero dies you put create a corpse on it's point and store the point of his death in a variable. Now when you use the spell if a corpse of one of the heroes is in lets say 1000 of you, set animation to channeling of casting unit, wait 5sec then the closest dead hero to you will revive at his death point. If there are no dead heroes near you then display a message no revivable heroes nearby ect. Maybe some more will help you. Hope it helps:)
 
Ok, I made it. Well, if you change the duration of the resurrection, make sure you also change the Follow through time of the Resurrection ability.
The trigger checks if the dummy corpse has an ability, which has the id of 'A000' in the map I made. If you transfer it to your map, press Ctrl + D to view the abilities as raw data. Memorize the raw id of your pasted "Detection ability" and replace it in the line: if GetUnitAbilityLevel (u, 'A000'), in the "fufu" function, located in the map's header.
 

Attachments

  • Resurrection [1].w3x
    19.4 KB · Views: 59
Level 8
Joined
Feb 17, 2007
Messages
368
Well basically a corpse is created for only 1 of the units who dies, and the other unit who dies doesn't get a corpse; it only plays the dummy units death animation, and you can actually see the animation occurring with the footman standing up then suddenly he disappears and you hear his death sound, leaving no corpse behind.
 
Level 8
Joined
Feb 17, 2007
Messages
368
Ah you seem to be right, my bad. I just checked and it's something in a spell I made which says to kill the last created unit after it's over; it's supposed to kill the dummy explosion model, but it kills 1 of the corpses created, haha. =P
 
Level 1
Joined
Sep 29, 2010
Messages
1
Wow thank you SOOOO MUCH! This works perfectly.... You're awesome, and thanks to everyone else for offering there help. +REP for everyone who helped. :)

Errr, 1 problem. When 2 units/heroes die at the same time it seems like the system messes up. Could this be fixed?
 
Status
Not open for further replies.
Top