Mapping Marksmanship Weapons As Xbow/gun

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » General » Mapping marksmanship weapons as xbow/gun
Mapping marksmanship weapons as xbow/gun
Offline
Posts: 34
By shastax 2020-12-03 09:31:15
Link | Quote | Reply
 
Does anyone have a map of all marksmanship weapons that marks them as either a gun or xbow? I need this for automatic ammo swapping (e.g. MAB ammo for magic WS). I currently have to hardcode the weapons I have and mark them as xbow or gun, but this is tedious and looks ugly. If someone has done this for all weapons already, I'd appreciate it.
Offline
Posts: 375
By drakefs 2020-12-03 10:32:27
Link | Quote | Reply
 
Do you really need a map of all marksmanship weapons? I would suggest to just make them with the 119 weapons that you have now and some you may have a use for in the future.

The easiest way would be to use something like this
Code
marksmanship_weapon_map = {}
marksmanship_weapon_map.Xbow = S{}
marksmanship_weapon_map.Gun = S{}

Code
if marksmanship_weapon_map.Gun:contains(player.equipment.range) then
    logic to run
elseif marksmanship_weapon_map.Xbow:contains(player.equipment.range) then
    logic to run
end
 Leviathan.Celebrindal
Offline
Server: Leviathan
Game: FFXI
Posts: 3753
By Leviathan.Celebrindal 2020-12-03 10:49:39
Link | Quote | Reply
 
shastax said: »
Does anyone have a map of all marksmanship weapons that marks them as either a gun or xbow? I need this for automatic ammo swapping (e.g. MAB ammo for magic WS). I currently have to hardcode the weapons I have and mark them as xbow or gun, but this is tedious and looks ugly. If someone has done this for all weapons already, I'd appreciate it.

not to poopoo your conceptual desire, but aren't we really talking about just not trying to swap in quelling bolts while using Fomalhaut/Armageddon? Since Corsair can't equip crossbows, the only reason to do this that I see on first view is Trueflight/Wildfire between Gastraphetes and a gun.

If that's your goal, I would think some variant of an if/then statement based on if Gastraphetes is equipped to alter the ammo would really be all you need. If there are other swaps you're making during gun usage, I'd be curious to hear your usage reasons.
 Cerberus.Darkvlade
Offline
Server: Cerberus
Game: FFXI
user: Darkvlade
Posts: 191
By Cerberus.Darkvlade 2020-12-03 11:08:43
Link | Quote | Reply
 
this is from Seli's gs on my RNG lua

WeaponType = {['Fail-Not'] = "Bow",
['Yoichinoyumi'] = "Bow",
['Accipiter'] = "Bow",
['Fomalhaut'] = "Gun",
['Ataktos'] = "Gun",
['Annihilator'] = "Gun",
['Gastraphetes'] = "Crossbow",}


DefaultAmmo = {
['Bow'] = {['Default'] = "Chrono Arrow",
['WS'] = "Chrono Arrow",
['Acc'] = "Chrono Arrow",
['Magic'] = "Chrono Arrow",
['MagicAcc'] = "Chrono Arrow",
['Unlimited'] = "Hauksbok Arrow",
['MagicUnlimited'] ="Hauksbok Arrow",
['MagicAccUnlimited'] ="Hauksbok Arrow"},


['Gun'] = {['Default'] = "Chrono Bullet",
['WS'] = "Chrono Bullet",
['Acc'] = "Chrono Bullet",
['Magic'] = "Devastating bullet",
['MagicAcc'] = "Devastating bullet",
['Unlimited'] = "Hauksbok Bullet",
['MagicUnlimited'] = "Hauksbok bullet",
['MagicAccUnlimited'] ="Animikii Bullet"},

['Crossbow'] = {['Default'] = "Quelling Bolt",
['WS'] = "Quelling Bolt",
['Acc'] = "Quelling Bolt",
['Magic'] = "Quelling Bolt",
['MagicAcc'] = "Quelling Bolt",
['Unlimited'] = "Quelling Bolt",
['MagicUnlimited'] = "Quelling Bolt",
['MagicAccUnlimited'] ="Quelling Bolt"}} --"Hauksbok Bolt"
Offline
Posts: 34
By shastax 2020-12-04 09:31:48
Link | Quote | Reply
 
Cerberus.Darkvlade said: »
this is from Seli's gs on my RNG lua

WeaponType = {['Fail-Not'] = "Bow",
['Yoichinoyumi'] = "Bow",
['Accipiter'] = "Bow",
['Fomalhaut'] = "Gun",
['Ataktos'] = "Gun",
['Annihilator'] = "Gun",
['Gastraphetes'] = "Crossbow",}

This is basically what I'm doing now, but it's just not good coding practice to do this when it could pull in from a resource file. I guess one doesn't exist though, based on the replies, so I'll continue using this method.

Thank you, everyone, for you input.
Offline
Posts: 34
By shastax 2020-12-04 09:38:33
Link | Quote | Reply
 
drakefs said: »
Do you really need a map of all marksmanship weapons? I would suggest to just make them with the 119 weapons that you have now and some you may have a use for in the future.

The easiest way would be to use something like this
Code
marksmanship_weapon_map = {}
marksmanship_weapon_map.Xbow = S{}
marksmanship_weapon_map.Gun = S{}

Code
if marksmanship_weapon_map.Gun:contains(player.equipment.range) then
    logic to run
elseif marksmanship_weapon_map.Xbow:contains(player.equipment.range) then
    logic to run
end

The main reason I am doing this is because my lua detects the current ranged weapon on load or job change, as well as when ranged weapon changes, and issues a command to DistancePlus to set the mode for the current weapon. It shows you the true shot range based on the weapon mode you have set but the mode has to be set manually (or using a script such as the one I've written). The only info I've found in packet info as well as Windower resource files only indicate a weapon as Archery or Marksmanship, but the true shot range is different between xbow and gun type weapons. I am currently defining it myself for all the marksmanship weapons I have, but I would prefer to pull this info from a resource file.
Log in to post.