• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Auto Casting Transformation

Status
Not open for further replies.
Level 2
Joined
Jun 9, 2019
Messages
15
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...
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
  • 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.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
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.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
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.
 
Status
Not open for further replies.
Top