@yojimbo2000 created a really cool looking Star Wars trench run game thing, see attached screenshot.
It won’t run anymore; attached is a zip of it.
If anyone can help get it working that would be awesome.
I’ve attached an image of the error. This is a frustrating thing that happens with a lot of things I download: Codea shows an error and claims that a function is a nil value when it’s actually not. It’s right there in the file but Codea doesn’t;t seem to see it. Sometimes it seems like old downloaded projects can’t see class functions. @Simeon, could there be something to that?
Anyway, if you want to see it run a little bit, copy and paste this installer into a new project:
local url = "https://raw.githubusercontent.com/Utsira/Codea-OBJ-Importer/master/TrenchRun.codea/"
local function install(data)
--parse plist into list of tab files
local array = data:match("<key>Buffer Order</key>%s-<array>(.-)</array>")
local files = {}
for tabName in array:gmatch("<string>(.-)</string>%s") do
table.insert(files, {name = tabName})
end
--success function
local function success(i, name, data)
if not data then alert("No data", name) return end
print("Loaded "..i.."/"..#files..":"..name)
files[i].data = data
for i,v in ipairs(files) do
if not v.data then
return --quit this function if any files have mssing data
end
end
--if all data is present then save...
for i,v in ipairs(files) do
saveProjectTab(v.name, v.data)
print("Saved "..i.."/"..#files..":"..v.name)
end
for i,v in ipairs(files) do --load...
load(v.data)()
end
setup() --and run
end
--request all the tab files
for i,v in ipairs(files) do
http.request(url..v.name..".lua", function(data) success(i, v.name, data) end, function(error) alert(error, v.name.." not found") end)
end
end
http.request(url.."Info.plist", install, function (error) alert(error) end)
It will run a little and then crash, but as soon as you exit to the editor it won’t fully run again ever.