• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Passive Resurrection Aura/Spell

Status
Not open for further replies.

Deleted member 238589

D

Deleted member 238589

I need a spell that, after X seconds delay, brings nearby bring a unit that just died in a radius back to life with X% health. It needs to have a cooldown as well. I just need 1 level of this spell.
 

Deleted member 238589

D

Deleted member 238589

One player owned unit. Prioritize stronger (higher level or specific type, whatever's easier to create) ones if possible.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
I think I should be able to do this, but I'll need more details.

1) You want it to be passive and have a cooldown... So:

a) An activated ability with a cooldown that enables the aura that after X seconds resurrect all units that died?

b) The cooldown is on the unit-to-unit basis, i.e. once a unit is resurrected, it cannot be resurrected again for X duration?

c) The resurrect is run every X seconds?

2) Does the unit have to be in radius of the aura owner when it dies or when it is resurrected or both?

In other words, do you want the aura to resurrect:
1. All units that died within range.
2. All units that that that are in range when it's their time to be resurrected.
3. All units that died within range and are still in range when it's time to be resurrected.

3) And if you want to prioritize stronger units, do you have any specific cryteria you want to use to do the categorization? Because as far as I'm aware, there is no set list of units from the strongest to the weakest.
 
Last edited:

Deleted member 238589

D

Deleted member 238589

1. After it resurrects a friendly unit, it cannot resurrect any units for another X seconds (because of cooldown)
2. Option 3
3. If you could leave me to manually set those, that would be fine. If you can't do you need to know the unit level, unit type or what?
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
So, basically:

1. It's an aura.
2. Every X seconds it resurrects the strongest unit that died in range of the hero and is still in range when the resurrection happens.

Is that correct?

If so:

1. Do you want there to be an internal cooldown to it as well, i.e. if a unit eligible for resurrection isn't resurrected for X seconds, it will no longer be able to be resurrected?

2. I need to know how you want the unit strength to be determined :)

If you want it done based on the unit type, you will have to make a list and assign every single unit that can potentially be targeted by this spell to a variable.
Alternatively, I can have it just pick the unit with highest health, point value, supply used, etc.

3. How many units/heroes are going to have this ability?
 
Last edited:

Deleted member 238589

D

Deleted member 238589

1. Yes.
2. Yes.

1. No.
2. So if I want unit types, It'd need to assign every single existing unit, right? What's point value?
3. Just one.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Yes, you'd need to assign each unit type that you want to have priority in order of said priority.

It's a value that you can set in the object editor for each unit type individually - sort of like custom value.
Baseline, each unit has 100 point value. Using this option would require you to manually insert higher values for the units that want to have priority.

---

Anyway, I have an idea how to do this :) I'm 50-50% whether I will be able to do it, because you kinda shot my original idea out of the water with one of your answers :D

I'll experiment and see what I can come up with, but no promises :) I'll let you know what I got to by Monday. Meanwhile, try asking @KILLCIDE - maybe he will do it faster/better, but if possible - should he take up your request by the time I'm done, let me know :)
 
Last edited:

Deleted member 238589

D

Deleted member 238589

You implied I'd need to assign each individual unit for the unit type solution the first time. It's all the same either way. Both systems seem easy to edit.

Thanks. Feel free to ask me anything if you need any further details.

Oh btw
2. Every X seconds it resurrects the strongest unit that died in range of the hero and is still in range when the resurrection happens.

Does this imply this trigger would fire even if there aren't dead units and reset on its cooldown?
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Nope, I've meant that I would give you a "res_prioritylist" variable array and you'd have fill it with unit types - like this:

res_prioritylist[1] = Peasant
res_prioritylist[2] = Footman
res_prioritylist[3] = Priest
res_prioritylist[4] = Knight
etc

Then the trigger would go from the highest array number to the lowest, checking if there is an eligible unit of its type to be resurrected.

So, in the example above the trigger would first check array number 4, i.e. Knight unit type. If there was a Knight eligible for resurrection, it would pick the first one it had on the list and bring it back to life, if not it would proceed to array number 3 and thus check for Priests, etc.

This means that you'd have to assign every UNIT TYPE that the player can own (i.e. that can potentially be resurrected) to said variable, not each individual unit.

I've probably worded that in a bad way earlier, sorry :)

---

The original idea I had for this ability is to make a regular aura.

When a unit died with this aura's buff, a trigger would instantly create the same unit of the same type at the same location for a neutral player, instantly hide it and add it to a unit group. Then another trigger would periodically check all units inside that unit group, looking for a unit of an appropriate type in range to be resurrected. If it would a unit, it would change its owner to the player, remove it from the unit group and unhide it.

This however would likely create quite a lot of neutral units on the map, so you'd probably need an internal timer that would remove neutral units that weren't resurrected for a longer period of time to reduce the amount of units the trigger has to check. Since you don't want this, the number of hidden units would eventually get pretty high, so I resorted to doing things differently.

Right now I'm thinking about storing the position, unit type and unit facing of any unit that dies with the buff in a hashtable with a certain index, then another trigger would periodically search the hashtable for units eligible for resurrection and if it found one, it would clear the child keys of that's unit index and create a unit of that type at the stored point of its death for the player who has the aura.

