Skip to content

Mod loading broken on Android (ProjectSettings.load_resource_pack) #54917

Description

@mrimvo

Godot version

3.4 stable

System information

Ubuntu 18.04

Issue description

I'm working on an Android Game, which supports loading user-made mods.

ProjectSettings.load_resource_pack( some_mod_zip, false )

This line would replace the contents of res:// instead of just adding the mod contents.

Steps to reproduce

  1. Download the example project
  2. load it in Godot Editor
  3. Run it on Android.

Minimal reproduction project

Mod-Loading-Android.zip

Main.gd from the example project:

extends Node


# This works on all platforms, EXCEPT
# - on Android
# - in the Godot Editor

func _ready():
	$TextEdit.text = "Original Files\n"
	$TextEdit.text += str(list("res://")) + "\n"
	ProjectSettings.load_resource_pack("res://Mod.zip", false)
	$TextEdit.text += "After Mod-Loading (expected: original files + Mod.gdc)" + "\n"
	$TextEdit.text += str(list("res://")) + "\n"


func list(path):
	var pathes = []
	var dir = Directory.new()
	if dir.open(path) == OK:
		dir.list_dir_begin(true)
		while true:
			var file = dir.get_next()
			if not file: break
			pathes.append(file)
	return pathes

The output is something like this:

Original Files
[.import, Main.gd.remap, Main.gdc, Main.tscn, Mod.zip, default_env.tres, icon.png, icon.png.import, project.binary]
After Mod-Loading (expected: original files + Mod.gdc)
[Mod.gdc]

Expected: The original files and the Mod.gdc should be in res://
Observed: the original files disappeared.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions