Need Help Referencing Buff IDs In Job_buff_change

言語: JP EN DE FR
2010-06-21
New Items
105 users online
フォーラム » Windower » Support » Need help referencing buff IDs in job_buff_change
Need help referencing buff IDs in job_buff_change
Offline
Posts: 4
By SpideyCU 2018-08-10 00:22:28  
While you can reference buffactive[##] to pinpoint a specific type of buff (normal Haste, 33, vs Geo Haste, 580), I haven't been able to figure out the proper syntax to do so in the job_buff_change function.

Essentially, right now I set
Code
if buff == 'Haste' and not gain then


to play a sound through windower to let me know the buff has dropped, How do I tailor this to only return true when buff ID 33 drops, and not ID 580?

I've tried the following variants which don't work:
Code
if buff == 33 and not gain then
Code
if buff[33] and not gain then


I've searched for info both referencing buff IDs as well as the job_buff_change function but have come up with nothing. I appreciate any and all insights - thanks!
 Bahamut.Riyoko
Offline
サーバ: Bahamut
Game: FFXI
user: Jone
Posts: 27
By Bahamut.Riyoko 2018-08-10 03:34:58  
You could try
Code
if not T(windower.ffxi.get_player().buffs):contains(33) then


then add your code to play that sound below then it should work.
Offline
Posts: 4
By SpideyCU 2018-08-10 15:20:46  
Thanks Riyoko, that's pretty close. The only downside to that is when I have multiples of these (say, for as a BLU, when Nature's Meditation goes down, and Haste, and Refresh). Then, if any one of them drops (and thus triggers the job_buff_change function), and Haste ALSO isn't up, it will give me a false positive.

Is Windower generally devised such that you can only use the buff ID to check for active effects rather than changes of state?
 Carbuncle.Kigensuro
Offline
サーバ: Carbuncle
Game: FFXI
user: dlsmd
Posts: 47
By Carbuncle.Kigensuro 2018-08-11 11:52:12  
the main issue is that motes include has not been updated for a long time and some things are not included in his code

like the below
in gearswap the full function is
buff_change(name,gain,buff_table)
but in motes include (as mote controls the buff_change function)
job_buff_change(buff, gain, eventArs)
so you lose the buff_table which already has what you are looking for

-edit-
one more thing
T(windower.ffxi.get_player().buffs):contains(33) can still show incorrect info when used in the buff_change sequence as gearswap directly gets all it data from the packet not memory for the buff_change function
 Bahamut.Riyoko
Offline
サーバ: Bahamut
Game: FFXI
user: Jone
Posts: 27
By Bahamut.Riyoko 2018-08-11 12:54:57  
Hmm this is quite tricky but do the following:

below function job_setup() add this
determine_haste_state()

then make a new function somewhere like this:
Code
function determine_haste_state()
if not (buffactive[33]) then
--add your sound effect here--
end
end


and below job_buff_change(buff, gain) function add:
Code
if S{'haste'}:contains(buff:lower()) then
		determine_haste_state()
	end

and below function job_update(cmdParams, eventArgs) add:
Code
determine_haste_state()


and I think this should do it and other buffs shouldn't trigger the code again.
sorry for the wonky solution but I hope it helps. let me know if it works or not
Offline
Posts: 4
By SpideyCU 2018-08-13 00:50:02  
Thanks again for the pointer Riyoko, was away from the PC all weekend but will give it a shot tomorrow. It looks like a pain but if it works I'll mimic the setup for Refresh as well. It'll be pretty awesome if it does end up working out, that way I can stay on top of my buffs and not get notifications everytime I move in/out of a GEO's range, heh.

And thanks Kigensuro as well for the additional background.
Log in to post.