Page 1 of 1

Fbi2Lua is broken.

Posted: 15 Apr 2012, 06:03
by smoth
local success, defs = pcall(VFS.Include, 'gamedata/defs.lua', defsEnv)

defs.unitdefs and defs.featuredefs show up as empty tables.

Any ideas?

Re: Fbi2Lua is broken.

Posted: 15 Apr 2012, 06:28
by smoth
yeah it is there in 77b5 so why can I not see it now?

Re: Fbi2Lua is broken.

Posted: 15 Apr 2012, 16:14
by jK
The `success` return argument isn't there for nothing.

Re: Fbi2Lua is broken.

Posted: 15 Apr 2012, 16:20
by smoth
It was returning true btw. I also had to add some bs hack to get that far:

vfsutils.lua

Code: Select all

function RecursiveFileSearch(startingDir, fileType, vfsMode)
  local files = {}
  local function AddSubDir(dir)
	--bs hack	
	if vfsMode == nil then
		vfsMode = VFS.RAW
	end
	--bs hack

	--Spring.Echo(dir, fileType, vfsMode)
    for _,file in ipairs(VFS.DirList(dir, fileType, vfsMode)) do
      files[#files + 1] = file
    end
    for _,sd in ipairs(VFS.SubDirs(dir, "*", vfsMode)) do
      AddSubDir(sd)
    end
  end

  AddSubDir(startingDir)

  return files
end

Re: Fbi2Lua is broken.

Posted: 16 Apr 2012, 01:45
by jK
It has some VFS issue I never investigated, cause it always worked when either run from lobby or spring.exe (forgot which one worked).

Re: Fbi2Lua is broken.

Posted: 16 Apr 2012, 02:23
by smoth
possibly lobby, I was trying in spring.exe.