|
weapon_skills.lua range is off
By shastax 2020-12-04 09:58:53
I'm trying to write a script that will prevent use of weapon skill when out of range. There are several parts to this... every weapon skill has a defined range, and you need to add your own model size and target's model size to the range also.
The trouble I'm running into is that Windower's resource file weapon_skills.lua has ranges defined that don't match up with in-game "yalms" as measured by DistancePlus. Is there some trick to converting these ranges to the correct units?
As an example, Combo is listed as having a range of 2. Obviously, even discounting model sizes, the actual range is more like 4'.
Lakshmi.Elidyr
Serveur: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2020-12-04 10:33:42
This is what I use. Code local ranges = {[0]=255,[2]=3.40,[3]=4.47,[4]=5.76,[5]=6.89,[6]=7.80,[7]=8.40,[8]=10.40,[9]=12.40,[10]=14.50,[11]=16.40,[12]=20.40,[13]=23.4}
Edit: Didn't really explain how to use. Code
local distance = 'your distance'
local action = resources.weapon_skills[id] or false
if action and action.range and ranges[action.range] and distance < ranges[action.range] then
end
Just note this is doesn't take in to account a bunch of other stuff or checks, but general idea.
[+]
By shastax 2020-12-04 10:34:49
This is what I use. Code local ranges = {[0]=255,[2]=3.40,[3]=4.47,[4]=5.76,[5]=6.89,[6]=7.80,[7]=8.40,[8]=10.40,[9]=12.40,[10]=14.50,[11]=16.40,[12]=20.40,[13]=23.4}
This is awesome! Thanks. I will test this out. Just curious, where did you get these values from?
Lakshmi.Elidyr
Serveur: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2020-12-04 10:40:41
I think I just went through and compared where a specific range ID was when I attempted to use. Like provoke being:
I would see how far away I could use then add it to the list.
Some weapon skills have funky ones like detonator I think?
Edit: I think there's a few custom ones I use for personal matters.
By shastax 2020-12-06 13:01:36
For the sake of completing this thread, I found out there are range multipliers being used in the DistancePlus addon. They look very precise so I'm going to use those and I'll post them here for anyone else who is interested...
Code range_mult = {
[2] = 1.55,
[3] = 1.490909,
[4] = 1.44,
[5] = 1.377778,
[6] = 1.30,
[7] = 1.15,
[8] = 1.25,
[9] = 1.377778,
[10] = 1.45,
[11] = 1.454545454545455,
[12] = 1.666666666666667,
}
These need to be multiplied to the base ranges listed for the ws and then also add the character's model size and the target's model size.
I'm trying to write a script that will prevent use of weapon skill when out of range. There are several parts to this... every weapon skill has a defined range, and you need to add your own model size and target's model size to the range also.
The trouble I'm running into is that Windower's resource file weapon_skills.lua has ranges defined that don't match up with in-game "yalms" as measured by DistancePlus. Is there some trick to converting these ranges to the correct units?
As an example, Combo is listed as having a range of 2. Obviously, even discounting model sizes, the actual range is more like 4'.
|
|