#Custom SetDurationInfo with return of duration/expirationTime not working properly

83 messages · Page 1 of 1 (latest)

lean briar
#

Seems like there's a problem with the return values. no idea what's wrong with my duration and expirationTime.. it's really bugging me.

red siren
#

do NOT call theat function directly.

lean briar
#

which function?

red siren
#

set duration info.

#

why do you use a custom function at all here?

lean briar
#

well, the function is not the issue. the return is the issue

red siren
#

the function is the issue.

lean briar
lean briar
red siren
#

does that mean this is not the full code?

lean briar
#

this would be the full code.

tough cypress
#

Why don't you use the duration field to set the duration

lean briar
#

because, as you can see, it depends on the role of the opponent/unit.

tough cypress
#

Yes, make that distinction and set it appropriately?

#

If you use a custom trigger, then you can just set your duration in the duration field to whatever you want

#

That's what it's there for

lean briar
#

so you mean i shouldnt return anything and just use the timed field with a custom func?

tough cypress
#

No, if you scroll down you see the duration field

#

Return your duration and expiration time in there

lean briar
#

that's exactly what i was talking about..?

#

i've tried that before and this didnt really work either so idk

tough cypress
#

Ah yeye, misunderstanding then

lean briar
#

it shouldnt really matter, no?

#

if i remove my return values, it works fine but my WA doesnt desaturate

red siren
#

did you try deleting the direct function call?

#

the desaturation is done via conditoons.

lean briar
#

yea well i can do it via code as well

#

but then it persists

red siren
#

no code.

lean briar
#

which is obvious

red siren
#

delete the set duration info call.

tough cypress
#

If you return your duration and expiration time in the custom duration field box, then that's that

#

It just works

lean briar
#

well

#

my condition doesnt work to desaturate

red siren
#

then show your condition.

#

show your whole aura

#

export your aura

lean briar
#

those are just dummy durations

#

want to get the stuff working before im working with the real numbers

red siren
#

export the aura. i see things there.

#

delete the set duration info.

lean briar
#

why would i?

red siren
#

beacuse it breaks

#

that is what breaks this whole thing.

#

this is what makes it not work.

lean briar
#

now it doesnt work at all lol.

red siren
#

you are not using weakauras. you mess around.

#

forget it.

lean briar
#

i need to set the duration as the weakaura doesnt get the info from anywhere else.

#

so how is it supposed to know the duration?

red siren
#

no.

#

just no.

lean briar
#

bruh.

tough cypress
lean briar
tough cypress
#

It works

lean briar
#

literally returning duration and expirationtime there

#

does nothing

red siren
#

yes.

#

because your truigger is utter garbage.

lean briar
#

it's not.

red siren
#

its not active.

lean briar
#

i guess you dont even understand what im trying to achieve.

red siren
#

your trigger is not active. it does nothing besides messing in the internals.

#

i do.

#

but you dont know how a trigger works.

#

you dont return true.

lean briar
#

well i need to return more than true.

#

i need to return unit and spellid

red siren
#

i do know what you want to accomplish, i do know how you can accomplish that, but instead of taking help, you do exact the opposite.

#

no you dont

#

thats not how a trigger works.

lean briar
#

and how am i gonna do my calculation? how am i gonna get the unit's role?

red siren
#

in the trigger.

lean briar
#

yea and that doesnt help me

#

i need it in the duration

red siren
#

you dont

#

you put the duration in aura_env and then have that in the duration box.

#
function(event, unit, spell)
  if(unit == 'thatOne' and spell == 'innervate') then 
    local spec = getSpec(unit)
     aura_env.duration = spec == 3 and 90 or 120
    return true
  end
end```
```lua
function()
  return aura_env.duration, getTime+arura_env.duration
end```
lean briar
#

got it working