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

[Trigger] How can I make Towers auto-cast

Status
Not open for further replies.
Level 3
Joined
Mar 19, 2009
Messages
41
SOLVED: How can I make Towers auto-cast

Problem Solved:
By adding a stop-function on-upgrade it fixed the issue where the towers would not cast-on-attack.




Original post:
I have attempted to use this tutorial with no success:
http://www.hiveworkshop.com/forums/f279/making-any-spell-autocasting-6255/


Given:
I have a tower with the chain lightning ability.
I want the tower to attack with chain lightning and not with its normal attack, unless a creep is magic immune.


Current Solution:
My current trigger allows this to happen but bugs out often and it requires activation (click-on-attack) on upgrade.
-- I find this to be unacceptable for release.



Current Trigger

Chain lightning

Events
Unit - A unit Is attacked

Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Attacking unit)) Equal to Chain Lightning Tower
(Unit-type of (Attacking unit)) Equal to Chain Lightning Tower 2
(Unit-type of (Attacking unit)) Equal to Chain Lightning Tower 3
Actions
Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning (Attacked unit)
 
Last edited:
Level 3
Joined
Mar 19, 2009
Messages
41
2 Solutions, Base it on an autocast spell that the AI autocasts and then trigger the effect.
Solution 2, you simply add the other tower upgrade types to your condition so it knows it is meant to cast when those towers attack.
Fairie Fire would only fire when the tower was being attacked... It work so long as that was happening...

I tried using searing arrow, but the trigger was not firing at all.



I edited the first point to clarify that the issue still exist with the upgraded towers on the script.
 
Level 5
Joined
May 17, 2007
Messages
106
So, once tower is upgraded it won't attack or sometime it stuck with casting (Chain Lightning is highlighted but won't use)?

For the first, what about adding Order Stop once upgraded.
Seconds, once it use chain lightning try to check it that next ~1 seconds, it is still casting or not.
 
Status
Not open for further replies.
Top