1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Aura that spawns units from dead enemy

Discussion in 'World Editor Help Zone' started by Kabel, May 16, 2009.

  1. Kabel

    Kabel

    Joined:
    Nov 5, 2008
    Messages:
    535
    Resources:
    0
    Resources:
    0
    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?
     
  2. LordDz

    LordDz

    Joined:
    May 11, 2007
    Messages:
    4,305
    Resources:
    0
    Resources:
    0
    • //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 )
     
  3. alpha 100 f

    alpha 100 f

    Joined:
    May 12, 2008
    Messages:
    76
    Resources:
    0
    Resources:
    0
    You cannot check if a dead unit had a buff.
     
  4. Kercyn

    Kercyn

    Joined:
    Feb 14, 2009
    Messages:
    850
    Resources:
    0
    Resources:
    0
    Then you can check if the killing unit had the aura ability.
     
  5. alpha 100 f

    alpha 100 f

    Joined:
    May 12, 2008
    Messages:
    76
    Resources:
    0
    Resources:
    0
    • 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.
     
  6. AJalex

    AJalex

    Joined:
    Nov 13, 2006
    Messages:
    248
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Or you can check if the dying unit was in the range of the aura and assume it was affected by the aura...
     
  7. mrvice2009

    mrvice2009

    Joined:
    Feb 4, 2008
    Messages:
    19
    Resources:
    0
    Resources:
    0
    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: May 19, 2009
  8. Kabel

    Kabel

    Joined:
    Nov 5, 2008
    Messages:
    535
    Resources:
    0
    Resources:
    0
    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)
     
  9. Tharky

    Tharky

    Joined:
    May 3, 2009
    Messages:
    64
    Resources:
    0
    Resources:
    0
    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
     
  10. mrvice2009

    mrvice2009

    Joined:
    Feb 4, 2008
    Messages:
    19
    Resources:
    0
    Resources:
    0
    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:

    Umm he he he right but still look on my notes. You can change it manually and he said spawn not revive...
     
  11. Reaper2008

    Reaper2008

    Joined:
    Jul 27, 2008
    Messages:
    1,117
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Just replace that "Footman" with a (Unit-Type of (Dying Unit)), so that it creates a unit like the dying one.
     
  12. Kabel

    Kabel

    Joined:
    Nov 5, 2008
    Messages:
    535
    Resources:
    0
    Resources:
    0


    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: May 19, 2009
  13. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,815
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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).
     
  14. Reaper2008

    Reaper2008

    Joined:
    Jul 27, 2008
    Messages:
    1,117
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Right click If-Conditions. Events and Actions should be greyed out, choose add Condition. Else, create it underneath and drag it there.
     
  15. Kabel

    Kabel

    Joined:
    Nov 5, 2008
    Messages:
    535
    Resources:
    0
    Resources:
    0
    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?
     
  16. Vegavak

    Vegavak

    Joined:
    Mar 16, 2006
    Messages:
    1,010
    Resources:
    0
    Resources:
    0
    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 }}
     
  17. Kabel

    Kabel

    Joined:
    Nov 5, 2008
    Messages:
    535
    Resources:
    0
    Resources:
    0
    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