It's case sensitive.
It's case sensitive.
np! I still have no idea what was causing that.
Also, I'm going to write a function that should screen out impossible casts (like in Mog Gardens).
My thoughts about allowing WSs/etc. while not engaged are:
1) Being able to WS and use other engaged-required JAs while disengaged is useful, so keep it.
2) WSs are just a subtype of job abilities in general, and not all job abilities can be used while disengaged (like steps). It'll never be perfect and will require a whitelist or blacklist that means upkeep. Upkeep is the enemy, so don't do it.
3) Using WSs and engaged-required JAs while disengaged is problematic and might get people banned if they're reported, so make a blacklist and accept that it'll never be perfect.
This is my current Ranger LUA file (using the lateste Mote-includes and extras though I had to edit out the gearswap_* in front of bind_on_load cuz it was erroring after the new Mote-Include) : http://pastebin.com/VQ5MjRKW
A couple questions.
1) Is there something similar to sets.engaged.* that can be used for ranged attacks? As you'll notice I have to have an if/then structure to make sure ranged attacks are changing with the offense mode (and so that there's a separate set for ranged attacks since it's not going to be the same as melee hits). Am I correct in thinking this sets.* bit probably has more to do with Mote's include than it does with GearSwap in general?
2) What exactly is required to be in precast and midcast, in another thread kept having people mention snapshot sets and all that bit, but is it possible to have a snapshot set in precast, then ratk/racc/etc stuff in midcast and still have both armor's benefit's proc? (like for example in post_precast I have WS belts being swapped since WS tend to be instant but my normal ranged attacks gear being swapped in midcast).
Ran into a problem with trying to reconfigure my GearSwap (http://pastebin.com/VQ5MjRKW)
I set up a precast for normal ranged attacks (ie: snapshot set so to speak), and then the rest of it as midcast. But I can't seem to get the precast to equip before the midcast, or least I'm not seeing it switch.
Code:-- Ranged Attack Sets (normal, not WeaponSkills) sets.precast.RA = { head="Sylvan Gapette +2", hands="Iuitl Wristbands", pants="Nahtirah Trousers"} -- AF3+2 5%, Iuitl 10%, Nahtirah 9% -- Impulse Belt (3%) Recommended for 4th "snapshot" item -- 5/5 Snapshot Merit gives 10% sets.midcast.RA = { head="Orion Beret",neck="Ocachi Gorget", hands="Manibozho Gloves",ring1="K'ayres Ring",ring2="Rajas Ring", back="Libeccio Mantle",waist="Scout's Belt"} sets.midcast.RA.Acc = set_combine(sets.midcast.RA, { neck="Ej Necklace", hands="Buremte Gloves",ring1="Paqichikaji Ring"}) sets.midcast.RA.TP = set_combine(sets.midcast.RA, { back="Sylvan Chlamys", ear2="Bladeborn Earring"}) -- Change to Scout's Beret +2 once augment is completed -- For Extra 5% TP per shot [w/o aug. mainly good for recycle]Code:function job_post_precast(spell, action, spellMap, eventArgs) if spell.name == 'Ranged' then -- Normal Ranged Attacks equip(sets.precast.RA) elseif spell.type:lower() == 'weaponskill' then -- compatible WS belt check if SoilBeltWS[spell.name] then equip({waist="Soil Belt"}) elseif LightBeltWS[spell.name] then equip({waist="Light Belt"}) end -- compatible WS gorget check if LightNeckWS[spell.name] then equip({neck="Light Gorget"}) end elseif spell.name == 'Spectral Jig' and buffactive.sneak then -- If sneak is active when using, cancel before completion send_command('cancel 71') end endUnless there's a better way to go about this.Code:function job_midcast(spell, action, spellMap, eventArgs) -- Normal Ranged Attack -- unless there's a similar method to the default sets.midcast.*, doing it manually here if spell.name == 'Ranged' then if state.OffenseMode == 'Acc' then equip(sets.midcast.RA.Acc) elseif state.OffenseMode == "TP" then equip(sets.midcast.RA.TP) else equip(sets.midcast.RA) end end end
Use //gs showswaps in game and it'll print out what it's changing to the chat log. You generally can't see precast gear if you change to something else in midcast.
I'm also curious, could I avoid having to manually if/then in the precast/midcast if I just use sets.precast.Ranged ? since in the documentation it has:
and since I'm already checking to see if the spell.name is Ranged, would the same principle not apply?.~type (ie: spell.type, such as .Waltz, .Jig, .CorsairShot, etc)
I got precast working the Mote way:
So I don't have to code in an if/then in post_precast, unfortunately the same method isn't working for midcast (ie: sets.midcast.Misc['Ranged'] doesn't trigger).Code:sets.precast.Misc['Ranged'] = { head="Sylvan Gapette +2", hands="Iuitl Wristbands", pants="Nahtirah Trousers"}
Nice went ahead and updated it, and appears to be working smoothly.
http://pastebin.com/VQ5MjRKW
Was just going over the lua files, and was wondering is there anything similar to validate, for example (marked with ---> <---):
The idea being that I could pass an equipment argument and would return true/false if that item exists in my inventory.Code:... -- Variables U_Shot_Ammo = S{'Aeolus Arrow','Animikii Bullet','Crossbow Bolt'} DefaultAmmo = {} DefaultAmmo["Eminent Gun"] = {ammo="Titanium Bullet"} DefaultAmmo["Echidna's Bow"] = {ammo="Tulfaire Arrow"} DefaultAmmo["Eminent Bow"] = {ammo="Tulfaire Arrow"} DefaultAmmo["Eminent Crossbow"] = {ammo="Bloody Bolt"} DefaultAmmo["Astrild"] = {ammo="Ruszor Arrow"} ... function job_precast(spell, action, spellMap, eventArgs) if spell.type:lower() == 'weaponskill' then if (spell.target.distance >8 and not ranged_ws[spell.name]) or (spell.target.distance >21) then -- Cancel Action if distance is too great, saving TP add_to_chat(122,"Distance too great for WeaponSkill /Canceling") eventArgs.cancel = true return elseif state.Defense.Active then -- Don't gearswap for weaponskills when Defense is on. eventArgs.handled = true end end if spell.name == "Ranged" or spell.type:lower() == 'weaponskill' then -- If ammo is empty, or special ammo being used without buff, replace with default ammo if U_Shot_Ammo[player.equipment.ammo] and not buffactive['unlimited shot'] or player.equipment.ammo == 'empty' then if DefaultAmmo[player.equipment.range] ---> and in_inventory(DefaultAmmo[player.equipment.range]) <--- then add_to_chat(122,"Unlimited Shot not Active or Ammo Empty, Using Default Ammo") equip(DefaultAmmo[player.equipment.range]) else add_to_chat(122,"!!Default ammo not available, not equipping") equip({ammo=empty}) end end end end ...
Cuz what I'm trying to do is:
Does a default ammo exist for the ranged weapon I'm using, if so, does it exist in the inventory, if so equip it, otherwise alert that it couldn't be equipped (either because the ammo doesn't exist, or there's no default ammo set for that weapon).
I added a player.inventory field in the last update, so you're looking for:
player.inventory['Tulfaire Arrow'] will also give you the number of Tulfaire Arrows that you have left (total number in inventory), if you want to make low-ammo warnings.Code:if DefaultAmmo[player.equipment.range] and player.inventory(DefaultAmmo[player.equipment.range]) then
player.case, player.satchel, and player.sack also work, if you want to give yourself some notification about where your Quivers are.
If it's 0, it won't show up at all since you won't have any. Thus, player.inventory["item I don't have"] will return nil, which will evaluate as false in a conditional check.
Noted, used your correction of the [] index (since his was shown with ()), and I had to change the way I configured the ammo type, since I can't pass {ammo="..."} to player.inventory.
Ended up with this:
I'll work in a low-ammo warning later (ie: I'd rather have it warn me once if It's under 15, but not every shot under 15).Code:DefaultAmmo["Eminent Gun"] = "Titanium Bullet" DefaultAmmo["Echidna's Bow"] = "Tulfaire Arrow" DefaultAmmo["Eminent Bow"] = "Tulfaire Arrow" DefaultAmmo["Eminent Crossbow"] = "Bloody Bolt" DefaultAmmo["Astrild"] = "Ruszor Arrow" ... if spell.name == "Ranged" or spell.type:lower() == 'weaponskill' then -- If ammo is empty, or special ammo being used without buff, replace with default ammo if U_Shot_Ammo[player.equipment.ammo] and not buffactive['unlimited shot'] or player.equipment.ammo == 'empty' then if DefaultAmmo[player.equipment.range] and player.inventory[DefaultAmmo[player.equipment.range]] then add_to_chat(122,"Unlimited Shot not Active or Ammo Empty, Using Default Ammo") equip({ammo=DefaultAmmo[player.equipment.range]}) else add_to_chat(122,"Either Default Ammo is Unavailable or Unknown Weapon. Staying empty") equip({ammo=empty}) end end end
Also note, a little problem I've been having in a side experiment: player.inventory uses the short names of items, not the full names (and a quick question to Byrth indicated that there wasn't an easy way to change between those). Often this won't matter, but in some cases it might. If you have a stack of Orichalcum Bullets, for example, player.inventory["Orichalcum Bullet"] will return nil, while player.inventory["Orichalc. Bullet"] will return 99.
Though if equip({ammo="..."}) will accept a short name, then for the sake of just that part I could just change the ammo's names to short. Tulfaire Arrow is fortunately the same as the short name, which is why I haven't noticed a problem as of yet. However Dark Adaman Bolt, I would need to go "Drk. Adm. Bolt", and as long as the equip() function takes it like that, I can work with it. (I'll just add a note above the default ammo, since my LUA file is the only ranger example in the shop thread).
I think I may have a better solution to the problem. Will see what Byrth thinks of it.
I posted in the other (AA) related Thread, but then read this one with the updates you guys have made to the RNG lua GearSwap files. I really do appreciate all the work and effort you put into this. I can't wait to get home and try it out.