0
\$\begingroup\$

My game works perfectly fine in godot and as a widows executable but when exported to html5, I can't move my character.

The game is publicly available at https://ashir-rashid.itch.io/export-experiment

There is something fishy going on in the web console(chrome).

I exported a gui app made in goodt on itch.io which worked absolutely fine. I think the problem is in taking the keyboard input.

I've been stuck here for too long. Any help will be highly appreciated. Thanks in advance.

The console log:

[Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://static.itch.io/fonts/lato-v14-latin-700.woff2
export-experiment:1 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://static.itch.io/fonts/lato-v14-latin-regular.woff2
export-experiment:1 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://static.itch.io/icons/fonts/icomoon.ttf?4ibnvg
export-experiment:1 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://static.itch.io/fonts/lato-v14-latin-900.woff2
lib.js?1600863858:3 Allow attribute will take precedence over 'allowfullscreen'.
ca @ lib.js?1600863858:3
index.js:7 Godot Engine v3.2.2.stable.official - https://godotengine.org
index.js:7 OpenGL ES 2.0 Renderer: WebKit WebGL
index.js:7 OpenGL ES 2.0 Batching: ON
index.js:7  
index.js:7 **WARNING**: Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
index.js:7    At: scene/main/scene_tree.cpp:1153:_update_root_rect() - Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p1.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p1.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p1.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p1.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p1.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p1.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **WARNING**: Couldn't load external resource: res://Scripts/p1.gd
put_char @ index.js:7
index.js:7    At: scene/resources/resource_format_text.cpp:175:_parse_ext_resource() - Couldn't load external resource: res://Scripts/p1.gd
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p2.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p2.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p2.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p2.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p2.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p2.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **WARNING**: Couldn't load external resource: res://Scripts/p2.gd
put_char @ index.js:7
index.js:7    At: scene/resources/resource_format_text.cpp:175:_parse_ext_resource() - Couldn't load external resource: res://Scripts/p2.gd
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Indented block expected after declaration of "_process" function.
put_char @ index.js:7
index.js:7    At: res://Scripts/Boss.gdc:8:GDScript::load_byte_code() - Parse Error: Indented block expected after declaration of "_process" function.
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/Boss.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/Boss.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Indented block expected after declaration of "_process" function.
put_char @ index.js:7
index.js:7    At: res://Scripts/Boss.gdc:8:GDScript::load_byte_code() - Parse Error: Indented block expected after declaration of "_process" function.
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/Boss.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/Boss.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **WARNING**: Couldn't load external resource: res://Scripts/Boss.gd
put_char @ index.js:7
index.js:7    At: scene/resources/resource_format_text.cpp:175:_parse_ext_resource() - Couldn't load external resource: res://Scripts/Boss.gd
put_char @ index.js:7
export-experiment:1 Uncaught (in promise) DOMException: screen.orientation.lock() is not available on this device.
index.js:7 **WARNING**: Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
index.js:7    At: scene/main/scene_tree.cpp:1153:_update_root_rect() - Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p1.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p1.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p1.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p1.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p1.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p1.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **WARNING**: Couldn't load external resource: res://Scripts/p1.gd
put_char @ index.js:7
index.js:7    At: scene/resources/resource_format_text.cpp:175:_parse_ext_resource() - Couldn't load external resource: res://Scripts/p1.gd
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p2.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p2.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p2.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load source code from file 'res://Scripts//player.gd'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2285:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts//player.gd.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **SCRIPT ERROR**: Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7    At: res://Scripts/p2.gdc:1:GDScript::load_byte_code() - Parse Error: Couldn't load the base class: res://Scripts//player.gd
put_char @ index.js:7
index.js:7 **ERROR**: Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:801:load_byte_code() - Method failed. Returning: ERR_PARSE_ERROR
put_char @ index.js:7
index.js:7 **ERROR**: Cannot load byte code from file 'res://Scripts/p2.gdc'.
put_char @ index.js:7
index.js:7    At: modules/gdscript/gdscript.cpp:2281:load() - Condition "err != OK" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **ERROR**: Failed loading resource: res://Scripts/p2.gdc.
put_char @ index.js:7
index.js:7    At: core/io/resource_loader.cpp:278:_load() - Condition "found" is true. Returned: RES()
put_char @ index.js:7
index.js:7 **WARNING**: Couldn't load external resource: res://Scripts/p2.gd
put_char @ index.js:7
index.js:7    At: scene/resources/resource_format_text.cpp:175:_parse_ext_resource() - Couldn't load external resource: res://Scripts/p2.gd
put_char @ index.js:7
index.js:7 **WARNING**: Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
index.js:7    At: scene/main/scene_tree.cpp:1153:_update_root_rect() - Font oversampling only works with the resize modes 'Keep Width', 'Keep Height', and 'Expand'.
put_char @ index.js:7
\$\endgroup\$
3
  • 2
    \$\begingroup\$ Every one of these lines is referencing your logger on line 7. Have you tried expanding the call stack to see what step the game was working on when it hit that error? \$\endgroup\$
    – DMGregory
    Commented Sep 23, 2020 at 16:13
  • \$\begingroup\$ Did you manage to fix it? \$\endgroup\$
    – Theraot
    Commented Sep 28, 2020 at 8:46
  • \$\begingroup\$ Yes, the problem was in a reference to a parent class. I had used paths to refer to it. After using the class_name keyword, I was able to change the way I refer to the class and fix the problem. This also explains why it was working as intended in Godot. \$\endgroup\$
    – ashir
    Commented Sep 28, 2020 at 9:20

1 Answer 1

2
\$\begingroup\$

Cause of the problem: I have two scripts named p2.gd and p1.gd inheriting from a base player class. I had not named the base class. So, my p1 and p2 scripts contained references to player.gd in terms of paths.

Solution: I used the class_name variable in gdscript to name the class and then refered to it in p1 and p2 scripts in terms of its name.

Although I solved the problem, I am not able to explain ,at a lower level, what caused it. Any information regarding this will be highly appreciated.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .