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

[Solved] Autocast problem!

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
I'm not sure why my unit can't autocast his ability!



  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 60.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok-1] to (Attacking unit)
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
          • Unit - Set mana of (Attacking unit) to 0.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Add Bloodlust [Gar'thok-2] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
              • Unit - Set mana of (Attacking unit) to 0.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 20.00
                • Then - Actions
                  • Unit - Add Bloodlust [Gar'thok-3] to (Attacking unit)
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                  • Unit - Set mana of (Attacking unit) to 0.00
                • Else - Actions
 
Level 12
Joined
Mar 13, 2020
Messages
421
Object Editor -> Units -> the Unit you want to Autocast -> the first thing you see you can set the autocast before you can add Hero Abilutys and Unit Ability’s you see something like Autocast there put in your spell...

and you can upload pictures directly here on hive on attach files you don’t need a thirdparty site to upload the pictures...

I attached a picture there I marked abilities active there put in the Autocast ability
(Sorry that I didn’t found a better picture on google xD because I’m on phone right now)
 

Attachments

  • 518DEA17-FEA8-4537-B8E3-EC9412250E3B.jpeg
    518DEA17-FEA8-4537-B8E3-EC9412250E3B.jpeg
    14.9 KB · Views: 24
Level 12
Joined
Mar 13, 2020
Messages
421
Right, but you cannot add more than one ability to that!
Also I want when my unit has low hp then he should cast his ability, not when he has full hp nor everytime!
So your point is not that he Autocast it.. you want it to cast it?
On himself when he reach a specific percentage of hp? Like in a Boss fight...?

second question you have in your trigger mana greater then 3 and set it to 0... what you wanna archive... the spell itself cost 20 mana... so what is the Point... if I can ask...

third thing I wanna tell you about cast point cast backswing of your unit
Art - cast point
Art - backswing
Are the animation (works like a casting time)
So he have time to play an animation before the spell works.. but you set the mana to 0 after the order what happens here is while he is in the animation cast time he get instant to 0 mana and has no mana to finish the spell... let’s say because a trigger is instantly behind the order...
You need a second trigger...
That works like
Event
A unit Finishes casting an ability
Condition
Ability being cast equal to Bloodlust
Action
Set mana to 0

why you need a second trigger so the mana to 0 set comes when he finish the spell not when he finish the order...
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Before making this thread I've read here Making any Spell Autocasting
Yes on himself. Also I am not able to select my unit because I gave control to my allies, so I want him to automatically use his ability when he reaches 60% of life (ability will increase when he loses more hp), it can be cast more than once in a round, depending on whether he is alive. And I think it does not matter because I have already set the mana on the unit. Thanks for the info🙂🙃.
 

Attachments

  • 1.jpg
    1.jpg
    24 KB · Views: 17
  • 2.jpg
    2.jpg
    8.4 KB · Views: 15
Level 12
Joined
Mar 13, 2020
Messages
421
Before making this thread I've read here Making any Spell Autocasting
Yes on himself. Also I am not able to select my unit because I gave control to my allies, so I want him to automatically use his ability when he reaches 60% of life (ability will increase when he loses more hp), it can be cast more than once in a round, depending on whether he is alive. And I think it does not matter because I have already set the mana on the unit. Thanks for the info🙂🙃.
so it works now?
 
Level 10
Joined
Jun 20, 2017
Messages
333
Got it, now another problem is when he cast the first spell, he cannot cast second/third spell. Let say cd of ability is 10 sec does it matter? can I force to remove the first one even if he casted! then give the second spell! for example he loses 40hp and he cast first spell and the spell has 10 sec cd, then if he immediately loses 60hp the first spell still there! because of that the second spell cannot be run!
  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 60.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok-1] to (Attacking unit)
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [Gar'thok-1] from (Attacking unit)
              • Unit - Add Bloodlust [Gar'thok-2] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 20.00
                • Then - Actions
                  • Unit - Remove Bloodlust [Gar'thok-2] from (Attacking unit)
                  • Unit - Add Bloodlust [Gar'thok-3] to (Attacking unit)
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions
  • Garthok Copy
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Bloodlust [Gar'thok-1]
          • (Ability being cast) Equal to Bloodlust [Gar'thok-2]
          • (Ability being cast) Equal to Bloodlust [Gar'thok-3]
    • Actions
      • Unit - Set mana of (Triggering unit) to 0.00
 
Level 12
Joined
Mar 13, 2020
Messages
421
Got it, now another problem is when he cast the first spell, he cannot cast second/third spell. Let say cd of ability is 10 sec does it matter? can I force to remove the first one even if he casted! then give the second spell! for example he loses 40hp and he cast first spell and the spell has 10 sec cd, then if he immediately loses 60hp the first spell still there! because of that the second spell cannot be run!
  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 60.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok-1] to (Attacking unit)
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [Gar'thok-1] from (Attacking unit)
              • Unit - Add Bloodlust [Gar'thok-2] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 20.00
                • Then - Actions
                  • Unit - Remove Bloodlust [Gar'thok-2] from (Attacking unit)
                  • Unit - Add Bloodlust [Gar'thok-3] to (Attacking unit)
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions
  • Garthok Copy
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Bloodlust [Gar'thok-1]
          • (Ability being cast) Equal to Bloodlust [Gar'thok-2]
          • (Ability being cast) Equal to Bloodlust [Gar'thok-3]
    • Actions
      • Unit - Set mana of (Triggering unit) to 0.00
Try it with 0 second Cooldown... if it works..
Ah wait so you use 3 different spells ye?
So the problem is you need to remove the first so you can cast the second.. let me explain it
Each of your 3 spells has the same order id (Bloodlust) and so it will only use evrytime the first...
What you need is to remove the first when he needs the second and remove the second when he need the third...
 
Level 10
Joined
Jun 20, 2017
Messages
333
Ok, so I edited one of the abilities, but it still uses the first level! no matter that he loses 80% of his hp or not!
  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 60.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
              • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 2
              • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 20.00
                • Then - Actions
                  • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
                  • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 3
                  • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions
  • Garthok Copy
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust [Gar'thok]
    • Actions
      • Unit - Set mana of (Triggering unit) to 0.00
 

Attachments

  • 1.jpg
    1.jpg
    64.2 KB · Views: 15
  • 2.jpg
    2.jpg
    66.2 KB · Views: 14
  • 3.jpg
    3.jpg
    48.5 KB · Views: 10
Level 12
Joined
Mar 13, 2020
Messages
421
Ok so you don’t use different spells Bloodlust.. just use diffrrnt levels..

do this
Just remove on 40 and 20 percentage:

Remove Bloodlust
And
Add Bloodlust

and try again...

Ok so you don’t use different spells Bloodlust.. just use diffrrnt levels..

do this
Just remove on 40 and 20 percentage:

Remove Bloodlust
And
Add Bloodlust

and try again...

i found the problem... Bro...
It’s wrong
The first should be
20%
40%
60%
You did
60%
40%
20%

the problem here is equal or less then 60%
Is 60% - 0% that overwrites both others... so the trigger will never do else...
 
Last edited by a moderator:
The order of the conditions means levels 2 & 3 are never reached.

Because when these are true:
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 40.00
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 20.00

This is also true:
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 60.00

So the first 'Else' only fires when the % is > 60.

You need to switch the positions of the actions and conditions for levels 1 and 3.


  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 20.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
          • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 3
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
              • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 2
              • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 60.00
                • Then - Actions
                  • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
                  • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 1
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions


Edit: Ah, @Pwnica beat me to it. :)
 
Level 12
Joined
Mar 13, 2020
Messages
421
The order of the conditions means levels 2 & 3 are never reached.

Because when these are true:
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 40.00
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 20.00

This is also true:
joinbottom.gif
if.gif
(Percentage life of (Attacking unit)) Less than or equal to 60.00

So the first 'Else' only fires when the % is > 60.

You need to switch the positions of the actions and conditions for levels 1 and 3.


  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 20.00
        • Then - Actions
          • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
          • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 3
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
              • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 2
              • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 60.00
                • Then - Actions
                  • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
                  • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 1
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions


Edit: Ah, @Pwnica beat me to it. :)

yeah I didn’t saw that on phone because I needed to hold my phone vertical to see the whole trigger :p
 
Level 10
Joined
Jun 20, 2017
Messages
333
I solved it with these, thank you guys.
  • Garthok
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Gar'thok
      • (Mana of (Attacking unit)) Greater than or equal to 3.00
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Attacking unit)) Less than or equal to 20.00
        • Then - Actions
          • Unit - Remove Bloodlust [2] buff from (Attacking unit)
          • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
          • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
          • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 3
          • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Attacking unit)) Less than or equal to 40.00
            • Then - Actions
              • Unit - Remove Bloodlust [1] buff from (Attacking unit)
              • Unit - Remove Bloodlust [Gar'thok] from (Attacking unit)
              • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
              • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 2
              • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Attacking unit)) Less than or equal to 60.00
                • Then - Actions
                  • Unit - Add Bloodlust [Gar'thok] to (Attacking unit)
                  • Unit - Set level of Bloodlust [Gar'thok] for (Attacking unit) to 1
                  • Unit - Order (Attacking unit) to Orc Shaman - Bloodlust (Attacking unit)
                • Else - Actions
  • Garthok2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust [Gar'thok]
    • Actions
      • Unit - Set mana of (Triggering unit) to 0.00
 
Status
Not open for further replies.
Top