if ability is ultimate?

XeNiM666

I lurk for pizza
Reaction score
138
well simple question...
how would i know/set if an ability is an ultimate? :)
 

Ayanami

칼리
Reaction score
288
Hmm, how about storing the ability in a variable array, and looping through the variables to check if it's an ultimate :p Could be inefficient though.

Or maybe, you could store a boolean in a hashtable with the parent key set as the ability raw code.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
If it is a hero spell and its minimum required level is higher than 1, WC3 considers it an "ultimate", with a few exceptions (eg. Phoenix Fire).
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
If it is a hero spell and its minimum required level is higher than 1, WC3 considers it an "ultimate", with a few exceptions (eg. Phoenix Fire).

Is Phoenix Fire an ultimate? It's not even a hero ability.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Is Phoenix Fire an ultimate? It's not even a hero ability.
No. What I mean is that even if you edit its settings to fit the profile of an "ultimate", it still won't target spell immune units even if the gameplay constants are set to allow ultimates to do so.
 

luorax

Invasion in Duskwood
Reaction score
67
Well, with a simple JASS function and a custom script we can do it:

1, You'll have to add some simple letters to your ulti's end: " (U)" (e.g. "Avatar" >> "Avatar (U)")
2, Copy my function to your map's header
3, To test whether an ability is ulti or not, just call that function.

Function:
JASS:
function IsAbilityUltimate takes integer id returns boolean
    local string s = GetObjectName(id)
    return SubString(s, StringLength(s)-4, StringLength(s)) == " (U)"
endfunction


Usage:

JASS:
if IsAbilityUltimate('A006') then
        call BJDebugMsg("ULTI")
    else
        call BJDebugMsg("NOT ULTI")
    endif


Hope I helped you :D

Note that you have to rename the function not the tooltip. The name is invisible for the players, so we can do with it whatever we would like to.
 

DioD

New Member
Reaction score
57
not really smart way to change name of every skill, when you simply can make database with skills you need.
 

luorax

Invasion in Duskwood
Reaction score
67
Yes, but takes about 2 mins to edit them, and will work faster in-game.
 

meOme

New Member
Reaction score
31
I would do it like this:
JASS:
function IsAbilityUltimate takes integer id returns boolean
    return ( id == 'A001' or id == 'A002' or id == 'A003' or id == 'A004' or id == 'A005' )
endfunction

(A001, A002, A003, A004 and A005 are ultimates)

You're just comparing some integers (as many as there are heroes), I don't think you will get any performance problems from that.

/edit: Of course, you can't put this function in the map header, but I don't think that's that much of a problem.
 

luorax

Invasion in Duskwood
Reaction score
67
I haven't said that substrings are faster than comparing two integers...
Please read the whole topic if you would like to comment...
 

Sevion

The DIY Ninja
Reaction score
413
Hmm?

Use a struct...

JASS:
keyword ultimateList

globals
    ultimateList spells
endglobals

struct ultimateList extends array
    private boolean isUltimateX

    // Not explicitly required, but if you wish to do something upon setting the boolean...
    public method operator isUltimate= takes integer i, boolean flag returns nothing
        set spells<i>.isUltimateX = flag
    endmethod

    public method operator isUltimate takes integer i returns boolean
        debug if spells<i>.isUltimateX = null then
            debug DisplayTextToPlayer(GetLocalPlayer(), 0, 0, &quot;Warning (isUltimate): Null boolean!&quot;)
            debug // Do something else? I.E. return false ?
        debug endif
        return spells<i>.isUltimateX
    endmethod
    
    private static method onInit takes nothing returns nothing
        set spells = thistype.allocate()
        set spells[A000].isUltimateX = true
        set spells[A001].isUltimateX = true
    endmethod
endstruct

//usage

scope myTest initializer init
    private function init takes nothing returns nothing
        if ( ultimates[A000].isUltimate ) then
            // Do Something
        else
            // Do Something Else
        endif
    endfunction
endscope
</i></i></i>


There's a little work in initialization.

A little less efficient than the if ... or ... or ... or ... then method, but prettier and the efficiency impact is moot.

You can also use this as an interface to add additional features.

It has been a while since I vJASSed, so my scripting may be a bit rusty.

You could also wrap the struct into a library and privatize the entire struct to stop users from making duplicate structs. Just make the "spells" variable public.
 

DioD

New Member
Reaction score
57
A000 is large integer and will not fit 8190 limit for arrays.

you must use ID - A000 or other way to fit ID into 8190 bounds.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top