Codeability of shared cooldown

Discussion in 'Programming' started by Domenico, Mar 17, 2012.

Thread Status:
Not open for further replies.
  1. Domenico

    Domenico Moderator

    Not sure if this is correct section to post this question, but well...

    Is there a way of making 2 abilities of a single unit/hero to share a cooldown? I mean, when casting one ability will cause both "CD-linked" abilities to go on CD for the time set (and go off CD simultaneously later).

    If it's possible, what are conditions for it?

    Should those abilities be related to each other in some way or maybe we can make totally different abilities to share a CD?

    Should those abilities have the same CD time?
  2. BooBoox3

    BooBoox3 Well-Known Member

    I don't know a thing about coding but I've seen skills in other maps with shared cooldown so I think it's possible. I can't think of a specific map though since it's been years since i've touched them.

    Also the fortification ability between the circles shares cd right? (haven't played dota1 in a while)
  3. SugaSutA

    SugaSutA Well-Known Member

    ^I believe the fortification part is true.

    Other than that, I honestly can't think of anything that works on the same line; not in DotA and not in any other game~
  4. Glowackos

    Glowackos Well-Known Member

    The only proper way of making skills go into cd is to cast them.

    Just make the skills dummy abilities (they themselves do nothing when cast, but then you have code that detects when they are cast and this code does everything you want). When one of the abilities is cast, immediately cast the other ability, using a bool to prevent the second ability's code from executing.

    Also, this belongs in the programming forum.

    e: fixed :p
    Last edited: Mar 20, 2012
  5. crinckle

    crinckle Well-Known Member

    Skills with same order id do not go into cd together. I have tried it, only one goes into cooldown at one time.
    So, the second method seems to be the only one, but I see some problems. First of all, the cast point of the unit should be 0, otherwise the player can cancel the ability from being cast (as well as stuns can). Also, it will cause problems if the unit gets silenced after casting first ability (eg. Silencer's aura).
  6. MauranKilom

    MauranKilom Well-Known Member

    If they share the same order id, your hero will try to cast all of them if you use any of them.

    Use something like windwalk as a base ability (so it can't be interrupted by pressing stop, will be cast instantly etc.). Although I'm not sure if it would work Last Word. That'd be fixed easily though.

    Also, for mana cost, just give the unit the needed mana to cast the second ability. Shouldn't be a problem.
  7. SoletLuna

    SoletLuna Moderator

    Moved to Programming.
  8. Unnamed_

    Unnamed_ Banned

    Disable the ability for the duration.

    If the abilities are to have different cooldowns, you need to specify the "disable" time for each ability cast.
  9. O_xD

    O_xD Well-Known Member

    Or use a dummy ability that gets "cast" and shown when the other gets into effect?
  10. Sly_theK1ng

    Sly_theK1ng Well-Known Member

    to run into cooldown - uncodable
    to disable for a period of time -codable (jsut like doom's first->it gets disabled when it is cast untill devoured unit is dead)
  11. WaremDarkslayer

    WaremDarkslayer Active Member

    To be exact, this is uncodable ONLY on JASS/vJASS.Generally, it is codable otherwise WoW wouldn't have it. :rolleyes1:
  12. MauranKilom

    MauranKilom Well-Known Member

    ^And how does that help? We don't want to code it in WoW, but in DotA/wc3.
  13. Sonic

    Sonic Well-Known Member

    No, it's not codeable
  14. Sly_theK1ng

    Sly_theK1ng Well-Known Member

Thread Status:
Not open for further replies.