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

Casting same ability on event of it's finishing

Status
Not open for further replies.
Level 3
Joined
Jul 15, 2014
Messages
39
I have channeling spell, that lasts for like 5 seconds.
When it finishes, i add an item to some unit, and order casting unit to cast it again. So item is added, but it wont make unit start casting spell again.
  • FactoryProduction1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to WorkSpell
    • Actions
      • Game - Display to (All players) the text: a goody has been p...
      • Hero - Create (02)Corn and give it to Factory 0013 <gen>
      • Set u = (Casting unit)
      • Unit - Order u to Stop
      • Unit - Order u to Special - Channel
It works if i add some small WAIT there. But i have read somewhere, that only complete losers use wait.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Nah, it's just that most people use waits incorrectly and that the disadvantages outweight the advantages most of the time, so it frowned upon using it.

Anyway, what will happen if you remove the Stop order? If unit finished casting an ability it should be the exact moment it stopped.
 
Level 3
Joined
Jul 15, 2014
Messages
39
Actually I added stop after some experiments, checked it again, doesn't work with or without.
Hmm, doesn't even work if i remove and add the ability to the unit.

I would really want to know if there's a way to do it without wait. Cause with just wait it doesn't work good. If i do 5 units, i can see that after several casts some of them stop to cast, until finally everyone stops casting at around 10 - 15 casts.
 
Level 3
Joined
Jul 15, 2014
Messages
39
mm, not sure if i understand ur question in its essence
Channel is a spell.
Data - Base Order ID of Channel spell is 'channel'. And it isnt marked with purple, meaning its default value.
U think changing it should help?
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
mm, not sure if i understand ur question in its essence
Channel is a spell.
Data - Base Order ID of Channel spell is 'channel'. And it isnt marked with purple, meaning its default value.
U think changing it should help?

It might. If you changed it you could issue the order to use the spell you use for the Base Order ID.

Let me know if that works because I'm curious.
 
Level 3
Joined
Jul 15, 2014
Messages
39
I changed order id on spell to absorb, and i call it with
  • Custom script: call IssueImmediateOrder(udg_u, "absorb")
well it doesn't work this way and how it runs is completely the same:
factory13 gets the item and i see "a goody has been p..." text, but unit doesn't cast again.

full trigger:
  • FactoryProduction1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to WorkSpell
    • Actions
      • Game - Display to (All players) the text: a goody has been p...
      • Hero - Create (02)Corn and give it to Factory 0013 <gen>
      • Set u = (Casting unit)
      • Custom script: call IssueImmediateOrder(udg_u, "absorb")
 
Level 3
Joined
Jul 15, 2014
Messages
39
Changing to triggering doesn't help.
I can say more, if i put something like
  • Unit - Move u instantly to tempPoint
before
  • Custom script: call IssueImmediateOrder(udg_u, "absorb")
unit is moved, so the unit on which it is ordered is correct
 
Level 3
Joined
Jul 15, 2014
Messages
39
nope, Unit stops casting an ability doesn't work, what happens is completely the same: artefact added, unit doesn't cast again
 
Level 3
Joined
Jul 15, 2014
Messages
39
Well it works with 0.00 wait.
I got why when i used wait earlier it didnt work any good when i did the spell on many units simultaneously, cause of that variable in bundle with long wait (0.1).
But...
Won't using triggering unit cause a leak every time the trigger is executed?
And using wait is wack...
 
Level 3
Joined
Jul 15, 2014
Messages
39
hmm, that makes things easier, what about casting unit, and other event response variables, is using any of them safe from leaks or just some?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I can't say all of them are (GUI woes), but casting unit and the other unit related event response things are, I think.
 
Status
Not open for further replies.
Top