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

How to make a passive damage ability (spiked carapace) have an animation?

Status
Not open for further replies.
Level 2
Joined
Sep 27, 2020
Messages
6
I don't know if that ability base is the best one to do this. bare in mind I'm pretty fresh and green with the editor so this is probably relatively easy but I'm not able to figure it out.
I just want spiked carapace to do 2 damage to attackers, no percentages (this part I figured out).
BUT, I also want there to be a green acid blob animation over the unit with the aura when he is attacked. (I named this ability "acid blood") So, it should essentially look like when he gets hit acid blood sprays out and that's what hurts the attacker.

any recommendations?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
I'd say that in this case since it's purely visual you can go with the "A unit is attacked" Event.

  • Events:
  • Unit - A unit is attacked
  • Conditions:
  • (Level of Acid Blood for (Attacked unit)) Greater than 0
  • Actions:
  • Special Effect - Create a special effect attached to the chest of (Attacked unit) using AcidBloodModel
  • Special Effect - Destroy (Last Created Special Effect)
This trigger will create a special effect attached to the chest of your attacked unit. You can choose from a bunch of different attachment points, though some Unit models might not support all of them.
Examples: origin, chest, head, overhead, weapon, hand,left, hand,right.

Note that Destroying the Special Effect immediately may or may not allow it to play it's full animation before getting removed. It all depends on the Special Effect's animations.

And the reason it's important to destroy Special Effects after creating them is because even if their animation is finished and they're no longer visible to the naked eye, they still technically exist. And existing for no good reason is a bad thing, since it takes up precious memory and hurts game performance.

With that in mind, I attached a map with a system that you can use for controlling the duration of your Special Effects. It allows you to set the duration of your Special Effect so that it is destroyed afterwards.

And to reiterate, some Special Effects won't play their animations when immediately destroyed, so if you're scratching your head as to why your Special Effect didn't appear it may have been because you're destroying it before it gets a chance to play it's animation. That being said, this is the perfect scenario to use the system I just mentioned, since you can delay it's destruction to AFTER it's finished playing it's animation.
 

Attachments

  • Delayed Destroy Effect.w3m
    17.3 KB · Views: 22
Last edited:
Level 2
Joined
Sep 27, 2020
Messages
6
As for above, I would be very interested in this damage engine, but at the same time It probably would go completely over my head. Is this something that mods the editor itself or is it like a chunk/block of script to insert in the editor? Like I said I'm super fresh on the editor, it took me a solid 2 hours just to figure out how to do the 2 damage back to attackers, and even then I settled on "on attack" over "takes damage" like how I wanted it, because I simply couldn't figure out the latter and was getting way too frustrated and hung up on the one trigger lol..

Also uncle thank you for the example trigger, I'm going to test this out in a bit.
 
  • Acid Blood
    • Events
      • Game - Value of DamageEvent becomes Less than 1
    • Conditions
      • (Level of Acid Blood for DamageEventTarget) Greater than 0
      • DamageEventDamageT Equal to DAMAGE_TYPE_DEFENSIVE
    • Actions:
      • Special Effect - Create a special effect attached to the chest of (Attacked unit) using AcidBloodModel
      • Special Effect - Destroy (Last Created Special Effect)
I have documented the steps on installing Damage Engine, but it's not much you need so you just copy the Damage Engine category from my demo map and paste the category into your own. You need to make sure "automatically create unknown variables" is checked in your World editor preferences.
 
Is this something that mods the editor itself or is it like a chunk/block of script to insert in the editor?

It's a few scripts in a folder that you copy-paste from the "sample map" to your map and then it's done! If you run the latest version of Warcraft 3 it's really that simple!
Then you can do the trigger that @Bribe just posted.
 
Level 2
Joined
Sep 27, 2020
Messages
6
I don't understand when people say using JASS or GUI. I'm just using the normal reforged editor that I launch from the blizzard launcher screen... is this JASS?
confused on how to install this, I don't want to mess my game/editor up.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
I don't understand when people say using JASS or GUI. I'm just using the normal reforged editor that I launch from the blizzard launcher screen... is this JASS?
confused on how to install this, I don't want to mess my game/editor up.
JASS is the programming language used by the Warcraft 3 engine.

GUI, also known as Graphical User Interface, is a way for you to code in JASS with easy to use buttons/categories/hints/etc.
In other words, GUI is the basic Trigger Editor that uses Events/Conditions/Actions.

So in your case you're creating triggers in GUI.

Here is a normal trigger made in GUI:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Create starting units (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Melee Game - Enforce victory/defeat conditions (for all players)
And here is that trigger converted to JASS (I left out some code to keep it simple):
vJASS:
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction
You can see how the JASS is a bit harder to understand where as the GUI is very self-explanatory. That's why GUI is great, it helps make code readable and easy to use.

----

And speaking on "installing" triggers. I guess you technically do install these things, but that makes it sound more complex than it really is. The "systems", "engines", whatever name the creator has given their projects, are simply a Trigger or set of Triggers, sometimes made in GUI, but more often made in JASS.

All you have to do to "install" these is copy and paste the Triggers into your own map and follow the instructions if any are provided. You can usually find instructions on the Hiveworkshop page for the system or as comments written by the creator in the Triggers themselves. Luckily, a lot of the useful systems on here are still kept up to date and the creators are more than happy to help you out.
 
Last edited:
Status
Not open for further replies.
Top