1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Ability with charges

Discussion in 'World Editor Help Zone' started by Tutko, Sep 14, 2017.

  1. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Hi, I would like to create ability that has <x> charges, each charge has it's own cooldown, and after it charge regenerates back. (similar to ember spirit's ulti fire remnant from Dota).


    I want the charges cooldown to be seen on the spell icon, and while a charge is recharging and spell is cast I don't want it to reset the cd, but finish the one it had.

    Example of spell (ill use shockwave to make it simple):
    Shockwave has 3 charges:
    If i cast it once, has 2 charges left, and 3rd charge starts "charge cooldown". If I cast it again, it has 1 charge left, but gains 1 more as soon as "charge cooldown" ends, (then it has 2 charges again), and starts a new charge cooldown to regenerate the last charge... etc...

    If there are no charges left you can't cast shockwave.

    I've seen similar spells like this, but none of them had what I want, each lacked a part of my requirement.

    Can anyone help me ?

    P.S. here's the map that came closest to what I want, but it has 2 problems:
    1) charge cooldown resets if you recast the spell
    2) unit spots moving when a charge is recharged (i believe this is only the case if you spend more than 1 charge)
     

    Attached Files:

  2. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    In case you have only 2 of 3 charges, "charge cooldown" is running to get the third charge. In this case it is not possible to have the normal cooldown indicator, because as long as the normal cooldown indicator is active, you cannot cast the spell. The only exceptions I know are Immolation and Mana Shield, which can always be deactivated, because their cooldown only affects the activation.

    The reasons for the problems are:
    1) Unfortunately warcraft's UI is very limited in what you can change. If you use the spell, its cooldown will start and there is nothing you can do about it.
    2) Apparently using triggers to activate/deactivate mana shield or immolation causes the unit to stop, whereas if you as a player use such an ability, the unit will not interrupt its current action.
    You can deactivate immolation/mana shield by removing their buff without interrupting current actions. I don't think you can activate it without interrupting actions.

    You could try playing around with enabling/disabling abilities to "save" cooldowns.
    When your hero uses immolation, you disable it, enable a second immolation, use this as well, disable it and enable your first immolation again. Now you have two immolations running with the same cooldown. When the first one is deactivated, you do this disable/enable stuff again to hide your first abiltiy and replace it with your second ability. The second ability will have the cooldown of the first one, before deactivating it.

    I tried it and it should work. Take a look at the map to understand how to do this enable/disable thing.
     

    Attached Files:

  3. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    How would i implement all this with ability I wanna use? Lets say shockwave for example or carrion swarm
     
  4. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    It's difficult. I tried it today and not everything worked. Maybe I will give it a try some other day. It's to complicated to explain and I don't know how to exactly do it now.
     
  5. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Did you check the map I attached in my first post ? Could you maybe edit something there to make it work so the recharge cooldown doesn't restart itself ?
     
  6. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    I did take a look at the map. It's not that easy sadly. I still need to do the recharging thing. Using the ability already works quite nicely and the cooldown does not restart.
    I am afraid the stop problem can't be avoided. There is a possible solution for it, but it's entirely unrelated to this spell.
     
  7. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Well if you fix the cooldown part, I'll try and do the rest with an order that forces the unit to continue moving in a way it was before with another trigger
     
  8. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    Ok, so I managed to do a charged ability with charge cooldown indicator. Only problem apart from that stop order is, that in order to make that immolation thing work, the unit needs buffs. Which means, that for different numbers of charges a different number (0-2) of buffs is displayed in the unit's status bar. Sadly you cannot hide buffs.
    I guess you could make it, so that it has one buff per charge remaining, or make it, so that it has a constant number of two buffs and you write something general about that ability there: "This unit has Shockwave" for example.
     

    Attached Files:

  9. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Thanks, charges work like a charm!
    I know it's a lot of ask, but 1 more thing. How would I attach a spell (lets say shockwave) to work with it. I must be able to target a point with the spell same like shockwave can. I tried doing it but it doesn't work
     
  10. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    Impossible. Really. This system is based on immolation or mana shield being the only two abilities that can be "used" while on cooldown. They have no target point, so there is no way to make this ability work with a target point.
    You could make it so it is cast in the direction the unit faces, you will have to be creative. Just remember that immolation is the base spell and you can do with this charged ability, what you can do with immolation, so no target, no cast animation, no mana cost (yes, because in this system deactivating immolation is used as cast event and deactivating does not cost mana)
    Take a look at the triggers and look for game messages: use 3->2. Whenever use -> is displayed one charge is used.
     
  11. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Thanks. I guess i'll use this system then for abilities that don't need target. Edited fan of knives will be perfect! Gonna make it similar to skywrath's mage spell from dota (the one that auto aquires the target).

    Again ty so much, cheers! Would give you more rep, but there's a restriction

    EDIT: 1 more question. Can I still use immolation (neutral hostile) for other units? or will it interfere ?
     
  12. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    Yes you can use immolation for other units. I think you could even use it for the same unit, because the strongest immolation would be used I guess. Not sure about it though.
     
  13. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    I have a small problem that I dunno how to solve. When I cast the spell 2/3 times, when it's recharging it will automaticly cast the spell again even tho I didn't use it (probably because order trigger). Do you know how to solve that ?
    Here I attached the map so you can see what I'm talking about. Knight has the spell, but don't click on fan of knives, click on that scrolls.
     

    Attached Files:

  14. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    Fixed it. I added a cast event trigger, so you only have to do the cast actions once and don't have to deal with the system triggers.
     

    Attached Files:

  15. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Perfection! I guess the thread is solved :). Thank you for everything!
     
  16. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Hmm an issue occured I didn't think of before. When charges are just about to come off coldown and I use a channeling spell, as soon as the charge comes off cd, my spell gets interrupted. Is there any way to solve this ? This issue happens because hero is ordered to immolation.
     
  17. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    You could prevent the system from ordering using immolation, but that would break the system to some extent. You would no longer get charges while you are channeling.
    I would recommend not using channeling abilities for that unit, if possible.
    Another idea would be to trigger your channeling abilities, so you can decide whether they are interrupted or not.
     
  18. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    How would i make them interruptable ?
     
  19. Jampion

    Jampion

    JASS Reviewer

    Joined:
    Mar 25, 2016
    Messages:
    1,285
    Resources:
    0
    Resources:
    0
    check, if the unit is ordered to do something else (here you have to exclude the system's orders to use immolation), check for buffs (stun, silence, entagling roots, ...), check position. The unit can be moved by scroll of town portal, staffs and mass teleport for example.
    Then there are some spell specific reasons to interrupt. Life Drain: target dies, Mana drain: target runs out of mana, both drains + aerial shackles: target becomes invulnerable, target is staffed, target becomes spell immune, etc.
    It's probably more work to be worth it.
     
  20. Tutko

    Tutko

    Joined:
    Apr 28, 2017
    Messages:
    111
    Resources:
    0
    Resources:
    0
    Hmm could this spell be made with 3 channel spells, and using disabling/enabling abilities ? Or must it be immolation/mana shield ?