Item Search
     
BG-Wiki Search
Page 222 of 302 FirstFirst ... 172 212 220 221 222 223 224 232 272 ... LastLast
Results 4421 to 4440 of 6036

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

  1. #4421
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    Thx, actually it works (tried it at the very start of precast and and the very start of pretarget function) but it saves my precasted gears instead of the one I had before my cast.

    Then its very close, but I'm not sure I can do that directly like that.
    Thx again for the info !

    -edit-
    works with a "self_command" , like one for lock gears and another one to unlock manually
    but wanted do that more automatically.

  2. #4422
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    if your using motes include it might change gear before it hits the user precast/pretarget functions

  3. #4423
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    I have not included any files so far, I started with a fresh clean new file (was following ffxiah tutorial at start).
    Should I include one of the Motes file ?

  4. #4424
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Aelyn View Post
    I have not included any files so far, I started with a fresh clean new file (was following ffxiah tutorial at start).
    Should I include one of the Motes file ?
    can you post your file so i can look at it??

  5. #4425
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    new to paste bin too
    it works?
    http://pastebin.com/fkuV1RXW

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

    here try this one http://pastebin.com/4UTUtfaU (it will be unavailable in 1 hr)

    you can also do some simplification of your code if you tried

  7. #4427
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    its not that too, it seems.
    Can you explain briefly what you tried to do in my precast ?
    maybe some sets.backup=player.equipment is missing somewhere in your file? dont find it

    Btw I was just testing this kind of mechanism with my whm, to find how do that for another job , pld, or for some very specific JA (like benediction/devotion etc..) :
    When I do stuff like Sentinel, I would
    > pop the relic gear precast,
    > then aftercast come back to the gears I had before the cast (even if I had equiped some dumb lv1 gears to have fun )
    thx for the help btw

    (gearswap is really interesting to dig in, had no idea)

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

    Quote Originally Posted by Aelyn View Post
    its not that too, it seems.
    Can you explain briefly what you tried to do in my precast ?
    maybe some sets.backup=player.equipment is missing somewhere in your file? dont find it

    Btw I was just testing this kind of mechanism with my whm, to find how do that for another job , pld, or for some very specific JA (like benediction/devotion etc..) :
    When I do stuff like Sentinel, I would
    > pop the relic gear precast,
    > then aftercast come back to the gears I had before the cast (even if I had equiped some dumb lv1 gears to have fun )
    thx for the help btw

    (gearswap is really interesting to dig in, had no idea)
    sorry in the one i posted to you replace line: 355: equip(sets.backup)
    with: sets.backup = player.equipment
    i goofed my bad

    if you think GS is interesting check out my gearswap include (but be for warned it is for highly advanced users but you might like it once you look at it)
    https://github.com/smd111/Gearswap

  9. #4429
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    hmm, weird, seems not to work still
    and yes its WIP, learning, testing, trying stuff, googling for infos little by little.

    with my whm file, I look mainly for easy edition to change quickly precast/midcast policy for any spells if I change my mind, and add some other spells little by little. If you have seen stupid stuff, or really important missing stuff, I'm interested. But dont want steal your time. (btw have to leave now)

  10. #4430
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    did you turn it on with
    //gs c b

    its set up so you can turn it on and off depending on if you want to use it or not

    and i dont mind helping

  11. #4431
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle

    yes yes , and it does like my first try earlier.

    It switchs back on a set, but its clearly my precast one, like it was the precast set which was backuped.
    I dont get it so far, my backup line and yours are before any equip() call in precast function.

    - edit -
    ok I printed in the log one of the equipment right after the bacup, and at the end. The proper gear is backuped but its nomore the same gear at the end.

    I think its something relative to pointers or something like that. I mean I should copy the whole table and not just do "sets.backup = player.equipment" which seems to copy only the reference to the table and not a copy. Will try later.

  12. #4432
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Aelyn View Post
    yes yes , and it does like my first try earlier.

    It switchs back on a set, but its clearly my precast one, like it was the precast set which was backuped.
    I dont get it so far, my backup line and yours are before any equip() call in precast function.

    edit
    ok I printed in the log one of the equipment, the proper is backuped but its not the same at the end. I think its something relative to pointers or something like that. I mean I should copy the whole table and not just do
    sets.backup = player.equipment which seems to copy only the reference to the table and not a copy
    ok change
    sets.backup = player.equipment
    to
    Code:
    for i,v in pairs(player.equipment) do
             sets.backup[i] = v
    end
    also if your looking for a good piece of software to use for file editing a free one is Notepad++

  13. #4433
    RIDE ARMOR
    Join Date
    May 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Carbuncle


    Thx it works, thats it !!

  14. #4434
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    no problem if you have any more questions dont hesitate to ask

  15. #4435
    RIDE ARMOR
    Join Date
    Mar 2014
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    Just curious is there anything that affects why my gear won't swap when I switch offensemodes?

  16. #4436
    Melee Summoner
    Join Date
    Jul 2014
    Posts
    44
    BG Level
    1
    FFXI Server
    Phoenix

    Im thinking of adding a magic burst event in my geo lua. Could someone tell me how to add it.
    So it wil load if parameters are met. So if i cast with like 2 sec on a sc then it will load my mb gear instead of my normal nuke gear.
    Is this possible?

  17. #4437
    New Spam Forum
    Join Date
    Aug 2007
    Posts
    163
    BG Level
    3
    FFXI Server
    Cerberus

    Having a bit of an issue with text boxes and I haven't been able to find any resources to solve my particular problem. I'm trying to incorporate a text box display in my gearswap lua file. Everything works fine except when I left-click anywhere on the screen I get a Gearswap runtime error "libs/texts.lua:612: attempt to index local 'm' (a nil value)"

    I don't have a config file because when I try to add one, I get more runtime errors that I understand even less than this one and it breaks functionality entirely. I don't use any includes in my gearswap file, it's entirely standalone.

    Here's the only texts-relevant code that I have in my character_job gearswap lua:

    Code:
    texts = require('texts')
    
    box = {}
    box.pos = {}
    box.pos.x = -230
    box.pos.y = 21
    box.bg = {}
    box.bg.alpha = 0
    box.bg.red = 0
    box.bg.green = 0
    box.bg.blue = 0
    box.bg.visible = true
    box.flags = {}
    box.flags.right = true
    box.flags.bottom = false
    box.flags.bold = true
    box.flags.draggable = false
    box.flags.italic = false
    box.padding = 0
    box.text = {}
    box.text.size = 11
    box.text.font = 'Arial'
    box.text.fonts = {}
    box.text.alpha = 255
    box.text.red = 0
    box.text.green = 255
    box.text.blue = 0
    box.text.stroke = {}
    box.text.stroke.width = 1
    box.text.stroke.alpha = 255
    box.text.stroke.red = 0
    box.text.stroke.green = 0
    box.text.stroke.blue = 0
    
    window = texts.new(box)
    Any help would be appreciated. It's driving me nuts.

  18. #4438
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Question: What are you using the text box for? I've kinda wondered if there was something i could use some for but off hand cant think of anything.

  19. #4439
    New Spam Forum
    Join Date
    Aug 2007
    Posts
    163
    BG Level
    3
    FFXI Server
    Cerberus

    I'm planning on using it to keep a display of which nuking and/or idle sets I currently have toggled. (e.g. pdt vs refresh idle set, etc..)

  20. #4440
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    Edit: Scratch that: gearswap loads the texts library. You should be able to access it through the user_env table.

    Spoiler: show
    Not all libraries are compatible with gearswap. Normally, when texts.lua is loaded by an addon the following takes place:
    1. a table locally named texts is created and then keyed with all of the methods of the texts library
    2. a function is added to the list of functions that are run when the mouse event is called to handle the drag-and-drop behavior of text objects
    3. the local texts table is returned (which is why you need to write "texts = require('texts')" and not "require('texts')")


    All functions, variables, etc. exist within an environment (a fancy word for a table). The function added to the mouse event can access the functions, variables, etc. defined in texts.lua because they share an environment. However, because everything within the texts.lua is handled locally, anything past the line "texts = require('texts')" cannot access the code within texts.lua because it does not share an environment.

    When a user file is loaded by gearswap, the code is modified by some preexisting code (take a quick look only at the bold parts):
    Code:
     user_env = {gearswap = _G, _global = _global, _settings = _settings,_addon=_addon,
            -- Player functions
            equip = equip, cancel_spell=cancel_spell, change_target=change_target, cast_delay=cast_delay,
            print_set=print_set,set_combine=set_combine,disable=disable,enable=user_enable,
            send_command=send_cmd_user,windower=user_windower,include=include_user,
            midaction=user_midaction,pet_midaction=user_pet_midaction,set_language=set_language,
            show_swaps = show_swaps,debug_mode=debug_mode,include_path=user_include_path,
            register_unhandled_command=user_unhandled_command,
            
            -- Library functions
            string=string,math=math,table=table,set=set,list=list,T=T,S=S,L=L,pack=pack,
            os=os,texts=texts,type=type,tostring=tostring,tonumber=tonumber,pairs=pairs,
            ipairs=ipairs, print=print, add_to_chat=add_to_chat_user,unpack=unpack,next=next,
            select=select,lua_base_path=windower.addon_path,empty=empty,file=file,
            loadstring=loadstring,assert=assert,error=error,pcall=pcall,io=io,dofile=dofile,
            
            debug=debug,coroutine=coroutine,setmetatable=setmetatable,getmetatable=getmetatable,
            rawset=rawset,rawget=rawget,require=include_user,
    Code:
    user_windower = {register_event = register_event_user, raw_register_event = raw_register_event_user,
        unregister_event = unregister_event_user, send_command = send_cmd_user,add_to_chat=add_to_chat_user}
    setmetatable(user_windower,{__index=windower})
    Code:
    function register_event_user(str,func)
        if type(func)~='function' then
            error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(func)..'). (must be a function)', 2)
        elseif type(str) ~= 'string' then
            error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(str)..'). (must be a string)', 2)
        end
        local id = windower.register_event(str,user_equip_sets(func))
        registered_user_events[id] = true
        return id
    end
    The windower table that the user file has access to is a slightly different version of the windower table gearswap has access to. Crucially, when the register_event function in the windower table is called by texts.lua (being loaded into your user file) to handle the drag-and-drop behavior, the modified windower.register_event calls this function, which changes the text library's mouse function's environment:
    Code:
    function user_equip_sets(func)
        return setfenv(function(...)
                if not gearswap.gearswap_disabled then
                    gearswap.refresh_globals(true)
                    return gearswap.equip_sets(func,nil,...)
                end
            end,user_env)
    end
    (setfenv is short for set_function_environment). As a result, the function can't see the code within texts.lua anymore, and you receive an error when it tries to look up a value in the table 'meta', which exists within texts.lua but not within the user file's user_env environment.

Page 222 of 302 FirstFirst ... 172 212 220 221 222 223 224 232 272 ... LastLast

Similar Threads

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