Item Search
     
BG-Wiki Search
Page 175 of 302 FirstFirst ... 125 165 173 174 175 176 177 185 225 ... LastLast
Results 3481 to 3500 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #3481
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Ok so, my turn again.
    Reworking my NIN Lua which I haven't touched since september and creating a rule for the "Sange" JA.
    For those of you who don't know yet, the Shuriken which doesn't normally get consumed with Daken job trait, it gets consumed during Sange (which brings Daken activation rate to 100%, i.e. once per attack round).
    Basically you want to swap your "cool" shuriken that you normally equip in your TP sets, for a "cheap" shuriken to be thrown while Sange is active.
    This would be normally very easy, but you want to avoid some situations, like the following:

    • There is a small "delay" when using buffactive checks between the server activation and client notification, which means under certain circumstances the "cool" shuriken could still stay equipped for the first second of the JA activation, meaning you could accidentally throw it
    • Simply putting the "cheap" shuriken in your Sange precast wouldn't be enough. What if you forget to put the shuriken in your inventory or if you ran out of it?
    • player.inventory['shuriken name'] could be used to perform security checks, but from my experience this isn't 100% reliable, so I'd rather not trust it before losing a very rare/expensive item


    This is what I thought of, please take your time to read it and tell me if I missed something, or if it's looking "secure" enough.

    Code:
    function get_sets()
    ...
    
    sets.TP.ammo = {name="Happo Shuriken +1"}
    sets.TP.Basic.Normal = {..., ammo=sets.TP.ammo, ...}
    sets.TP.Basic.Acc = ...
    sets.TP.NoDW.Normal = ...
    
    ...
    
    sets.precast.Sange = {body="Mochizuki Chainmail +1", ammo=empty}
    
    ...
    
    end
    
    
    function precast(spell,action)
    	if sets.precast[spell.english] then
    		equip(sets.precast[spell.english])
    	elseif ...
    		...
    	end
    	if spell.english == "Sange" and not spell.interrupted then
    		sets.TP.ammo.name = "Hachiya Shuriken"
    	end
    end
    Then of course I'd need more stuff in a buff_change function to set the .name back to Happo etc, but I know how to do that myself since I've done it already in other luas and it works.
    So... opinions?
    Safe enough? Working?

  2. #3482
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    For Lyramion:
    Put the get_sets stuff anywhere in your get_sets function. Note that the names I used are just placeholders, you might already have some of those sets, in which case you'd just need to update them.

    For midcast and precast those IFs need to be integrated into the if tree you likely already have in those two functions in your lua, ideally on top or more towards the top than the end.

    For the self_command one, if you already have such a function copy paste the content of mine info yours. If you don't have it then simply copy paste the whole function from my example and put it at the end of your lua.


    More's files see really deep and complex, but if you post your lua on pastebin and link it her I can try to give you a hand with the implementation.

  3. #3483
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Ok, so trying to get into this Gearswap thing. I'm using Byrth's THF lua, put most of my gear in place of his, but not sure on a few things.

    How do I toggle between weapons. He has 5 main daggers listed there. My main is always Mandau, but I sometimes use Sandung/Atoyac/Izhiikoh for my sub, how would I set that up and toggle between them?

  4. #3484
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    How does this toggle the variable for Impactmode. I dont understand the " Impactmode = (Impactmode=='default' and 'special' or 'default') " part is what I mean. Could someone explain this to me in stupid person terms. I thought I understood how to use "= and or ==" but maybe I dont after all.

    Ive used code similiar to what Sechs wrote in all my luas, but usually using a index number kind of thing instead of direct variables (usually I have had more than 2 variables I want to toggle thru though).

    Code:
    function self_command(command)
        ...
        if command == 'impactmode' then
            Impactmode = (Impactmode=='default' and 'special' or 'default')
        end
    end

  5. #3485
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Oh sadly I don't get that part either. Does it work actually? I assume so, but I don't understand how inside that "if" the variable Impactmode gets assigned different values according to... to what? Maybe it's because it's a boolean, only 2 possible values, that line serves to check what the current value is and then swaps to the only other possible one?
    Just my guess, I don't really know, sorry...

  6. #3486
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Ok, so now I've changed to using Kinematics LUA for THF. I have my gear in, gearswap is loaded, it's automatically changing me to my idle sets outside of combat and to my ws sets when I use a ws. But...it's not changing to my tp set in combat. How do I toggle that on? What is the command to equip my gear?

  7. #3487
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Nevermind what I said before, I'm a bit confused on how to handle the buff_change part for Sange.
    I handled pretty much everything between variables, precast and aftercast, there's one last thing I need to handle: reset the ammo variable to the default value once the "Sange" buff expires or gets dispelled or I zone etc.
    I assume this is done with the buff_change function, but how can I do it?

    Code:
    function buff_change(buff, gain)
    	if state.Buff[buff] ~= nil then
    		state.Buff[buff] = gain
    	end
    	if state.Buff[buff] = false then
    		sets.TP.ammo.name = "Happo Shuriken +1"
    	end
    end
    Is this safe enough?
    I'm taking a lot of precautions to avoid shooting that Happo accidentally...

  8. #3488
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Trumpy View Post
    How does this toggle the variable for Impactmode. I dont understand the " Impactmode = (Impactmode=='default' and 'special' or 'default') " part is what I mean. Could someone explain this to me in stupid person terms. I thought I understood how to use "= and or ==" but maybe I dont after all.

    Ive used code similiar to what Sechs wrote in all my luas, but usually using a index number kind of thing instead of direct variables (usually I have had more than 2 variables I want to toggle thru though).

    Code:
    function self_command(command)
        ...
        if command == 'impactmode' then
            Impactmode = (Impactmode=='default' and 'special' or 'default')
        end
    end
    this line
    Impactmode = (Impactmode=='default' and 'special' or 'default')

    is the same as this
    if Impactmode == 'default' then
    Impactmode = 'special'
    else
    Impactmode = 'default'
    end

    but what it actualy is
    <check> and <if true> or <if false>

  9. #3489
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Sechs View Post
    Nevermind what I said before, I'm a bit confused on how to handle the buff_change part for Sange.
    I handled pretty much everything between variables, precast and aftercast, there's one last thing I need to handle: reset the ammo variable to the default value once the "Sange" buff expires or gets dispelled or I zone etc.
    I assume this is done with the buff_change function, but how can I do it?

    Code:
    function buff_change(buff, gain)
    	if state.Buff[buff] ~= nil then
    		state.Buff[buff] = gain
    	end
    	if state.Buff[buff] = false then
    		sets.TP.ammo.name = "Happo Shuriken +1"
    	end
    end
    Is this safe enough?
    I'm taking a lot of precautions to avoid shooting that Happo accidentally...
    Do you use Mote's? If so, there's a final entry point you can take advantage of before set construction called customize_melee_set()

    Otherwise, buff_change should be ok. I might do something like this.

    Code:
    if buff == 'Sange' and not gain then
        sets.TP.ammo.name = 'Happo Shuriken +1"
    end
    OR

    I haven't seen the rest of your code, but Mote's implementation of state.Buff goes beyond adding it to buff_change. If you go this route, I would add this to precast
    Code:
     if state.Buff[spell.english] ~= nil then
    state.Buff[spell.english] = true
    end
    and this to aftercast
    Code:
     if state.Buff[spell.english] ~= nil then
        state.Buff[spell.english] = not spell.interrupted or buffactive[spell.english] or false
    end
    as well as initializing state.Buff.Sange in one of your setup functions. i.e.
    state.Buff.Sange = buffactive.Sange or false

    I'd definitely test with the NQ shuriken

  10. #3490
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Nope not using Mote, altough that line was originally suggested by him for another lua of mine, to handle a similar situation (not exactely the same).
    Regardless, thanks for the tips



    Edit:
    Thinking again about the first part of the buff_change line I wrote, it makes no sense in my NIN lua atm. In the LUA it originally comes from (DNC) it does make sense because I used it for multiple buffs and I used those variables for various checks throughout the Lua.
    In my NIN lua I don't need all of this, I only need to check "If I lose sange buff, then execute this command". Just that, don't need to set that useless variable to either true or false according to the value of gain.
    Something like this:

    Code:
    function buff_change(buff, gain)
    	if buff == "Sange" and gain == false then
    		sets.TP.ammo.name = "Happo Shuriken +1"
    	end
    end
    All the other checks for when I gain the buff are done in another way, so I really don't need that variable. The only purpose of my buff_change function is to parse for when the buff runs out, or gets dispelled or I cancel it, and when that happens set the ammo variable back to the original value.

  11. #3491
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Quote Originally Posted by Kanriel View Post
    Ok, so now I've changed to using Kinematics LUA for THF. I have my gear in, gearswap is loaded, it's automatically changing me to my idle sets outside of combat and to my ws sets when I use a ws. But...it's not changing to my tp set in combat. How do I toggle that on? What is the command to equip my gear?
    ...anyone? I don't know how to call gearswap in-game. None of the //gs c toggle or //gs equip <whatIthinkthenameofsetis> commands are working. It says "No set by that name". I'm using default set names listed by Kinematics THF lua, but none of them are operating.

  12. #3492
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    I don't know Motenten's Luas Kanriel, they have a lot of depth and complexity, I'm bit able to help ya sorry, or I would have posted something already.

  13. #3493
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Quote Originally Posted by Sechs View Post
    I don't know Motenten's Luas Kanriel, they have a lot of depth and complexity, I'm bit able to help ya sorry, or I would have posted something already.
    What is the command you utilize in your lua's to call your tp set, and what's the tp set in your lua written in your game? I might be able to make it work with that information.

  14. #3494
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Kanriel View Post
    What is the command you utilize in your lua's to call your tp set, and what's the tp set in your lua written in your game? I might be able to make it work with that information.
    Pastebin your lua and I'll take a look. sets.engaged should be your engaged set for tp, and it should work out of the box.

    Just to clarify you don't need a command. Your gear will change when you engage something

  15. #3495
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Quote Originally Posted by Orestes View Post
    Pastebin your lua and I'll take a look. sets.engaged should be your engaged set for tp, and it should work out of the box.

    Just to clarify you don't need a command. Your gear will change when you engage something
    http://pastebin.com/8j5bZqhn

    And yeah I thought it was supposed to change when I engage something, but that's not happening.

  16. #3496
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Kanriel View Post
    http://pastebin.com/8j5bZqhn

    And yeah I thought it was supposed to change when I engage something, but that's not happening.
    Run //gs validate

    See if it tells you anything needs to be fixed.

  17. #3497
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Quote Originally Posted by Orestes View Post
    Run //gs validate

    See if it tells you anything needs to be fixed.
    It has a list of gear that I don't have in my inventory, I guess if I remove those from the file it'll work? Figured if I just didn't use those sets it would be fine...

    Hmm, it seems it's still loading the Byrth lua I first ran, and not the one I've edited, since it's showing gear "missing" that I don't have in my pastebin file at all.

  18. #3498
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Kanriel View Post
    It has a list of gear that I don't have in my inventory, I guess if I remove those from the file it'll work? Figured if I just didn't use those sets it would be fine...

    Hmm, it seems it's still loading the Byrth lua I first ran, and not the one I've edited, since it's showing gear "missing" that I don't have in my pastebin file at all.
    Just take the old one out of your data folder. Once it loads motes, you should be ok since I couldn't find any syntax errors or obvious issues. Only thing I really noticed, was a Mod2 set was specified. (there was no Mod2 OffenseMode)

    validating is very handy though. Always check it when things act up.

  19. #3499
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    Quote Originally Posted by Orestes View Post
    Just take the old one out of your data folder. Once it loads motes, you should be ok since I couldn't find any syntax errors or obvious issues. Only thing I really noticed, was a Mod2 set was specified. (there was no Mod2 OffenseMode)

    validating is very handy though. Always check it when things act up.
    Well, I'm a big fucking idiot. I had copied Byrth's file into my data folder, then I pasted the other file I was going to use over into the beta examples thread. And so everything I was changing was in the examples folder and not in the main folder for gearswap...

    Pretty sure it's all working now. Thanks for the help.

  20. #3500
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by Kanriel View Post
    What is the command you utilize in your lua's to call your tp set, and what's the tp set in your lua written in your game? I might be able to make it work with that information.
    Depends on the job.
    On NIN and DNC the structure of my TP set is
    sets.TP.name.mode

    name is the name of the set (solo/haste30/noDualWield), mode is the mode (normal/accuracy)
    So for instance:

    sets.TP.solo.normal
    sets.TP.noDW.accuracy

    And so on.
    I don't have a "command" I use to set them up. I have an algorythm. They get equipped in the "status_change" function and in the "aftercast" function according to the criteria I defined.
    Well to be exact those 2 functions equip the "current set".
    Current set is the "solo" one by default, I cycle through my available sets through two hotkeys in my G19 keyboard. One activates/turns off accuracy mode, the other cycles between the 3 sets at each press. These 2 functions are defined in the "self_command" part of the Lua.

Page 175 of 302 FirstFirst ... 125 165 173 174 175 176 177 185 225 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45