Sroda Necklace In Gearswap Lua

Language: JP EN DE FR
users online
Forum » Windower » Support » Sroda necklace in gearswap lua
Sroda necklace in gearswap lua
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-21 22:25:45
Link | Quote | Reply
 
How do i add sroda necklace to my rdm and whm luas?

i want gearswap to switch in my sroda necklace when i use a barstatus (barpoison, barparalyze, etc) spell.

i can't find a barstatus in the variables file so i tried adding my own barstatus to the mote_mappings lua but that isnt working.

i added this to the mappings lua:

and i added this to my rdm lua:

then i reloaded gearswap and tried gs r mote_mappings. and thats as far as i've gotten on my own.
 Bahamut.Kaius
Offline
Server: Bahamut
Game: FFXI
Posts: 26
By Bahamut.Kaius 2023-06-22 01:12:00
Link | Quote | Reply
 
What exactly is not working? Like it just doesn't swap in the necklace when you cast a bar status spell? Do you have any errors on the console when trying to cast, or when loading the job's lua?

Seems like everything you did makes sense and should work. Not sure about 'gs r mote_mappings'. I would just do a //lua reload gearswap to make sure all the mote stuff and your lua is reloaded.
 Ragnarok.Shaedhen
Offline
Server: Ragnarok
Game: FFXI
user: Shadowwww
Posts: 22
By Ragnarok.Shaedhen 2023-06-22 01:56:33
Link | Quote | Reply
 
What you did seems correct as far as I can tell.
Could you post your complete mote_mappings file ? All I could think of is that the BarStatus stuff hasn't been added at the right place maybe.
Offline
Posts: 295
By Beau 2023-06-22 05:37:20
Link | Quote | Reply
 
You guys are on to something with that advanced mappings stuff but for a dummy like me in the meantime here's what I have done (this is a RDM lua):

sets.midcast['BarElement'] = set_combine(sets.midcast.enhancing.potency, {
legs="shedir seraweels",
})

sets.midcast['Barsleep'] = set_combine(sets.midcast['BarElement'], {neck="Sroda Necklace"})
sets.midcast['Barpoison'] = sets.midcast['Barsleep']
sets.midcast['Barparalyze'] = sets.midcast['Barsleep']
sets.midcast['Barblind'] = sets.midcast['Barsleep']
sets.midcast['Barsilence'] = sets.midcast['Barsleep']
sets.midcast['Barpetrify'] = sets.midcast['Barsleep']
sets.midcast['Barvirus'] = sets.midcast['Barsleep']
sets.midcast['Baramnesia'] = sets.midcast['Barsleep']

sets.midcast['Barsleepra'] = sets.midcast['Barsleep']
sets.midcast['Barpoisonra'] = sets.midcast['Barsleep']
sets.midcast['Barparalyzra'] = sets.midcast['Barsleep']
sets.midcast['Barblindra'] = sets.midcast['Barsleep']
sets.midcast['Barsilencera'] = sets.midcast['Barsleep']
sets.midcast['Barpetra'] = sets.midcast['Barsleep']
sets.midcast['Barvira'] = sets.midcast['Barsleep']
sets.midcast['Baramnesra'] = sets.midcast['Barsleep']
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 07:03:06
Link | Quote | Reply
 
Bahamut.Kaius said: »
What exactly is not working? Like it just doesn't swap in the necklace when you cast a bar status spell? Do you have any errors on the console when trying to cast, or when loading the job's lua?

Seems like everything you did makes sense and should work. Not sure about 'gs r mote_mappings'. I would just do a //lua reload gearswap to make sure all the mote stuff and your lua is reloaded.

no it won't swap the necklace in. i know the neck is not disabled because it switches in my fastcast gear.

no errors when i cast any bar spells

and yup i tried lua r gearswap
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 07:03:35
Link | Quote | Reply
 
Ragnarok.Shaedhen said: »
What you did seems correct as far as I can tell.
Could you post your complete mote_mappings file ? All I could think of is that the BarStatus stuff hasn't been added at the right place maybe.
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 07:05:44
Link | Quote | Reply
 
thanks beau i'll use this until we can get the mote mapping problem figured out

i'm a multiboxer so a update to the mappings lua will help out alot so i dont have to copy and paste over and over
[+]
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 07:49:14
Link | Quote | Reply
 
weird. i tried your code beau but its still not changing it.

it works if i put the sroda necklace in my enhancingduration set or any other set but not in the bar spells sets.... wtf??
Offline
Posts: 396
By Meeble 2023-06-22 09:16:52
Link | Quote | Reply
 
What you did initially should work fine with stock GS.

That said, if your lua has an EnhancingDuration set, it probably has a midcast customization function that's overriding the default behavior. Find that function and you should be able to add the logic you need.

As a side note, any changes you make to Mote-Mappings.lua will be reverted anytime GS updates. You can save your revised mappings file as Custom-Mappings.lua or w/e, then load it in the relevant job luas with:
Code
include('Custom-Mappings')
[+]
Offline
Posts: 295
By Beau 2023-06-22 09:48:41
Link | Quote | Reply
 
Ragnarok.Iamarealgirl said: »
weird. i tried your code beau but its still not changing it.

it works if i put the sroda necklace in my enhancingduration set or any other set but not in the bar spells sets.... wtf??
Hmm im not an expert but from experience i know that if there are two sets that apply the last one (going from top to bottom of the LUA) is the one that equips; ensure your set_combines are always stacking from a set that is listed prior in the LUA. Or maybe there is a special rule in the bottom of the lua that tells any bar-spell to equip a certain set.
 Asura.Chendar
