Open sampenland opened 5 years ago
Hello, Sorry there is not enough detail in your description to enable any sort of reasonable solution. If something crashes, you hopefully should be able to get a stack trace at the C++ level out of it. Then it should tell you which line and what function it crashed on. You might want to start from there. Thanks
I'm having trouble getting a stack trace from Godot. When I get it, I'll update this.
Just to make sure, Creature should work with Godot-3.1.1 stable, right?
Also, I'm sorry if this wasn't the place to post this. Wasn't sure where else to ask.
Hello,
Yes I have it built and running in it. At least as far as I can tell.
Ok. Thanks. I'll continue my search on how to get Godot to produce an error for me.
I narrowed down the problem a bit.
Using your Godot3Demo with the owl scene. You can run in editor and it works. You can build .exe in res:// folder and it works, but if you build into a "Build" folder the project does exactly what my project does - crashes with no error.
If you move the owl.json file into the Build folder then it works. I believe this is the issue I saw on another issue.
I have in my export to include json files in export. So, it seems that the .exe cannot find the json file inside the pck file.
Ah yes, this has something to do with how Godot puts the asset files. The plugin itself probably does not decide where to get the files. So it could be an issue with Godot's asset path system...
I got everything working for a Windows build by moving things around in kinda a ugly but working way. I am now trying to export to Android. I'm having an issue with it. Have you tested exporting to Android?
Hello, No I have not tried on Android. However I am providing some reference code for you, it might be useful in your current endevour . Take a look at: https://github.com/kestrelm/Creature_Godot/blob/master/creaturegodot3/creaturegodot/creaturegodot.cpp
In particular:
`bool CreatureGodot::load_json(const String filename_in) { auto global_path = ProjectSettings::get_singleton()->globalize_path(filename_in);
std::cout<<"CreatureGodot::load_json() - Loading file: "<<global_path.utf8()<<std::endl;
std::string load_filename(global_path.utf8());`
These are lines 99 to 105. Notice where it gets the filename from ( the input parameter filename_in ). The filename itself is set from:
void CreatureGodot::set_asset_filename(String filename_in) { auto retval = load_json(filename_in);
at line 482. This can be useful for you to customize and perhaps point the assets to some place you find more appropriate for your project.
@kestrelm maybe you can update your tutorial with this way. Because using res:// in android impossible and using user:// works for windows too. @sampenland My Godot 3.1.1 builds works in windows 10 and android without any problem. Simply, I am adding json file to my build and copying it to user:// folder in runtime and using it from user:// (not res://) Follow this:
Go export->resource settings in Godot and add *.json to filters to export non-resource files (this will add your json file to res://) I mean you adding your json file to your build with this way. But we need to export json file to user:// directory for access in correct way.
Create a root node (2d scene) attach a script for it:
extends Node2D
func _ready():
var dir = Directory.new()
dir.copy("res://some.json","user://some.json")
This script will copy your json from res:// to user:// in runtime (you can add some error handling, check file if exist or something like that if you want)
Now you can add creaturegodot node to your root node and use user://some.json instead of res://some.json in Assetfilename.
When you launch the game your json file will be copied to user:// and will work without any problem in android and windows builds (probably for mac and linux too). Plus, you don't have to put your json file next to your final exe. Because json file in your game already now.
You will find you json in this directory when you launch your game if you did the things correctly. C:\Users{username}\AppData\Roaming\Godot\app_userdata{projectname}\some.json I don't know android user:// directory location but it's working in same way.
IMPORTANT: Do not forget to enable Write External Storage permission in your android export settings ->Permissions (no write permission = no json)
My English is not perfect. If you feel like I am talking robotic and rude, I am sorry about it. Just trying to help :). If needed I can make a small example project.
Hello, is there a way to fix the issue here? So that the required files do not need to be copied to user:// and just use the files in res:// instead.
I plan on using this for my game, and it seems very bloated to copy a lot of animation files.
Would this be fixed?
Godot Version: 3.1.1 Stable source (compiled with creaturegodot folder from creaturegodot3 folder)
Everything works fine in the editor! It's an awesome product, Creature, and I really want to use it. The guy I made looks great in the editor - walks, jumps, etc. but when I export the game (using a custom compiled template as required) everything works fine until I get to my scene with a CreatureGodot node then the game crashes without an error. I've done debug templates and still no error printed in Godot, so I'm a little lost on what is causing the issue.
I've read that *.json files could be the problem so I added them to be included in the Godot export. Still no luck.
I see on the readme.md that you say Godot 3.0, does this mean 3.0 must be used or is 3.1.1 okay?
Any help would be great! Even if it's just pointing me to the code of this project and changing/updating something. I know a little c++ (kinda). Without an error from Godot, it's hard to determine what is going on to fix the issue.