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
 

Skippy

Active Member
Reaction score
39
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.
 

Ashlebede

New Member
Reaction score
43
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.
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Upon him beginning to channel, I'd add him to a group that periodically checks if its units have stopped channeling.

EDIT: Ninja'ed.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
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.
 

Ashlebede

New Member
Reaction score
43
@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
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
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.
 

tommerbob

Minecraft. :D
Reaction score
110
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.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
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.
 

Ashlebede

New Member
Reaction score
43
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

2D-Graphics enthusiast
Reaction score
1,463
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.
 

Ashlebede

New Member
Reaction score
43
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
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
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.
 

Ashlebede

New Member
Reaction score
43
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?
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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