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

Aura that spawns units from dead enemy

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I describe my auraproblem for you:

I have an aura on a friendly unit.
An enemy unit dies within the aura.
A friendly unit is instantly spawned from the location where the enemy unit dies.

How on earth do I do to make such aura?
 
Level 25
Joined
May 11, 2007
Messages
4,651
  • //Create a dummy aura//
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) has buff dummy aura) Equal to True
    • Actions
      • Set tempPoint1 = (Position of (Dying unit))
      • Unit - Create 1 Mr. Anticamper for (Owner of (Killing unit)) at tempPoint1 facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempPoint1 )
 
Level 5
Joined
May 12, 2008
Messages
77
  • Trigger
    • Ereignisse
      • Einheit - A unit Stirbt
    • Bedingungen
      • (Number of units in (Units within 800.00 of (Position of (Dying unit)) matching ((Level of Revive-Aura for (Matching unit)) Groesser als 0))) Größer gleich 1
    • Aktionen
      • Set Temp_Point = (Position of (Dying unit))
      • Einheit - Create 1 Soldat for (Owner of (Dying unit)) at Temp_Point facing Vorgabe für Gebaeude-Ausrichtung degrees
      • Custom script: call RemoveLocation (udg_Temp_Point)

Sorry, this is a little bit sth. like Deunglish but i cannot do it another way.
 
Level 3
Joined
Feb 4, 2008
Messages
20
Answered!!!

Here's a solution that I whipped out for your question.

1st:
Create a variable like this.

VARIABLES
Variable Name - Variable Type - Initial Value
UnitWithAuraSpawn - Unit - None

2nd: Create the Trigger.
  • Unit Spawn
    • Events
      • Unit - A unit Dies
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Unholy Aura
        • Then - Actions
          • Set UnitWithAuraSpawn = (Learning Hero)
        • Else - Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of UnitWithAuraSpawn)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • Unit - Create 1 Footman for (Owner of UnitWithAuraSpawn) at (Position of (Dying unit)) facing Default building facing degrees
            • Else - Actions

Notes:

1. I tested it's fine.
2. It has leaks go fix them if you want to.
3. Customization:
a. (Learned Hero Skill) Equal to Unholy Aura
- You can change the Unholy Aura to the skill you want the aura to be.

b. Unit Group - Pick every unit in (Units within 512.00 of (Position of UnitWithAuraSpawn)) and do (Actions)
- You should change the number 512.00 to the Area of Effect of Your Aura.

c. Unit - Create 1 Footman for (Owner of UnitWithAuraSpawn) at (Position of (Dying unit)) facing Default building facing degrees
- You definitely should change 1 Footman to the unit that will spawn when the unit dies.

4. You can add more to this like variables that determine Area of Effect or Number of Units spawn X Level of Ability. And so on.
5. This affects all dead ally and enemy units within range of the UnitWithAuraSpawn
6. This only works when a unit learns your Aura you can change it if you want.

^^:thumbs_up:
 
Last edited:
Level 10
Joined
Nov 5, 2008
Messages
536
Here's a solution that I whipped out for your question.

1st:
Create a variable like this.

VARIABLES
Variable Name - Variable Type - Initial Value
UnitWithAuraSpawn - Unit - None

2nd: Create the Trigger.
  • Unit Spawn
    • Events
      • Unit - A unit Dies
      • Unit - A unit Learns a skill
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned Hero Skill) Equal to Unholy Aura
        • Then - Actions
          • Set UnitWithAuraSpawn = (Learning Hero)
        • Else - Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of UnitWithAuraSpawn)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • Unit - Create 1 Footman for (Owner of UnitWithAuraSpawn) at (Position of (Dying unit)) facing Default building facing degrees
            • Else - Actions

Thanks for your trigger and your description! Just a question: The skill is not actually a hero skill. It is a building that has the aura and when a building is being constructed the aura appears before the building is finished. Is it possible to make the aura only work when the building is completed? By the way, how to I do with the Actions part since it is not a hero skill?

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Learned Hero Skill) Equal to Unholy Aura
      • Then - Actions
        • Set UnitWithAuraSpawn = (Learning Hero)
 
Level 3
Joined
Feb 4, 2008
Messages
20
Thanks for your trigger and your description! Just a question: The skill is not actually a hero skill. It is a building that has the aura and when a building is being constructed the aura appears before the building is finished. Is it possible to make the aura only work when the building is completed? By the way, how to I do with the Actions part since it is not a hero skill?

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Learned Hero Skill) Equal to Unholy Aura
      • Then - Actions
        • Set UnitWithAuraSpawn = (Learning Hero)

Here's another solution that I whipped out for your other question.
Let's just leave my post as a reference.

1st: Create the 1st Trigger.
  • UnitLearnsAbility
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Guard Tower
    • Actions
      • Unit - Add Unholy Aura to (Constructed structure)

