Spell Classification?

Langues: JP EN DE FR
users online
Forum » Windower » Support » spell classification?
spell classification?
Offline
Posts: 9
By Gaude1 2019-01-21 01:55:41
Link | Citer | R
 
Hello all,

Could someone tell me why I cant get a gearswap to happen when casting dark magic, or absorb spells? Its the one azagarth posted, and ive started adding some gear that I currently have for the job.

It all seems to work so far in testing, except the darkmagic/absorbs... The stun works tho.

I feel like its line 151.. but I've tried doing
sets.midcast['Dark Magic'] and that didn't seem to work.
 Asura.Byrne
Offline
Serveur: Asura
Game: FFXI
By Asura.Byrne 2019-01-21 04:29:53
Link | Citer | R
 
Gaude1 said: »
Hello all,

Could someone tell me why I cant get a gearswap to happen when casting dark magic, or absorb spells? Its the one azagarth posted, and ive started adding some gear that I currently have for the job.

It all seems to work so far in testing, except the darkmagic/absorbs... The stun works tho.

I feel like its line 151.. but I've tried doing
sets.midcast['Dark Magic'] and that didn't seem to work.

There are a few things that strike me as odd in this case. For one, the Library of Dark Magic spells isn't very extensive. On Dark Knight you'll have Absorb Spells, Apsir/Drain spells, Bio 1 and 2, Dread Spikes, Endark, Stun, and Tractor. If these are the spells you are trying, there are a couple of things that could be going wrong... The first thing that comes to mind is that your libraries may be incomplete, though I'm not sure how that might have happened.

The first concept I'd like to clarify is, in Lua programming language, there is absolutely no difference in the validity of sets.midcast.DarkMagic versus sets.midcast['DarkMagic']. However there is a difference between sets.midcast.DarkMagic and sets.midcast['Dark Magic']. The syntax of tablename.content and tablename['content'] are the same, but the reason the latter exists is for differences in what the string says (in this case Dark Magic) are worded. Of course, Dark Magic has a space in it, and if the libraries don't contain a value for "DarkMagic" but do contain one for "Dark Magic", it can result in only sets.midcast['Dark Magic'] being considered valid.

Now, on to the other bit, you say you have tried
Code
sets.midcast['Dark Magic'] = {}

You'll want to retry this, with special care to ensure you are using proper operators (i.e. the single = sign and {}) and making sure that you have placed it before any other sets that would combine with it, in your case this seems to be none of them as stun, absorb and drain each have their own sets that are not set combines, but this is worth knowing moving forward regardless, default sets must always be placed above sets that rely on them whether it's through set_combines or set.name['things'].stuff

Now if that still doesn't work, I'd reccomend something more remedial, like making sure you don't have multiple copies of your lua, and that the one you are editing is in fact the one in your data folder. (This is a common problem that affects even the most attentive of people from time to time)

And finally you could brute force this check by doing the following:

in your lua, make a new at the bottom, preferably above the post_midcast function:
Code
function job_midcast(spell, action, spellMap, eventArgs)

    if spell.skill == 'Dark Magic' then
        equip(sets.midcast.DarkMagic)
    end
end


Now with your main set still being called "sets.midcast.DarkMagic" if this still does not work, that means you are missing libraries, and aside from re-downloading Windower4 and if you do I highly reccomend making backups of all of your addon/plugin settings, the only way of solving it would be to individually define the spells such as:
Code

function job_midcast(spell, action, spellMap, eventArgs)
if spell.english:startswith("Absorb") or spell.english:startswith("Drain") 
or spell.english:startswith("Aspir") or spell.english:startswith("Bio") 
or spell.english:startswith("Endark") or spell.english == "Tractor" 
or spell.english == "Stun" or spell.english == "Dread Spikes" then
	equip(sets.midcast.DarkMagic)
	end
end


No worries about this conflicting with your specialized sets, as those are handled in post_midcast.

But again, I'd double check first to make sure you haven't made a mistake such as editing the wrong file, making a typing mistake, using improper operators (symbols) or having the file in the wrong place
Offline
Posts: 9
By Gaude1 2019-01-22 21:51:27
Link | Citer | R
 
I didn't want to fall away without replying.

I only had a short window to test, and I tested with the brute force method you had shown.

When I typed it myself, it did not work... when I copied and pasted (as I KNEW you wouldn't have put in something wrong) it worked perfectly.

I will try removing it and re-checking everything again, but it will have to be in a couple weeks.

Why does your " if spell.skill == 'Dark Magic' then" section work and when I type "=" twice "==" it does not work?
Maybe I did not have a space or something ><p
Programming is way to advanced for me, and thank you again, so much, for helping me :)

Cheers,
Gaude
Log in to post.