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
888
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
888
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
888
> 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.

      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