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
889
> 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
889
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
889
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.
  • 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