ERR_COMPILATION_FAILED while loading .gdc

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sxkod

I am on linux, lubuntu, using Godot 3.0.2 x64.

I am struggling with DLC on godot engine. I made some worlds/game environments that I exported as a zip file. I put them in a different game in the user:// as zip files and use ProjectSettings.load_resource_pack to load them. Now all the exported zip files contain a root.tscn that should launch that game using get_tree().change_scene(“res://root.tscn”).

However some scenes work but some don’t It appears the problem may be that the bytecode parser is not happy. I will add the logs below.

Any guidance greatly appreciated.

Thanks all

#########
After loading my pillar.zip >>

listing of res://

0>.import
1>models
2>scripts
3>textures
4>bricks1.jpg.import
5>default_env.tres
6>icon.png
7>icon.png.import
8>pillarscene.tscn
9>ply.tscn
10>portal.tscn
11>project.binary
12>root.gd.remap
13>root.gdc
14>root.tscn

listing of res://scripts

0>cam.gd.remap
1>cam.gdc
2>globals.gd.remap
3>globals.gdc
4>godview.gd.remap
5>godview.gdc
6>ply.gd.remap
7>ply.gdc
8>portal.gd.remap
9>portal.gdc
10>signals.gd.remap
11>signals.gdc

For reference - the listing of the zip file:

Archive:  pillar.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   482391  1980-00-00 00:00   .import/bricks1.jpg-637d8bdbbe22a60640b64e3c83263cc7.stex
      658  1980-00-00 00:00   bricks1.jpg.import
     2635  1980-00-00 00:00   default_env.tres
     3533  1980-00-00 00:00   .import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex
      649  1980-00-00 00:00   icon.png.import
    31731  1980-00-00 00:00   .import/world.dae-39bdd8c3b72227b678606e2fe01d90a4.scn
    31830  1980-00-00 00:00   models/world.dae.import
   142864  1980-00-00 00:00   pillarscene.tscn
     4661  1980-00-00 00:00   ply.tscn
     3076  1980-00-00 00:00   portal.tscn
      356  1980-00-00 00:00   root.gdc
      734  1980-00-00 00:00   root.tscn
      331  1980-00-00 00:00   scripts/cam.gdc
      519  1980-00-00 00:00   scripts/globals.gdc
      168  1980-00-00 00:00   scripts/godview.gdc
     4330  1980-00-00 00:00   scripts/ply.gdc
     1325  1980-00-00 00:00   scripts/portal.gdc
      212  1980-00-00 00:00   scripts/signals.gdc
   918156  1980-00-00 00:00   .import/boaty.jpg-073eba04c47949f2f7aa11552930fbb8.s3tc.stex
      828  1980-00-00 00:00   textures/boaty.jpg.import
       31  1980-00-00 00:00   root.gd.remap
       38  1980-00-00 00:00   scripts/cam.gd.remap
       42  1980-00-00 00:00   scripts/globals.gd.remap
       42  1980-00-00 00:00   scripts/godview.gd.remap
       38  1980-00-00 00:00   scripts/ply.gd.remap
       41  1980-00-00 00:00   scripts/portal.gd.remap
       42  1980-00-00 00:00   scripts/signals.gd.remap
     3498  1980-00-00 00:00   icon.png
      709  1980-00-00 00:00   project.binary
---------                     -------
  1635468                     29 files

In the Debugger- I see the following errors.

0:00:04:0792 - Method/Function Failed, returning: ERR_COMPILATION_FAILED
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: Method/Function Failed, returning: ERR_COMPILATION_FAILED
C Source: modules/gdscript/gdscript.cpp:772
C Function: load_byte_code

0:00:04:0792 - Condition ' err != OK ' is true. returned: RES()
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: Condition ' err != OK ' is true. returned: RES()
C Source: modules/gdscript/gdscript.cpp:1848
C Function: load

0:00:04:0792 - Failed loading resource: res://scripts/portal.gdc
----------
Type:Error
Description: Failed loading resource: res://scripts/portal.gdc
Time: 0:00:04:0792
C Error: Method/Function Failed, returning: RES()
C Source: core/io/resource_loader.cpp:186
C Function: _load

0:00:04:0792 - res://portal.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/portal.gd
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: res://portal.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://scripts/portal.gd
C Source: scene/resources/scene_format_text.cpp:439
C Function: poll

