1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Spell] Double spell

Discussion in 'World Editor Help Zone' started by Daliox1, Sep 10, 2020.

  1. Daliox1

    Daliox1

    Joined:
    Sep 3, 2020
    Messages:
    129
    Resources:
    0
    Resources:
    0
    Hello,

    First of all, forgive me for my kinda basic english.
    I'm not using Triggers at all, in case that I would try to use as much as I can the already made spells for my map (I don't need big effect on my spells, so, plus, I don't understand anything about triggers even after trying 2-3 times to learn :( ).

    Here is my problem. I would like to use 2 times the custom spell "inner fire", one that will give damages and other one that will give armor (2 differents blessing). Other spells that decreases armor and where I should use negative value are already taken (or attack). Thing is, if I make those 2 custom spells, then I'm adding them to my unit/hero, when he'll cast the second spell, it'll launch the first one instead of the second. Any way to modify this without triggers ? :)

    Thanks to any answer :)
     
  2. HerlySQR

    HerlySQR

    Joined:
    Jun 26, 2020
    Messages:
    702
    Resources:
    0
    Resources:
    0
    I don't know if this is already solved in recent versions (maybe changing the ID), but no, you can't create more than 1 spells based in the same ability to the same unit, because what you mentioned happens, you have to create one of that abilities based in another ability.
     
  3. Daliox1

    Daliox1

    Joined:
    Sep 3, 2020
    Messages:
    129
    Resources:
    0
    Resources:
    0
    Okidoki :) Thanks for the answer sir, I do appreciate o/ Will try to find some solutions with this :)
     
  4. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    365
    Resources:
    0
    Resources:
    0
    There are lots of basic tutorials here at the hiveworkshop. Triggers are your friends, the object editor only gets you to a certain point.
     
    Last edited: Sep 11, 2020
  5. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,471
    Resources:
    0
    Resources:
    0
    This is very easy to do with basic triggers and a Dummy unit.

    Inner Fire that adds armor:
    • Cast Inner Fire Armor
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Inner Fire Armor (Hero)
      • Actions
        • Set VariableSet TempPoint = (Position of (Target unit of ability being cast))
        • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
        • Unit - Add Inner Fire Armor (Dummy) to (Last created unit)
        • Unit - Order (Last created unit) to Human Priest - Inner Fire (Target unit of ability being cast)
        • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation (udg_TempPoint)

    Inner Fire that adds damage:
    • Cast Inner Fire Damage
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Inner Fire Damage (Hero)
      • Actions
        • Set VariableSet TempPoint = (Position of (Target unit of ability being cast))
        • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
        • Unit - Add Inner Fire Damage (Dummy) to (Last created unit)
        • Unit - Order (Last created unit) to Human Priest - Inner Fire (Target unit of ability being cast)
        • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Custom script: call RemoveLocation (udg_TempPoint)

    So the Hero uses the (Hero) version of Inner Fire. This ability is based on Channel and has no effects besides running the trigger associated with it. It's also used for the Icon, Tooltip, Cooldown, etc... Channel is a fully customizable ability that has many more options than your standard ability. A unit can have as many of these abilities as you want as long as they have different Base Order Ids, which you can adjust yourself.

    Then you have the actual Inner Fire abilities. These are based on Inner Fire and have the armor/damage bonus effects. These abilities are going to be cast by our Dummy unit.

    So what's going on:
    -The Hero casts Inner Fire Armor on a target unit.
    -The Cast Inner Fire Armor trigger runs.
    -This trigger creates a Dummy unit, which is an invisible and uncommandable (outside of triggers) unit that's used to cast spells and do other neat things.
    -We add the associated Inner Fire ability to the Dummy unit.
    -We order the Dummy unit to cast this newly added ability on our target.
    -We add an expiration timer to our Dummy unit, causing it to be removed after 0.50 seconds. We don't need to keep the Dummy unit around after we're done with it.

    TempPoint is a Point variable that is used to clean up a memory leak. This helps with game performance. Read more about leaks with the link in my signature "Things that Leak".
     

    Attached Files:

    Last edited: Sep 11, 2020
  6. HerlySQR

    HerlySQR

    Joined:
    Jun 26, 2020
    Messages:
    702
    Resources:
    0
    Resources:
    0
    Triggering Player? Was not "Owner of Triggering unit"?
     
  7. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,471
    Resources:
    0
    Resources:
    0
    Triggering Player IS the owner of triggering unit.

    Often times Triggering Player is set to the owner of the unit referenced in the Unit Event.
     
  8. HerlySQR

    HerlySQR

    Joined:
    Jun 26, 2020
    Messages:
    702
    Resources:
    0
    Resources:
    0
    That works too?, Because the unit can cast an spell without the owner issues that.
    Hmm, I didn't notice that.
     
  9. Daliox1

    Daliox1

    Joined:
    Sep 3, 2020
    Messages:
    129
    Resources:
    0
    Resources:
    0
    Thanks a lot to all of you guys, Im gonna use all you said to me and try to learn some basics triggers then :) Thanks thanks!