• 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.

Autocast again...

Status
Not open for further replies.
Level 3
Joined
May 12, 2006
Messages
31
Hy there guys!

I've been reading some threads about autocasting, but didn't get any real help from them.

i checked this:
http://www.hiveworkshop.com/forums/showthread.php?t=6255

But the informations there are false.
Those dumy 1,2,3 spells only triggers, when the player clicks on the spell and uses is. When it is 'autocasting' the spell, it won't trigger. The bonuse example can't be used in a 'normal' map, because it does not check anything about attacking.

Do you know, any good method, to check autocasting?

I will put some code here, when i polished, extended it.

I can 'catch' the spell, when it is normally casted, or when it is turned on/off.

Any help will be appreciated.
 
Level 3
Joined
May 12, 2006
Messages
31
I think yes.
But now I include my script for this:

-------------

Check on:
Event: A unit is issued with no targer
Condition: Issued order equal to order(flamingarrows) // this is optional of course
Action: Unit - set the custom value of triggerint unit to 1

Check off:
Event: A unit is issued with no targer
Condition: Issued order equal to order(unflamingarrows) // this is optional of course
Action: Unit - set the custom value of triggerint unit to 0

Check attack:
Event: A unit is attacked
Condition: Custom falue of attacking unit equal to 1
Action: if
conditions : mana of attacking unit ...
// mana req condition is essential, but many others can be added.
like spell immunity check friendly-fire check ...
then:
go ahead with your wanted effect
else:
do nothing

Check manual spelling:
Event: ... begins casting an ability
Condition: ability being cast equal to "spell"
Action: run the wanted spell effect

-------------

What do you say for it? I think this method is very usfeul because it's not binded to exact units, and can be easily added more autocasting skills.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
only thing i can tell you is to make a spell autocast use the following:
  • Autocast
  • Events
    • A unit is attacked
  • Conditions
    • (Attacking unit) equal to *your casting unit*
  • Actions
    • Set temppoint1= position of (attacked unit)
    • Unit - Order *your unit* to [spell] temppoint1
    • Custom script: call RemoveLocation(udg_temppoint1)
After, set the mana usage in the object to your wanted value and adjust the string (Use/Enable *i think*) to the same string you have set as the [spell]s string.
As long as the string names are equal the cast should be automatic.
And be sure to set the attacking range to a the same range as you want for the spell and the damage done by that attack to a very low value.

For my map it works great ^^
 
Level 3
Joined
May 12, 2006
Messages
31
hmm thanks hawk9000.
My script for autocastr works very vell.. the conditions must be set well, and everything goes in the right way.; mana check, unit-type check, ally unit check, spelll immunity check and so on..
by the way. i am happy about that custom script, 'cause , idont know anything about leaks, or jass, but I know, i have to optimise many thing about triggers, to not leak....

AND by the way.. "unit is attacked" is not the best to detect autocast-detect, because, it can occur unwanted events ; when you order a unit to go, when it is just attacked a unit, the trigger occures, but it won't attack the unit really... just the trigger runs... But that's not a point usually with a melee attacking unit...
 
Status
Not open for further replies.
Top