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

Resurrecting Heroes

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Hello! I've got a problem with the trigger line
  • Hero - Instantly revive Unit_Founder[(Player number of (Owner of (Picked unit)))] at Point_Temp, Show revival graphics
Under here is the entire trigger that runs, it's pretty self explanatory. When a hero dies, a "burial site" is created at the graveyard (a Ward), when this ability is cast on a burial site, this is what happens. (all dead heroes get resurrected). Now the problem is that this only works one time! The first time this is used, everything is fine, but if the hero dies a second time, and this resurrection is attempted again, all the actions run, except for the hero resurrection! Does anyone know of this problem, or a way to fix it? Thanks in advance!

(P.S. I'm aware of the fact that this is GUI and thus sucks (leaks), but my JASS skills are yet insufficient.)

  • Unit Finish Casting
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Resurrection
    • Actions
      • Set Int_Temp = 0
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Burial Site)) and do (Actions)
        • Loop - Actions
          • Set Boo_Founderdead[(Player number of (Owner of (Picked unit)))] = False
          • Set Point_Temp = (Position of (Picked unit))
          • Hero - Instantly revive Unit_Founder[(Player number of (Owner of (Picked unit)))] at Point_Temp, Show revival graphics
          • Set Unit_Founder[(Player number of (Owner of (Picked unit)))] = (Last created unit)
          • Game - Display to (All players) for 5.00 seconds the text: ((Name of (Owner of (Picked unit))) + has been ressurrected!)
          • Cinematic - Ping minimap for (All players) at Point_Temp for 3.00 seconds
          • Unit - Remove Unit_Burialsite[(Player number of (Owner of (Picked unit)))] from the game
          • Set Int_Temp = (Int_Temp + 1)
      • Player - Add (Int_Temp x 50) to (Owner of (Casting unit)) Current gold
      • Game - Display to (All players) for 5.00 seconds the text: ((Name of (Owner of (Casting unit))) + ( received + ((String((Int_Temp x 50))) + gold for ressurrecting his allies!)))
      • Unit - Kill (Casting unit)
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
Hmm...Well I can't really see the problem at this moment(I'll test it now though), but just a comment: Why do you set Int_Temp to 0 at the begining? You will always get the Int_Temp to be equal to 1 if you do so there is no real point in adding the player - add(int_temp x 50) gold. This probably isn't the problem, just wanted to let you know about that.

Will reply if I find the real problem.

EDIT: Was just about to test this, but there is no point since the problem is solved :)
 
Last edited:
Level 7
Joined
Mar 16, 2008
Messages
348
Your map is bugged, the map i'm working on is bugged too and i couldn't use that action no matter what, i had to make a really complex trigger in jass to go around it, i just hope your problem is not the same as mine.
Edit:Looked at it for 2 seconds and found a problem -.- you set the Unit_Founder variable to the last created unit, but Hero - Revive does NOT create a unit so of course Unit_Founder is set to null and the next time the action is run Hero - Revive action tries to revive the unit null and of course does nothing , just erase the line:
Set Unit_Founder[(Player number of (Owner of (Picked unit)))] = (Last created unit)
And the trigger should work.
 
Level 9
Joined
Sep 8, 2004
Messages
633
Lol! I can't believe I was stupid enough to overlook that! Ofcourse.. the unit used to be a regular unit, which I just created from scratch. Now, it's a hero. You're right, thanks!

Also, I set Int_Temp to 0 because it can be more than 1, it sets it to +1 for each "Burial site" picked. If more than one player is dead, then int temp > 1. Which would mean that the resurrecting player will receive 50g per player he helps. Isn't that kind? Thanks a bunch!
 
Level 7
Joined
Mar 16, 2008
Messages
348
Lol glad i helped, if it still has bugs , i'll try to resolve it.
Edit: i just noticed you don't remove the leak, you should fix that.
edit2: Oh i see you don't know jass, i do not have WE here at the moment but i believe it's something like this:
Custom Script: call RemoveLocation(udg_Point_Temp)
 
Level 9
Joined
Sep 8, 2004
Messages
633
Oh, yeah, but that's not a big issue, because I just re-use that global over and over. I use it for several triggers. So it's being redefined throughout the map, doesn't that automatically remove the leak as well?
 
Status
Not open for further replies.
Top