channeling and triggered spell

Happy

Well-Known Member
Reaction score
71
hey guys....

ive got a question i cant figure out myself. i wanna make a spell that has channeling time. the longer the hero channels the more happens. but how can i detect whether the unit channels or not? and how can i detect WHEN the hero stopped channeling??

thanks in advance

greetz happy
 
I don't know if it is only way, but I do it like this:

Trigger:
  • Channel
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of (Your_caster)) Equal to (Order(channel))
        • Then - Actions
          • Caster is channeling, do whatever you want
        • Else - Actions
          • He stopped channeling

If you use blizzard, use (Current order of (Your_caster)) Equal to (Order(blizzard)) etc.
 
There are two options. The one Skippy showed works, and I used it many times, but won't work if the casting is interrupted by something else than orders (such as stuns or sleeps).

The other option, the one that detects that, is to create another trigger with no events. When your unit "starts channeling the ability", in the actions you add the event "(My unit) stops channeling an ability" to the second trigger.

And then you could, for instance, clear the unit's child hashtable and remove the unit from whatever unit group you needed for a periodic event... if there is one.
 
Upon him beginning to channel, I'd add him to a group that periodically checks if its units have stopped channeling.

EDIT: Ninja'ed.
 
There are two options. The one Skippy showed works, and I used it many times, but won't work if the casting is interrupted by something else than orders (such as stuns or sleeps).

The other option, the one that detects that, is to create another trigger with no events. When your unit "starts channeling the ability", in the actions you add the event "(My unit) stops channeling an ability" to the second trigger.

And then you could, for instance, clear the unit's child hashtable and remove the unit from whatever unit group you needed for a periodic event... if there is one.

the bold part is pretty bad, because if you do as ashblade said you would add new events with every time you cast that spell and that would end up with leaks and bugs most probably.

but just a generic "unit stops channeling" event for all units would do it also.

one trigger which runs a timer when a unit starts channeling, one trigger which stops a timer when the unit stops channeling. this way you get the time in which the unit is channeling.
 
@Accname

The two have a disadvantage... mine has to add an event to the trigger, which means it takes a little more time to execute the "Starts channeling an ability" part. However, yours would check if the unit is in a unit group every time a unit stops channeling an ability, which can happen often if there are many channeled spells. So no solution is perfect. u_u
 
no yours would add new events ever and ever again with every cast of the spell. (at least as how you said in the above post) this would end with a trigger firing numerous times when it should only once.
i guess you didnt meant it like that since you are an experienced member but as you said, adding new events with every cast, it would not just leak events but most probably it could end up bugging the game.
 
Just use a condition to check what spell is being cast. That way it doesn't run each time a spell is cast, but only the right spell. Unless I'm missing something obvious here, that would be a very simple solution.
 
look, ill demonstrate.

thats what ashblade wrote:
[...]
The other option, the one that detects that, is to create another trigger with no events. When your unit "starts channeling the ability", in the actions you add the event "(My unit) stops channeling an ability" to the second trigger.
[...]

thats what it would look like in GUI:
(This is a basic dummy ability which shall heal the caster when he ends channeling)
Trigger:
  • Start
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to HealChanneled
    • Actions
      • Trigger - Add to End <gen> the event (Unit - (Triggering unit) Stops casting an ability)

Trigger:
  • End
    • Events
    • Conditions
    • Actions
      • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing -50.00 damage of attack type Spells and damage type Normal


the first time this skill is cast it would work pretty well.
but the second time it would be cast there would be 2 events in the trigger since the first one would not have been removed cause thats impossible in GUI.
now every time you cast this spell the trigger would run more often and heal more hitpoints. == Bug. (and event leak by the way)

but as i said, in Jass you might make it better with this method but it would require you to have the said skills and knowledge and i doubt that because otherwise (no offense) you wouldnt ask for such a question.
 
Accname, of course, you have to remove the event after it happens. However, forgetful as I am, I would probably have forgotten to even add that in the trigger if I had to code it. :thup:
 
Accname, of course, you have to remove the event after it happens. However, forgetful as I am, I would probably have forgotten to even add that in the trigger if I had to code it. :thup:

you cant in GUI. and if the guy asking this question was a pro Jass scripter i doubt he would ask such a question.
 
Really, you can't ? o_O

But you can't remove locations in GUI, either, and people still do it with Custom Script. u_u
 
look, i think what you are missing is the fact that we are trying to help people here to make their own wc3 maps.

i know, a pro jass scripter could do all this stuff but people reading such threads looking for answers do not.
and i am not just talking about happy, maybe he does know it, but there are alot of other newbies out there who might read this. even more probably since we always say use the search function before creating your own threads.

now what you gave as an answer was just a piece of bullshit for a beginner. yes, it might work but not for them.
they would just create some GUI triggers and add some events, and test all that stuff and see it works. the first time.

but then ingame they will notice it doesnt and they wont know why, get frustrated, start new threads here and such.

your answer just wasnt any helpful. you didnt said he has to remove the event, you didnt said he has to use jass, you didnt gave him anything which would actually help him. please keep in mind the reason for us to write information on this forum is to help the newbies, not the pros, the people you are talking to are most probable (of course not all) beginners and dont know stuff leak event leaks or such. and sarcasm wont help them either here but just hijack this thread and make it into a piece of spam.
 
look, i think what you are missing is the fact that we are trying to help people here to make their own wc3 maps.

And you are missing the fact that I simply forgot to mention something. Really, you think I do it on purpose ?

Errare humanum est.

they would just create some GUI triggers and add some events, and test all that stuff and see it works. the first time.

It would still work, except it would make a lot of lag after a couple spell casts. But it would work.

and sarcasm wont help them either

What sarcasm?
 
you two need to stop post trollin'

happy I'd just do what skippy said.

the order unit takes while stunned is most certainly NOT a "spell channeled", it is "stand" as far as i remember, so i do believe, it should work
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top