Ability - Autocast and check if autocast :S

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Hi,

I was wondering how to make an ability have the option of being autocast or not, or would I have to use an ability with autocast already, as the base ability?

And is there anyway to be able to tell if autocast is active?

Thanks.
 

Exide

I am amazingly focused right now!
Reaction score
448
>or would I have to use an ability with autocast already, as the base ability?
Yes.

>And is there anyway to be able to tell if autocast is active?
Not that I know of, sorry.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
>And is there anyway to be able to tell if autocast is active?
What for? Dont get the point of wanting that, because if the ability is cast > Event "starts effect of an ability"...And if the ability is not being casted, its most likely not active, or its not in the need of casting it, exmaple Heal, if there are no wounded units nearby...etc. And remember, you can cast an autocast ability without activating it, therefore..hmm, i dont see the problem, why you would need this.
 

Kenoriga

Ultra Cool Member
Reaction score
34
This might or might not work...

Check when the ability's orderstring is activated or not... I think that there is such a thing. Never tried :eek:
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
There is order string for activating, usually "nameofability + on /off"...exmaple
"healon" "healoff"...
But as I said, why do he want this? I mean, its not a passive ability, and everything you want to do, should be used on cast? Unless he wants a passive ability AND autocast? :p Ok, my bad then, if so :)
 

NapaHero

Back from the dead...
Reaction score
43
There is order string for activating, usually "nameofability + on /off"...exmaple
"healon" "healoff"...
But as I said, why do he want this? I mean, its not a passive ability, and everything you want to do, should be used on cast? Unless he wants a passive ability AND autocast? :p Ok, my bad then, if so :)

How a ability can be Passive AND Autocast? :confused:
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
I would like this so if the autocast is enabled a boolean is set to true, else, false.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Use the unit's Custom Value. 0 = off, 1 = on. Set it to the correct number when the unit is issued the on/off order.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Like this?

Code:
customLand
    Events
        Unit - Flying Machine 0000 <gen> Begins casting an ability
    Conditions
        (Ability being cast) Equal to Drop 
    Actions
        Unit - Set the custom value of Flying Machine 0000 <gen> to 0

Or is there another name (rather then casting) for an ability on auto-cast?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
For example:

Code:
Autocast OnOff
    Events
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(healon))
            Then - Actions
                Unit - Set the custom value of (Ordered unit) to 1
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(healoff))
            Then - Actions
                Unit - Set the custom value of (Ordered unit) to 0
            Else - Actions
 
M

Master Mazer

Guest
Well... in my opionion you should build off of the spell Preist. It already has atuo cast so wouldnt it be easeir?



P.S Dang Ghan.... your smart with Warcraft and comps lol....
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Oh I see how that works, thanks alot! :D

I never knew that you could use strings like that, this world editor is pretty damn advanced!

Thanks Ghan.

Could I shorten it by putting the second IF THEN ELSE action under the first IF THEN ELSE else action? If you know what I mean?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Could I shorten it by putting the second IF THEN ELSE action under the first IF THEN ELSE else action? If you know what I mean?

If you put it under the Else part, yes. But I see no point. It doesn't really "shorten" anything.

If you want more info, read on:

For example. The trigger with separate ifs looks like this to Warcraft:

JASS:
function Trig_Autocast_OnOff_Func001C takes nothing returns boolean
    if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ(&quot;healon&quot;) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Autocast_OnOff_Func002C takes nothing returns boolean
    if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ(&quot;healoff&quot;) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Autocast_OnOff_Actions takes nothing returns nothing
    if ( Trig_Autocast_OnOff_Func001C() ) then
        call SetUnitUserData( GetOrderedUnit(), 1 )
    else
    endif
    if ( Trig_Autocast_OnOff_Func002C() ) then
        call SetUnitUserData( GetOrderedUnit(), 0 )
    else
    endif
endfunction

//===========================================================================
function InitTrig_Autocast_OnOff takes nothing returns nothing
    set gg_trg_Autocast_OnOff = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Autocast_OnOff, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddAction( gg_trg_Autocast_OnOff, function Trig_Autocast_OnOff_Actions )
endfunction


And here it is with the second If inside the first If:

JASS:
function Trig_Autocast_OnOff_Func001Func001C takes nothing returns boolean
    if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ(&quot;healoff&quot;) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Autocast_OnOff_Func001C takes nothing returns boolean
    if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ(&quot;healon&quot;) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Autocast_OnOff_Actions takes nothing returns nothing
    if ( Trig_Autocast_OnOff_Func001C() ) then
        call SetUnitUserData( GetOrderedUnit(), 1 )
    else
        if ( Trig_Autocast_OnOff_Func001Func001C() ) then
            call SetUnitUserData( GetOrderedUnit(), 0 )
        else
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Autocast_OnOff takes nothing returns nothing
    set gg_trg_Autocast_OnOff = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Autocast_OnOff, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddAction( gg_trg_Autocast_OnOff, function Trig_Autocast_OnOff_Actions )
endfunction


So, nothing really to be gained.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Oh yeah I see, and also I tried it and it didn't work, I thought that it would be changing the value at every order given and it did.

Thanks for your help! :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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 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