0:00:04:0792 - Condition ' err != OK ' is true. returned: RES()
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: Condition ' err != OK ' is true. returned: RES()
C Source: core/io/resource_loader.cpp:149
C Function: load

0:00:04:0792 - Failed loading resource: res://portal.tscn
----------
Type:Error
Description: Failed loading resource: res://portal.tscn
Time: 0:00:04:0792
C Error: Method/Function Failed, returning: RES()
C Source: core/io/resource_loader.cpp:186
C Function: _load

0:00:04:0792 - res://root.tscn:5 - Parse Error: [ext_resource] referenced nonexistent resource at: res://portal.tscn
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: res://root.tscn:5 - Parse Error: [ext_resource] referenced nonexistent resource at: res://portal.tscn
C Source: scene/resources/scene_format_text.cpp:439
C Function: poll

0:00:04:0792 - Condition ' err != OK ' is true. returned: RES()
----------
Type:Error
Description: 
Time: 0:00:04:0792
C Error: Condition ' err != OK ' is true. returned: RES()
C Source: core/io/resource_loader.cpp:149
C Function: load

0:00:04:0792 - Failed loading resource: res://root.tscn
----------
Type:Error
Description: Failed loading resource: res://root.tscn
Time: 0:00:04:0792
C Error: Method/Function Failed, returning: RES()
C Source: core/io/resource_loader.cpp:186
C Function: _load

is portal.gd using preload to import external resources? Maybe it fails because they are not found?

Zylann | 2018-08-17 17:35

Hi Zylann, No portal is not loading anything as far as I can see. Code below. I am not glued to one method of having DLC. Is there a good way of distributing a zip file that can be potentially encrypted if needed in order to allow people to update available worlds to explore in a game. I have all the framework functional - including the webserver to dish out files / reply with available updates/versions etc. I have the httprequest and a background process that updates/downloads zip files and stores in to user:// already. Only glitch is once I download the zip and load it with load_resource_pack, I am having problems as above. I have some worlds that seem to work fine and some not. I can’t tell the difference between them to hazard a guess!

Thanks

extends Spatial


## options allow arbitrary info
#query can accept a question and then have a fake chat
#activate and deactivate obviously



var active=false
var origpos=Vector3()
var mat
var mesh
var status

func _ready():
	active=false 
	status="open" # can be open, closed, gated, destroyed etc
	mesh=get_node("mesh")
	mat=mesh.get_surface_material(0)
	

func activate(options):
	mat.albedo_color=Color(0.2,0.2,0.5)
	mesh.set_surface_material(0,mat)
	active=true

func deactivate(options):
	mat.albedo_color=Color(0.7,0.2,0.5)
	mesh.set_surface_material(0,mat)
	active=false

func complete(options):
	#set status to destroyed or conquered etc
	pass

func query(options):
	return "You asked me a question > "
	
	
func _on_Area_body_entered(body):
	globals.add_activeportals(get_node("."))


func _on_Area_body_exited(body):
	globals.del_activeportals(get_node("."))

sxkod | 2018-08-19 15:38

Perhaps it fails to access globals ? I see your zip contains globals.gdc, but is it setup as a singleton in your project? Perhaps Godot tries to load the script before that happens (if that even happens).

(also, unrelated note: get_node(".") is the same as writing just self)

Zylann | 2018-08-19 15:54

Hi

I went back and checked. The file pillar.zip has scripts/globals.gdc and the directory listing shows that it is available. I did set it to autoload as a singleton in the project setting before I exported the project as a zip. Is there a better way to load it?

Thanks

sxkod | 2018-08-20 00:14

Perhaps there is still an issue related to that… is the game still failing to load the package if you remove the lines accessing globals?
Otherwise I have no other clues, I would remove small bits until it works, that would help identify what causes the problem. Then if it’s unexpected, try to reproduce the exact same situation in a simple project and post an issue for devs to have a look at.

Zylann | 2018-08-20 00:17

I will try to try without using the global. However most of the code reports to global, such as camera rig for horizontal and vertical movements, player name, currently active portals etc. I think I will create a new scene and then slowly add stuff until it fails.

Thanks for the suggestions.

sxkod | 2018-08-20 01:40