Offline
Server: Asura
Game: FFXI
user: chendar
Posts: 135
By Asura.Chendar 2023-06-22 10:20:48
Link | Quote | Reply
 
have you tried
Code
//gs equip sets.midcast.BarStatus

to check if you can force equip the set in the first place?

If that works then it's likely being overwritten by another set (enh. duration?) somewhere in your job lua like Meeble suggested. Perhaps in the 'job_post_midcast' function for example?

quick edit:
The basic mote whm lua also has a 'job_get_spell_map' function that deals with mappings. It doesn't touch enhancing magic by default, but if someone played around with it you might wanna have a look.
 Odin.Lawii
Offline
Server: Odin
Game: FFXI
user: Lawiii
Posts: 62
By Odin.Lawii 2023-06-22 10:43:48
Link | Quote | Reply
 
FYI the Mote-Mappings.lua does sometime get updated(not very often), and when it does it will take the lines out that make those spells BarStatus.
I have brought this up in the widower discord, but they did not want to add it to the lib. you can write your own library and add those lines to it, or you can fix it when it updates.
[+]
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 12:56:37
Link | Quote | Reply
 
Asura.Chendar said: »
have you tried
Code
//gs equip sets.midcast.BarStatus

to check if you can force equip the set in the first place?

If that works then it's likely being overwritten by another set (enh. duration?) somewhere in your job lua like Meeble suggested. Perhaps in the 'job_post_midcast' function for example?

quick edit:
The basic mote whm lua also has a 'job_get_spell_map' function that deals with mappings. It doesn't touch enhancing magic by default, but if someone played around with it you might wanna have a look.

yes //gs equip sets.midcast.Barstatus worked

and yes theres a duration enhancing set.

not sure what i'm supposed to do though. put the barstatus above the duration set?
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 13:06:33
Link | Quote | Reply
 
Here's my lua
 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 13:16:55
Link | Quote | Reply
 
found the problem!
Code
elseif spell.skill == 'Enhancing Magic' then
        if buffactive.composure and spell.target.type == 'PLAYER' then
            equip(sets.buff.ComposureOther)
        end
        equip(sets.midcast.EnhancingDuration) -- was this line here


i deleted that line and it fixed the problem! thanks for the help guys i never wouldve figured it out if you hadnt helped

much appreciated
 Asura.Chendar
Offline
Server: Asura
Game: FFXI
user: chendar
Posts: 135
By Asura.Chendar 2023-06-22 13:18:24
Link | Quote | Reply
 
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
  if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
    equip(sets.buff.Saboteur)
  elseif spell.skill == 'Enhancing Magic' then
    if buffactive.composure and spell.target.type == 'PLAYER' then
    equip(sets.buff.ComposureOther)
    end
    equip(sets.midcast.EnhancingDuration)
  elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
    equip(sets.midcast.CureSelf)
  end
end


line 393 there:
equip(sets.midcast.EnhancingDuration)

basically makes it equip 'sets.midcast.EnhancingDuration' over any other sets for all enhancing spells no matter what.

Could just remove that line, might casue issues with duration for other spells though if there's no other solution to handle that. Personally I just have my sets.midcast["Enhancing Magic"] be full duration since RDM hits 500 skill easy enough anyway and let most stuff default to that and just have a separate set for temper and enspells with max skill.

EDIT: too late with the reply it seems :P
[+]
Offline
Posts: 464
By drakefs 2023-06-22 13:23:08
Link | Quote | Reply
 
I agree with the others, you should not make changes to the mappings file. I added the mappings to my jobs lua (you can also add it to your globals.lua to work across moultiple jobs) and then added a check to my post_midcast
Code
function job_setup()
    barStatus = S{'Barpoison','Barparalyze','Barvirus','Barsilence','Barpetrify','Barblind','Baramnesia','Barsleep','Barpoisonra','Barparalyzra','Barvira','Barsilencera','Barpetra','Barblindra','Baramnesra','Barsleepra'}
end

function init_gear_sets()
    sets.midcast.Barstatus = set_combine(sets.midcast['Enhancing Magic'], {neck="Sroda necklace"})
end

function job_post_midcast(spell, action, spellMap, eventArgs)
    if barStatus:contains(spell.name) then
        equip(sets.midcast.Barstatus)
    end
end


If you want to use the globals.lua, use user_post_midcast instead of job_post_midcast
[+]
Offline
Posts: 396
By Meeble 2023-06-22 14:02:28
Link | Quote | Reply
 
You don't have to remove the Enhancing Duration logic, you can have both. Drakefs' suggestion is a much cleaner way to do things than tweaking the mappings.

Here's a version of your lua with that done:

It checks whether it should use ComposureOther, then BarStatus, and if neither of those conditions are valid it'll default to EnhancingDuration.

 Ragnarok.Iamarealgirl
Offline
Server: Ragnarok
Game: FFXI
user: Latravant
Posts: 43
By Ragnarok.Iamarealgirl 2023-06-22 15:18:48
Link | Quote | Reply
 
Asura.Chendar said: »

EDIT: too late with the reply it seems :P

still appreciated!
 Phoenix.Rizzspeed
Offline
Server: Phoenix
Game: FFXI
user: Rizzspeed
Posts: 115
By Phoenix.Rizzspeed 2023-06-22 19:46:42
Link | Quote | Reply
 
here's what i did.

in Mote-Mappings.lua, under spell_maps, i added ALL the barspells.
['Barsleepra']='BarElement', etc.

After doing this, sets.midcast.Barstatus works as a set. So then just make a set including the necklace and place in your lua.
Log in to post.