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. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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.

Auto Casting Transformation

Discussion in 'Triggers & Scripts' started by Illidanthepredator, Jun 14, 2019.

  1. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    So I am making an anime themed map and am looking to how to make an ability that activates only when heroes life is low and significantly raises their attributes makes them levitate slightly and changes his color...
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • Events
      • Time - Every 0.50 seconds of game-time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GROUP_THAT_HAS_ALL_UNITS_WITH_THIS_ABILITY_IN_IT and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked Unit)
          • Set LifePct = (Percentage life of TempUnit)
          • Set BonusActive = ((Level of THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE) for TempUnit) greater than 0) //BonusActive is a boolean variable
          • If (All conditions are true) then do (Then actions) else do (Else actions)
            • If - Conditions
              • LifePct less than or equal to THRESHOLD_VALUE
              • BonusActive equal to false
            • Then - Actions
              • Unit - Add THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE to TempUnit
              • -------- set bonuses here --------
              • -------- you may need to store the amount of added stats in a variable so you can properly remove them later --------
            • Else - Actions
          • If (All conditions are true) then do (Then actions) else do (Else actions)
            • If - Conditions
              • LifePct greater than or equal to THRESHOLD_VALUE
              • BonusActive equal to true
            • Then - Actions
              • Unit - Remove THIS_ABILITY_GETS_ADDED_WHEN_THIS_IS_ACTIVE from TempUnit
              • -------- remove bonuses here --------
            • Else - Actions

    Add units to the group as necessary (when they learn the skill, enter the map, reach a certain level, whatever). If you DO need to store the added stats a MUI solution will require a unit indexer and some arrays or a hashtable for this information. Otherwise this method should work fine. Instead of adding the stats with a trigger you could even make an attribute bonus ability and add that with triggers as I did for the visual effect/flag ability above.
     
  3. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    What kind of variable is BonusActive?
     
  4. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    It literally says next to the line because I knew it was not going to be clear: //BonusActive is a boolean variable
     
  5. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    i have it as that...and i dont see anything about level of hero ability?
     
  6. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    It's an integer comparison.
     
  7. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    Oh well i dont have that option...do i really need it
     
  8. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    Nevermind I give up...i dont even know what ability to use to make the ability...im so bad at this...gonna take me forever to finish my project
     
  9. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    For fuck's sake dude you will never learn if you don't try. Think about what you are trying to do. Use your brain. Try something instead of giving up.

    The ability I said to add is just functioning as a flag. It doesn't DO anything, the unit just HAS it when the extra stats are active so that your trigger knows if its already added the stats to a unit or not. Without this ability you will have to use a hashtable or unit indexer + arrays as I said below. Base it on an item ability like claws of attack bonus and make not give any bonuses. Item abilities usually don't show up on the command card so you won't have to hide it. If you are going to use an attribute bonus ability to increase stats then you can just use (and check for) that ability instead and you don't have to have another invisible ability that does nothing.

    I looked and it turns out Blizzard is absolutely retarded and doesn't allow GUI to assign boolean variables to any of the comparison options that do exist in conditions. For some fucking reason nooooo it can't do that. You will have to do this instead:

    • Events
      • Time - Every 0.50 seconds of game-time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GROUP_THAT_HAS_ALL_UNITS_WITH_THIS_ABILITY_IN_IT and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked Unit)
          • Set LifePct = (Percentage life of TempUnit)
          • Set BonusLvl = ((Level of FLAG_ABILITY) for TempUnit)
          • If (All conditions are true) then do (Then actions) else do (Else actions)
            • If - Conditions
              • LifePct less than or equal to THRESHOLD_VALUE
              • BonusLvl equal to 0
            • Then - Actions
              • Unit - Add FLAG_ABILITY to TempUnit
              • -------- Change stats here if you are going to use a trigger, or instead of FLAG_ABILITY add the proper attribute bonus ability --------
              • -------- --------
              • -------- this is a trick to make it so you can set the fly height of ground units with a trigger --------
              • -------- it only has to be done once per unit and then you can set its height at will, which is why this part of the trigger ISN'T in the other if statement below this one --------
              • Unit - Add Crow Form (Medivh) to TempUnit
              • Unit - Remove Crow Form (Medivh) from TempUnit
              • Unit - Set TempUnit fly height to HEIGHT_YOU_WANT at RATE_YOU_WANT_IT_TO_CHANGE
              • -------- choose your new color here --------
              • Unit - Set TempUnit vertex color to RED %, GREEN %, BLUE % and 0% transparency
            • Else - Actions
          • If (All conditions are true) then do (Then actions) else do (Else actions)
            • If - Conditions
              • LifePct greater than or equal to THRESHOLD_VALUE
              • BonusLvl greater than 0
            • Then - Actions
              • Unit - Remove FLAG_ABILITY from TempUnit
              • -------- remove bonuses here if you used a trigger or instead of FLAG_ABILITY remove the proper attribute bonus ability --------
              • Unit - Set TempUnit fly height to ORIGNIAL_FLY_HEIGHT at RATE_YOU_WANT_IT_TO_CHANGE
              • Unit - Set TempUnit vertex color to 100%, 100%, 100% and 0% transparency
            • Else - Actions



    Another possible way to achieve the transformation is to make a second version of the unit in the object editor that has the fly height, color, and increased stats that you want. Then you can morph the hero into that alternate version by using the method in this tutorial: Hero passive transformation. You may actually find this to be easier than what I suggested, but it is possible (unlikely but possible) that it will muck with other spells you're using that add abilities to heroes.
     
  10. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    I dont know man...nothing ever seems to work right with me...i thinks it my editor
     
  11. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Alright then I hereby refuse to continue helping you if you're not going to acknowledge the detailed instructions and full and complete trigger with comments I posted for you above. Your editor is not bugged. It works logically, consistently and (for the most part) exactly as it describes it does. Blizzard has made many major improvements with the pending release of Reforged, so I suggest you make sure your editor is updated by connecting to Battle.net.
     
  12. Illidanthepredator

    Illidanthepredator

    Joined:
    Jun 9, 2019
    Messages:
    11
    Resources:
    0
    Resources:
    0
    I've done boths triggers still dont work..... its my editor..its outdated and I dont have battle.net