Jump to content


Photo

GearSwap creating an Include Path

Gearswap

Best Answer Aliquis , 18 June 2017 - 02:08 PM

Firstly, thank you for responding.

 

Ok, when I said, "...\gearswap ...\gearswap\libs ...\gearswap\data" I did mean within the ...\windower4\addons\GearSwap path.

 

what you got going there is a bit more extensive than I would want within my job files or how I would want approach it personally. However I see at the top of your include paths it starts with... 

include('SMDinclude/includes/Include.lua')
 

So I'm guessing that I can use that to accomplish what I'm trying to do. Basically make a folder "AliquisIncludes" in the GearSwap folder and place my first include "Include.lua" within that new folder.

 

So within my job lua's I can simply initialize my include with this?

include('AliquisIncludes/Include.lua')
 
Go to the full post


  • Please log in to reply
2 replies to this topic

#1 Aliquis

Aliquis

    Member

  • Members
  • PipPip
  • 16 posts
  • LocationUSA

Posted 14 June 2017 - 10:19 PM

I can't for whatever get include_path('string') to function. Ive tried it using function user_include_path('string') also. I even placed the same folder in ...\gearswap ...\gearswap\libs ...\gearswap\data all at the same time and still get the same error.

 

<name> or '...' expected near 'My-Includes'

 

I've read the variables.xlsx which gave little info, I read line 302 down of user_functions.lua and all the info that is given is,

 

-- Allow the user to set a path subdirectory to check when searching for included files. -- This path is checked as a subdirectory to each fixed path, before the fixed path itself is checked.

-- Path argument can only be a string; otherwise this is set to nil.

 

As far as I know a string is 'word' and I assume it means the folder name. I've tried path directories, I've tried tying the paths with multiple strings.

 

What am I doing wrong here?



#2 sdahlka

sdahlka

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts

Posted 17 June 2017 - 01:40 PM

i have no idea what path your using for your include but my include paths are like this
 
include('SMDinclude/includes/Include.lua')
function load_include(a,b)
    if a and not Disable_All then
        if gearswap.pathsearch({"SMDinclude/includes/"..b}) then
            include("SMDinclude/includes/"..b)
        else
            error("Unable to find include file SMDinclude/includes/"..b)
        end
    end
end
load_include(MJi, 'mjob/main_job_'..player.main_job..'.lua')
load_include(SJi, 'sjob/sub_job_'..player.sub_job..'.lua')
load_include((MSi and jobs.magic:contains(player.main_job)), 'more/MSi.lua')
load_include((Ammo and jobs.ammo:contains(player.main_job)), 'more/Ammo.lua')
load_include(Special_Weapons, 'more/Special_Weapons.lua')
load_include(Conquest_Gear, 'more/Conquest_Gear.lua')
load_include(true, 'more/Registered_Events.lua')
load_include(Debug, 'more/Debug.lua')
load_include(true, 'more/Display.lua')
load_include(File_Write, 'more/File_Write.lua')
load_include((player.main_job == "NIN" or player.sub_job == "NIN"), 'more/Ninja_Tool.lua')
load_include((player.main_job == "COR" or player.sub_job == "COR"), 'more/CorsairShot_Cards.lua')
load_include((player.main_job == "DNC" or player.sub_job == "DNC"), 'more/DNC_Potency.lua')
load_include((player.main_job == "WHM" or player.sub_job == "WHM"), 'more/WHM_Potency.lua')
load_include(true, 'more/Commands.lua')
load_include(true, 'more/Spell_control.lua')
 
you files must be in one of these folders no mater what
 
Windower4\addons\libs-dev\
Windower4\addons\libs\
Windower4\addons\GearSwap\data\<player.name>\
Windower4\addons\GearSwap\data\common\
Windower4\addons\GearSwap\data\
Windower4\addons\GearSwap\<player.name>\
Windower4\addons\GearSwap\common\
Windower4\addons\GearSwap\
 
so you cant put them on your c drive (aka. ; C:\geaswap files)

#3 Aliquis

Aliquis

    Member

  • Members
  • PipPip
  • 16 posts
  • LocationUSA

Posted 18 June 2017 - 02:08 PM   Best Answer

Firstly, thank you for responding.

 

Ok, when I said, "...\gearswap ...\gearswap\libs ...\gearswap\data" I did mean within the ...\windower4\addons\GearSwap path.

 

what you got going there is a bit more extensive than I would want within my job files or how I would want approach it personally. However I see at the top of your include paths it starts with... 

include('SMDinclude/includes/Include.lua')
 

So I'm guessing that I can use that to accomplish what I'm trying to do. Basically make a folder "AliquisIncludes" in the GearSwap folder and place my first include "Include.lua" within that new folder.

 

So within my job lua's I can simply initialize my include with this?

include('AliquisIncludes/Include.lua')
 






Also tagged with one or more of these keywords: Gearswap

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users