Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some notes on script extraction #4

Open
miltoncandelero opened this issue Jan 18, 2024 · 0 comments
Open

Some notes on script extraction #4

miltoncandelero opened this issue Jan 18, 2024 · 0 comments

Comments

@miltoncandelero
Copy link

This project seems abandoned, but some notes in case a future traveler lands here trying to get a nice unpacking script for lune

  • Asking to not extract lua extracts the scripts into roblox model files... Not really what I expected 😅
    • The best way to actually not extract the lua files, is to keep the flag in true but stub the writeFile function
  • Empty folders are often confused with code folders, I "fixed" the isCodeTree function, it's slower than it was before (and is now recursive) but it understands better empty folders:
local function isCodeTree(instance: roblox.Instance)
	local toCheck = instance:GetDescendants()
	if #toCheck == 0 then
		return false
	end
	table.insert(toCheck, instance)
	for _, descendant in ipairs(toCheck) do
		-- If this descendant is not a lua script...
		if not isLuaSourceContainer(descendant.ClassName) then
			-- If it's a folder, recurse (unless for some reason we are our own grandfather)
			if descendant.ClassName == "Folder" then
				-- If our child is not a code tree, we are not a code tree :(
				if descendant ~= instance and not isCodeTree(descendant) then
					return false
				end
			else
				return false
			end
		end
	end
	return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant