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

Hero Revival Issues

Status
Not open for further replies.
Level 2
Joined
Aug 2, 2008
Messages
7
I'm having a couple of issues with my hero revival system.

1. I can't get my tavern to actually ~Revive~ heroes. No matter what I try, whenever the hero dies, he's gone for good. I want to use the ordinary ressurection method because I believe that's the only way to get it to display the gold cost and level of the hero in the tooltip while reviving. [Dota has this]

2. I would use a dummy ability for the job, but I've seen in other threads in this site that you can't call on a variable in a tooltip, which would be how I would display the gold cost and level of reviving the hero.

3. Is a dummy unit for the revival a good option? I figure it would have that annoying [1] at the bottom right hand corner that would degrade the look and feel of the map.

Thank you in advance.




Okay, I figured out the problem with #1, it was a trigger I made earlier in my map that I keep forgetting about.

  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Unit - Change ownership of (triggering unit) to Neutral Passive and Retain Color
Now I made this because I couldn't figure out how to make corpses not count as units in some other triggers I made to take over buildings

  • Events
    • Unit - A unit enters region <gen>
  • Conditions
    • (number of units in (Units in region <gen> owned by (Owner of building 0001 <gen>))) Equal to 1
  • Actions
    • Wait 20.00 seconds
    • If ((((Entering unit) belongs to an enemy of (Building 0001 <gen>)) Equal to True) and ((number of units in (Units in region <gen> owned by (owner of building 0001 <gen>))) Equal to 1)) then do (Unit - Change ownership of Building 0001 <gen> to (Owner of (Entering unit)) and change color) else do (do nothing)
I made this so that if the player owns only one building in the region and no other units, that the attacking player takes control of the building.

I could make it work without the neutral death trigger, if there was a Units in Region Owned by Player Matching Condition function, which I failed to find [if there is one].

So what I need to know, is...

1. How do I make the hero in the tavern be ressurectable by any player controlling the building or..
2. Add a Boolean Unit matching hero = false condition to the first trigger or...
3. Make corpses not count as units for the second trigger without taking away decay times, because I like bones and whatnot on the battlefield.

--------------------------------------

Ahhh! I was looking through gameplay Constants and found this...

Decay Time (sec) Bones - 88
Decay Time (sec) Hero dissipation - 3

Does this mean that after 3 secnods the hero counts as fully decayed and no longer a unit in a region? If so this would pretty much clear up everything.
 
Last edited:
Level 2
Joined
Aug 2, 2008
Messages
7
The coding works, but the change is not supposed to happen if the owner of the building has an allied unit in the area. This unfortunately includes spawns. If there's a way to code something like...

  • Actions
    • ((number of units in (Units in region <gen> owned by (owner of building 0001 <gen>) matching (matching unit is alive equal to true)) Equal to 1)) then do (Unit - Change ownership of Building 0001 <gen> to (Owner of (Entering unit)) and change color) else do (do nothing)
This would make it work perfectly. Unfortunately, I can't figure out how to do that one.
 
Last edited:
Status
Not open for further replies.
Top