Sustains with a targeter question
Moderator: Moderator
Sustains with a targeter question
If I make a sustain with a targeter, I.E. it selects an area and then does an effect on it once you activate it, but the player cancels the targeter by pressing esc. or whatever, would I be able to use forceUseTalent(MyTalent, {no_energy = true}) and then refund the player energy, thus giving them the turn back and turning the sustain off?
A little bit of a starters guide written by yours truly here.
-
- Spiderkin
- Posts: 543
- Joined: Sat Feb 11, 2012 1:12 am
Re: Sustains with a targeter question
Couldn't you just use
in the activate function to prevent it from being turned on without a target?
Code: Select all
local tg = self:getTalentTarget(t)
local x, y, target = self:getTarget(tg)
if not x or not y or not target then return nil end
Re: Sustains with a targeter question
I wasn't sure if returning nil would prevent it from being turned on, since sustain activate functions usually return a table and not true like action functions do.
A little bit of a starters guide written by yours truly here.