Giter Club home page Giter Club logo

Comments (10)

kestrelm avatar kestrelm commented on June 15, 2024

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

from creature_godot.

sampenland avatar sampenland commented on June 15, 2024

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.

from creature_godot.

kestrelm avatar kestrelm commented on June 15, 2024

Hello,

Yes I have it built and running in it. At least as far as I can tell.

from creature_godot.

sampenland avatar sampenland commented on June 15, 2024

Ok. Thanks. I'll continue my search on how to get Godot to produce an error for me.

from creature_godot.

sampenland avatar sampenland commented on June 15, 2024

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.

from creature_godot.

kestrelm avatar kestrelm commented on June 15, 2024

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...

from creature_godot.

sampenland avatar sampenland commented on June 15, 2024

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?

from creature_godot.

kestrelm avatar kestrelm commented on June 15, 2024

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); #ifdef _CREATURE_DEBUG std::cout<<"CreatureGodot::load_json() - Loading file: "<<global_path.utf8()<<std::endl; #endif 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.

from creature_godot.

alperc84 avatar alperc84 commented on June 15, 2024

@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.

from creature_godot.

 avatar commented on June 15, 2024

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?

from creature_godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.