I got it to properly save the unit data in the hashtable so far, right now I just need to figure out a way to write a proper "search engine" for it :) And that's a bit tricky for me, so I don't really know whether I will be able to do this.

---

And no, it wouldn't reset its cooldown.

The way I want to do this is have the search engine run once the first time a unit with the required buff dies, then have the actual search trigger on a loop, i.e. once it finishes searching, it will run itself again - if it resurrected a unit in the last cycle, it will simply wait a set duration (cooldown) before doing so, thus effectively giving the ability a cooldown, if not it would run itself again without delay, so there would also be no cooldown involved, bar the time the trigger would require to complete its full cycyle.

Still, it's quite a lot of operations the game would have to do constantly, especially once the number of units that died and thus had to be checked would grow pretty high, so I'm also not really sure whether this is the best way to do this.

Thus, I hope that once @KILLCIDE is online, he will at least share his opinion on my idea as I think he is generally more experienced and knowledgeable about making spells than I am :)
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
The idea is pretty simple. MasterBlaster has the right idea on how to make it. However, I think using the level of the unit would be easier given that there is a function that lets you find that out: GetUnitLevel(). I'm also not sure why you would create a hidden neutral unit. As far as I know, dead units still carry a lot of information about themselves until they are removed. I'll have to do some testing to figure it out though.

I can probably whip up something using that method to prioritize.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
@KILLCIDE - can I try first? :) It's actually a good opportunity for me to learn something and practice hashtables :)
Of course if the OP doesn't mind waiting a day :)

---

I know dead units still carry a lot of information, but I think that I've read somewhere that after some time after the decay ends, they are removed automatically and thus the information might be lost. And I... just didn't want to risk it :)

GetUnitLevel().
There is something like that in GUI as well :)
 

Deleted member 238589

D

Deleted member 238589

Well if the unit is removed from the game, you shouldn't be resurrecting them because... well their corpse isn't there anymore. I guess that all depends on how OP wants it to work.

I'd leave the corpses in the game so there a visual indicator where the unit will respawn.
 

Deleted member 238589

D

Deleted member 238589

After the corpse is gone, they should come back.
 
Last edited by a moderator:

Deleted member 238589

D

Deleted member 238589

Sorry, I was talking to someone while was answering you. What I wrote in second sentence stands.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Progress update.

I've got the aura triggers to work... well, somewhat work, since it's a bit buggy at the moment :)

Don't get me wrong, the general concept appears to be doing fine, but I'll need to do some testing to figure out what's causing the bugs. The problem is, my brain is a little fried after getting to where I am now, so I need a break.

@Imperator - are you fine with me giving me 1-2 more days to try to fix it or would you prefer someone else to do it? :)
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
What are the bugs? You can post the triggers and I'll have a look at the logic.
Let's make a deal - I'll try to fix them myself tomorrow evening and then I'll post it here anyway.
If I manage to fix the issues, you will be able to "review" my work, if not then I'll happily take you up on that help offer.

Deal? :)
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Haha, that sounded like you're a bit skeptical, chief :)

If so, I promise - I'm neither lying nor trying to screw the OP by having him wait, but... in reality, while I've been experimenting and doing a lot of things for my own project, which allowed me to learn quite a bit, this is the first request I've ever taken on the Hive, so... I'm really excited to either prove myself by completing it alone or at least push myself to the limits of my ability, so that even if my results aren't good, I'll get to learn something new once you review my work! :)

In that sense, I'm extremely grateful to both you and the OP for the opportunity to test myself. I'll tinker with my idea a bit more tomorrow and you have my word that I'll upload the map with whatever I get to :)

P.S. Yes, I know, I'm not quite right in the head, but I guess it's kinda expected from someone who aspires to be a psychiatrist :D
 

Deleted member 238589

D

Deleted member 238589

Just tried, it requires the latest version.
 

Deleted member 238589

D

Deleted member 238589

I don't have the original version. So there's no way to do this with the normal editor?
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
I went with a different approach and the spell appears to be working as intended.

I'll leave the file here, so that you guys can test it and @KILLCIDE can have a look at the triggering in case I've missed something.

When importing the spell:
1. Make sure you have the "Automatically create unknown variables when pasting trigger data" field checked in the editor properties.
2. Copy the buff and then the ability. Edit them to your heart's content. Make sure to replace the custom icons I've used in the spell map.
3. Copy the triggers in this order: Resurrection Aura Config -> Resurrection Aura Revive -> Resurrection Aura Death (the last one has to run the Resurrection Aura Revive).
4. Edit "User defined variables" and "User priority list" in the Config trigger to match your prefereces.

Notes:

- The spell is not MUI as the request didn't ask for it. It will only work for 1 unit and 1 level of ability as per request.

- You have to have every single UNIT TYPE (not actual units) that a player can own/resurrect assigned to a variable or else units of this type won't resurrect. If you want to, I can add an option to resurrect a random unit outside of the priority list, but I'll do it tomorrow.

- I reserve the right to use this spell in any of my projects :)
 

Attachments

  • Resurrection Aura v2.w3x
    40.9 KB · Views: 51
Last edited:

Deleted member 238589

D

Deleted member 238589

I tested it on your map and everything seems to be in order. Excellent work.
 
Status
Not open for further replies.
Top