2nd: Create the 2nd Trigger.
  • UnitSpawn
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Guard Tower) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (Player group((Owner of (Picked unit)))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Unholy Aura for (Picked unit)) Not equal to 0
                  • (Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00
                • Then - Actions
                  • Unit - Create 1 Footman for (Picked player) at (Position of (Dying unit)) facing Default building facing degrees
                • Else - Actions


Notes:

1. Changed it for tower.
2. It has leaks go fix them if you want to.
3. Customization:
a. Add Unholy Aura to (Constructed structure) and
(Level of Unholy Aura for (Picked unit)) Not equal to 0
- You can change the Unholy Aura to the skill you want the aura to be.

b. (Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00
- You should change the number 512.00 to the Area of Effect of Your Aura.

c. Unit - Create 1 Footman for (Picked player) at (Position of (Dying unit)) facing Default building facing degrees
- You definitely should change 1 Footman to the unit that will spawn when the unit dies.

d. (Unit-type of (Constructed structure)) Equal to Guard Tower and
Unit Group - Pick every unit in (Units of type Guard Tower) and do (Actions)

4. You can add more to this like variables that determine Area of Effect or Number of Units spawn X Level of Ability. And so on.
5. This affects all dead ally and enemy units within range of the Guard Tower you can change it but I prefer it this way.
6. This only works when a tower learns your Aura you can change it if you want.
7. You don't need any variables for this two triggers.
8. "I also want this for a tower!!! I am gonna put it to my map but please credit me and add reputation."
9. Woohh. This took time!!!
^^:thumbs_up:

Also that skill won't revive just creates another one. I mean if an archer dies with that effect, it revives as a footman :D

Umm he he he right but still look on my notes. You can change it manually and he said spawn not revive...
 
Level 10
Joined
Nov 5, 2008
Messages
536
  • UnitSpawn
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Guard Tower) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (Player group((Owner of (Picked unit)))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Unholy Aura for (Picked unit)) Not equal to 0
                  • (Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00
                • Then - Actions
                  • Unit - Create 1 Footman for (Picked player) at (Position of (Dying unit)) facing Default building facing degrees
                • Else - Actions



Below is how I have recreated the trigger in my editor. I just wonder where I find the "If" conditions in the triggereditor:

If - Conditions
(Level of Unholy Aura for (Picked unit)) Not equal to 0
(Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00 ?


  • Unit Spawns Aura
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Lore) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (Player group((Owner of (Picked unit)))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                  • Unit - Create 1 Footman for (Picked player) at (Position of (Dying unit)) facing Default building facing degrees
                • Else - Actions

Once again, thanks for your helpful trigger and description you have provided! Really helps a newcomer like me :)
Please note, I only want enemy units to be effected by the aura. So when an enemy unit dies it is replaced with a friendly unit.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
2 Ways.
Method one is every 0.1-1 second you check for dead units around the aura owner, and if they belonged to the enemy then make your unit.
Method 2 is to make the aura affect allies, then when a unit dies, check if the killing unit had the aura.

Both methods should be enabled only if the skill is learned to avoid unnescescary execution (when no one has the skill).
 
Level 10
Joined
Nov 5, 2008
Messages
536
I wonder what I choose in the list, like Ability Comparsion or Bolean Comparsion etc so I can create these fields:

  • If - Conditions
  • (Level of Unholy Aura for (Picked unit)) Not equal to 0
  • (Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00
Anyone knows?
 
Level 12
Joined
Mar 16, 2006
Messages
992
Event: A unit dies
Condition:
Action:
Pick all units within MAX_DISTANCE of (dying unit) and {
If (picked unit) "aura" level is greater than 0 {
If distance between (dying unit) and (picked unit) is less than or equal to MODIFIER*levelofability of "aura" for (picked unit) {
Then set point position of (dying unit)
create "friendly unit" at point
remove location point }}
 
Level 10
Joined
Nov 5, 2008
Messages
536
I got this great answear from mrvice2009. Many many thanks to him!

How to create these fields:

  • If - Conditions
  • (Level of Unholy Aura for (Picked unit)) Not equal to 0
  • (Distance between (Position of (Picked unit)) and (Position of (Dying unit))) Less than or equal to 512.00
1. After you create an action press "I" and you'll see the If-Then-Else Function.

2. Press Enter.

3. Then right-click If-Condition and press "New Condition".

4. You'll see the Boolean Function by default.

5. Look for Integer Comparison on the drop down menu.

6. Click the (Number of Units in (Units in Playable map area)).

7. Look for Unit - Level of Ability For Unit.

8. Click Ability.

9. And set it to the Aura you want.

For the other one.

1. Right click the If-Conditon.

2. Create a new conditon.

3. Look for Real Comparison.

4. Click (Life of (Triggering unit)).

5. Math - Distance Between Points.

6. Then edit to your liking.

If you want you can post this in your thread. So that you can [Solved] it.
__________________
Legerdemain
I give out well detailed answers so if it's right could you give me some + reputation?
Thanks and I just started posting so don't mind my join date.

Check out my sister's deviantarts. http://eizu.deviantart.com/
Their wonderful!
 
Status
Not open for further replies.
Top