• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Adding an additional effect to an on-hit ability

Status
Not open for further replies.
Level 7
Joined
Dec 14, 2012
Messages
192
[Solved]Adding an additional effect to an on-hit ability

Hey there~

Big Edit: I Solved the problems with your help and some thinking/testing of my little own. I also changed what the ability does, so dont be surprised ^^"

The ability I created(Petrifying Arrows) slows the enemy on hit and reduces their damage dealt.
The initial base-ability I used was cold arrows, but that did not work,b ecause it had no order string and adding new order strings was, for some reason, not accepted. So I just coded the slowing part per trigger into searing arrows, which is the new base ability - and that one works.
Things to Note:
- It is important(as it seems) to use an ability which already has an order string.
- I used, in the "Petrifying Arrows Unit Group"-Trigger the unit-type check, so it would not conflict with the normal Searing Arrows ability.
- I used multiple or-conditions in the "Petrifying Arrows Unit Group", because my unit has another on-hit ability, and setting that one to autocast also need to remove her from the unit group.
- Using the damage engine event(DamageEvent becomes equal to 1, I believe it was) has caused several bugs with my unit(For example: Triggering my triggers with other abilities that deal damage), so I'd refrain from using it.
Anyway, here is the trigger:

  • Petrifying Arrows Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PA_Ability = Petrifying Arrows
  • Petrifying Arrows Unit Group
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Medusa
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(flamingarrows))
        • Then - Actions
          • Unit Group - Add (Triggering unit) to PA_Group
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Issued order) Equal to (Order(unpoisonarrows))
                  • (Issued order) Equal to (Order(poisonarrows))
                  • (Issued order) Equal to (Order(poisonarrowstarg))
                  • (Issued order) Equal to (Order(unflamingarrows))
            • Then - Actions
              • Unit Group - Remove (Triggering unit) from PA_Group
            • Else - Actions
  • Added Effects Autocast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Medusa
      • ((Attacking unit) is in PA_Group) Equal to True
    • Actions
      • Unit - Create 1 Petrifying Arrows Dummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Unit - Set Level of Petrifying Arrows Damage Decrease for (Last created unit) to (Level of PA_Ability for (Attacking unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Attacked unit)
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 Petrifying Arrows Dummy II for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Unit - Set Level of Petrifying Arrows Slow for (Last created unit) to (Level of PA_Ability for (Attacking unit))
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
  • Added Effects Manual Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to PA_Ability
    • Actions
      • Unit - Create 1 Petrifying Arrows Dummy for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit - Set Level of Petrifying Arrows Damage Decrease for (Last created unit) to (Level of PA_Ability for (Triggering 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)
      • Unit - Create 1 Petrifying Arrows Dummy II for (Owner of (Triggering unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit - Set Level of Petrifying Arrows Slow for (Last created unit) to (Level of PA_Ability for (Triggering unit))
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
If anyone finds any mistake within these triggers, please tell me so I can correct them - though, it seems like they are working out perfectly fine.
 
Last edited:
Level 7
Joined
Dec 14, 2012
Messages
192
Make sure Animation - cast point is set to 0 for the unit. Check that the unit has the ability. The dummy should also be able to see the target. Try using a variable for target unit of ability being cast.
Is a variable absolutely necessary? I am not that good with them ^^" Could you show me how the trigger with the variable would look like?

I try the other things out right now. And the Animation - cast point should be set to 0 for the dummy unit, correct?
 
Level 7
Joined
Dec 14, 2012
Messages
192
Ah, I found out something annoying o_O
The trigger seems to not even start. Why? Because this ability is regulary auto-casted(As all on hit abilities usually are).
If I manually target the ability, the trigger works just fine....

Soooo~ How to solve this problem then o_O?
 
Level 7
Joined
Dec 14, 2012
Messages
192
Try this.
Well, thanks, that one works out~ However, I can'z say I quite understand this one ^^" I'll take a closer look and try to learn what I can...
Just one problem: The ability I use is based on Cold Arrows - which has no order string. Can I just add any order string to the ability to make it work, or do I have to take an on-hit ability, or a autocast ability? I can probably test that myself buut~ Id like to be clear on that one.
Also, an explanation of the custom scripts you used may be useful.
 
Level 7
Joined
Dec 14, 2012
Messages
192
Try this.
It seems like this Trigger does not work after all.
On one side, once the unit witht he ability gets attacked, the ability is turned to NOT autocast anymore. Pretty annoying.

On another side, the dispell does not work as it should. If I target the ability manually, the enemy is dispelled like thrice in a row. If the ability is autocasted, it works... sometimes. Kinda strange.
I have no idea how to fix these strange triggering mistakes, though >.<
 
Level 7
Joined
Dec 14, 2012
Messages
192
Try using it with an on-damage event instead of when its being cast.
Hmm... Problem is, the trigger would need to check, if the unit has attacked with the on-hit ability.

I think I'll try things out with "Issues an order with no target" event, then use order strings... Maybe I'll find a way to do it like that.
 
Level 7
Joined
Dec 14, 2012
Messages
192
Edited the topic with my new triggers, hoping to get some more information~
 
Level 7
Joined
Dec 14, 2012
Messages
192
I am very sorry for that, here's the fixed ones.

It has to do with the Damage Detection System, now, it's fixed.
Ah~ Should have mentioned that I solved that already ^^" So I am the one who is sorry... so Sorry ._.

Anyway, special announcement: I solved the remainder of the problem on my own, getting the ability to work and "unwork" as I want to~ I changed around the triggered effect, though, so don't be surprised ^^" Going to edit the topic now ^.^
 
Level 7
Joined
Dec 14, 2012
Messages
192
Instead of edit the topic, you could open a new thread - if the topic does not relate to this, at all.
Well, it does relate to it, you seem to have misunderstood me =P
I managed to create this on-hit ability and make it work. Tha is the innate topic =P
 
Status
Not open for further replies.
Top