Disabled Abilities

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Is there a way to disable an ability, but make it show a disabled version of itself rather than none at all (a way other than disabling the ability and directly applying a dummy ability with the disabled icon...)?

-Thnx
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
You could do that, or if it is a Unit Ability, you can add a requirement.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
I did ask it in the Jass zone. And I expect a completely different type of answer there than I do here. Some people might have better ideas, but would never look in the Jass zone. Whilst others would simply know the right function call. Anyway, yeah, it was kinda an asshole thing for me to do... so... yeah. I swear I won't do it too often (unless I really care).
 

ayumilove

Youtube account suspended! youtube.com/ayumilove8
Reaction score
110
get 1 dummy to cast a spell "silent" on the unit/hero
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
893
> get 1 dummy to cast a spell "silent" on the unit/hero

That would disable all abilities, however....
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
...Yeah... but that kinda kills all the other spells...

I really don't want to have to make dummy abilities...

See... I want this to work for up to 4 abilities. Like, one is disabled while 3 aren't. Ya know.
 

esb

Because none of us are as cruel as all of us.
Reaction score
329
Is there a possible way (Probably Trigger) to set the cooldowns to never finish, only until you want them to be "Enabled" again?

Cooldown not finished = Disabled
Cooldown finished = Enabled
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Well... no. Afaik, there is no way to trigger anything to do with cooldowns...

Gah... I think I'm gonna fake it. If I make four dummy abilities that all look the same, and say "Ability is cooling down" (with a generic cooling down icon), then I can add and remove them at will in place of the cooling down abilities. The only problem then becomes dynamically determining an ability's cooldown (for the convenience of the user, of course). Currently my thoughts are:

JASS:
function IsAbilityUsable takes integer id returns boolean
    local unit dummy=CreateUnit(Player(0),blahbalhbalh)
    local unit freind=CreateUnit(Player(1),blahvalhvlag)
    local unit enemy=CreateUnit(Player(2)blahblahblah)
    local unit neutral=CreateUnit(Player(15),balhablah)
    local boolean a=false
    local boolean b=false
    local boolean c=false
    local boolean d=false
    local boolean e=false
    //Look it up in GameCAche to see if I stored it already.
    //If not, then:
    call UnitAddAbility(dummy,id)
    set a=UnitSpellTarget(dummy,friend,id)
    set b=UnitSpellTarget(dummy,enemy,id)
    set c=UnitSpellTarget(dummy,neutral,id)
    set d=UnitUseSpell(dummy,id)
    set e=UnitUseSpellPoint(dummy,point,id)
    //Save the boolean
    return a or b or c or d or e
    //Otherwise, just return the bool
endfunction

function GetSpellCooldown takes integer id returns real
    //Look it up in GameCAche. If already done, return that.
    //Else:
    if(IsAbilityUsable(id))then
        Set some boolean to false
        //Attach and Start a timer
        //In timer, set the boolean to true
        //Wait till bool is true
        //Get The time the timer ran for.
        //Store that
        //Return that
    endif
    //Store 0.
    return 0.
endfunction
 
S

Sketchie

Guest
Correct me if i'm wrong but...

You could disable an ability with requirements, like an upgrade, then use a trigger to set the level of the upgrade to enable/disable the ability. In my map I used:

Code:
Untitled Trigger 001
    Events
        Game - The in-game time of day becomes Equal to 18.00
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set the current research level of Night to 1 for (Picked player)

Code:
Events
        Game - The in-game time of day becomes Equal to 6.00
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set the current research level of Night to 0 for (Picked player)

Where "Night" is an upgrade, and the ability has "Night" as a techtree requirement

It might leak, but it works for me...

Edit: just put the second trigger in one of them boxes
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Correct me if i'm wrong but...

You could disable an ability with requirements, like an upgrade, then use a trigger to set the level of the upgrade to enable/disable the ability. In my map I used:

Code:
Untitled Trigger 001
    Events
        Game - The in-game time of day becomes Equal to 18.00
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set the current research level of Night to 1 for (Picked player)

Code:
Events
        Game - The in-game time of day becomes Equal to 6.00
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Set the current research level of Night to 0 for (Picked player)

Where "Night" is an upgrade, and the ability has "Night" as a techtree requirement

It might leak, but it works for me...

Edit: just put the second trigger in one of them boxes

Can't lower research that way (or any way for that matter?)


My suggestion would be making a dupe ability with a disabled icon and add/remove the abilities whenever needed...
Alternatively, you -could- make the abilities have a huge cooldown, but that might not fit in with what you had in mind and won't work on passive abilities :x

Alternatively alternativelish (cool word huh?), you could make a dummy locust unit named "Spell not available right now", and set it as a tech requirement for the ability. Then whenever you want the spell to be enabled, place one of them dummies on the map (invisible, no model, flying, locust, etc) and remove it when you want to re-disable the ability.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Is it possible to add requirements to abilities in-game? I mean... 680 abilities each, would mean 680 units... and... I don't really want that...
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
893
I think you can use units, upgrades, or other abilities. Upgrades are out since they can't be undone, though.
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Yes... but... Afaik, there isn't a native that adds a techtree requirement to an ability... And therefore, this would only work for one ability, unless I set up a method of attaching a unit to each ability, and then allowing/disallowing the ability when ever I say. However, if there is a native to add/remove techtree requirements to/from an ability, then I would be able to get by with only four units, which is doable for me.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
893
I don't think there's any way to add techtree requirements.
 

Omni

Ultra Cool Member
Reaction score
37
Just make a Disabled version of the ability,

and then, switch the abilities when needed
(remove {dis/en}abled, add {dis/en}abled)
whats the point?
:p

and why did you also post i in the jass zone -.-
everyone who enters the jass zone will probably also look in the WE Help zone-.-

ps. with disabled abilities i mean disabled by Techtree
 

Waaaaagh

I lost all my rep and my title being a jerk
Reaction score
70
Not to be rude Omni... but did you even read this thread?
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Not to be rude Omni... but did you even read this thread?

Seems to me he didn't, but he has a valid point though.

Either way, I don't think you can do this without putting in some effort, since you made a whole lot of abilities, you're either going to have to:

A) Create a disabled version of the abilities with a techtree requirement unit named "Spell not available", which never gets created/put on the map and then swap those skills back and forth.

B) Create a "Spell not available" dummy for -every- ability, add it to the ability's tech req and then create/remove the corresponding units on the map.


If you went into detail on how abilities are acquired, or how they are supposed to funciton on the map (when they disable/enable, how they are acquired, etc...) we might come up with another way, but with the information we currently have, this is all I can come up with.
 

J3LADE

New Member
Reaction score
7
Well what you could do is make another ability but set it's icon to the DIS (Disabled: should be in most icon sets) version and give it a tooltip stating what lvl is required to use it and make it do absolutely nothing but once the hero gets to the required lvl then remove that dummy ability and add the real one with the normal icon so it looks like you can use it.

Hope that helps :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top