Problem exporting for osx only with certain project

fonofono Posts: 45Member

Hallo,

i've posted the question already but now i've found something interesting.
Under the same Godot Installation which happen to be 3.2.1 (doesn't matter if it has mono support or not), what is happening is that the export for osx stop and godot close.
For win no prob at all. Compile, Godot stays open, nothing strange at all.

I can provide the project if someone want to take a look.

So it's something related to what'ive done in the project itself.

What i can say is that i've tried to modify a shader from
https://github.com/jospic/godot3_shaders

And i've added some keyboard input for controlling the ro in the shader (simpy, x,y,z).
There's as well the pitch of a song that accelerate with the speed applied to the z parameter.
Something ala Wipeout / Speed tunnel.

That's all very simple.

But since i don't know C++ i have really no idea on what's happening.

I will try to comment out step by step and see what is the feature that cause the problem.
May be is the pitch of the sound player....

The Visual Studio Code debugger seem to give a division by zero somewhere.
But as i've wrote before the export for windows works without problem.

I've compiled for mac osx the original project without my mods, and it compile for osx, with no error.

Thanks for your help.

The windows.exe give me the attached image result

Best Answers

  • fonofono Posts: 45
    edited April 30 Accepted Answer

    Hello,

    The error was fixed yesterday 1:31AM Flag.
    As you write i've fixed yesterday with a line like

    if var==null:
        initialize()
    

    However i suppose the stupid thing i have done is this.

    in the declaration section i've wrote

    const ACC = 0.00025
    var acc = ACC
    

    I think this broke the osx compilation

    But take a look at the strange behaviour after fixing it with the corrupted export template.

    Today with my surprise, 5 minutes ago i've tried to recompile.
    Now has compiled without error.

    The only thing i've done apart from fixing the error was restarting Godot and the pc.

    However now it should be ok. Next time i try to export for mac i will fix all error
    and warnings and restart Godot as well.

    What is really strange is this message about a missing or invalid export template.

    Thanks a lot.

    I'm happy i've fixed.

  • TwistedTwiglegTwistedTwigleg Posts: 2,666
    Accepted Answer

    Awesome! I'm glad you got it fixed. :smile:
    I changed this discussion and marked your reply as the answer, so others having similar problems can find this post easier.

Answers

  • fonofono Posts: 45Member

    I've solved the error regards nil, however the osx export still doesn't work.
    Close before finishing the compiling.

  • fonofono Posts: 45Member

    Ok, I've commented 2 lines. Now i got this:
    I've redownload the osx template 1 hour ago.

  • MegalomaniakMegalomaniak Posts: 2,654Admin

    Try building a release and not a debug build?

  • fonofono Posts: 45Member

    Hello @Megalomaniak ,

    I don't know where you can do this in the editor.
    I usually compile with the default template.
    Do you mean that i should use scons?

    I just want to have somethiing that runs on Mac osx.
    Compiling from windows.
    Maybe you can point me to some docs?
    Do you mean i have to use scons and not the default building template?

    However the initial demo project was working and compiling fine for mac as well.
    What I really can't understand is why it fails if i can compile it for win.
    Seems always related to something i've done with my code and I would like to understand which
    instructions / feature of Godot is generating this strange behaviour.

    Thanks

  • TwistedTwiglegTwistedTwigleg Posts: 2,666Admin

    Based on the error message in the opening post, it looks like it is an embedded script that is causing the issue, specifically at line 92 of the compiled GDScript (.gdc) code.
    Maybe try moving the scripts you have embedded in scene files into their own files and see if that helps? At the very least, it might help indicate which file is causing the issue, which could help narrow down what part of the code is causing the issue.

    The error itself is about trying to clamp a null value, so it is likely that somewhere there is code using clamp with some variables, and one of these variables is being set to null and that is causing the issue. I'd look to see which embedded scripts are using clamp and then see if you can deduce which variable might be getting set to null.

  • fonofono Posts: 45Member
    edited April 30 Accepted Answer

    Hello,

    The error was fixed yesterday 1:31AM Flag.
    As you write i've fixed yesterday with a line like

    if var==null:
        initialize()
    

    However i suppose the stupid thing i have done is this.

    in the declaration section i've wrote

    const ACC = 0.00025
    var acc = ACC
    

    I think this broke the osx compilation

    But take a look at the strange behaviour after fixing it with the corrupted export template.

    Today with my surprise, 5 minutes ago i've tried to recompile.
    Now has compiled without error.

    The only thing i've done apart from fixing the error was restarting Godot and the pc.

    However now it should be ok. Next time i try to export for mac i will fix all error
    and warnings and restart Godot as well.

    What is really strange is this message about a missing or invalid export template.

    Thanks a lot.

    I'm happy i've fixed.

  • TwistedTwiglegTwistedTwigleg Posts: 2,666Admin
    Accepted Answer

    Awesome! I'm glad you got it fixed. :smile:
    I changed this discussion and marked your reply as the answer, so others having similar problems can find this post easier.

  • fonofono Posts: 45Member
    edited May 2

    For me the answer is quite generic.
    You should always have 0 runtime warning or error before comiling for osx otherwise, you could get, missing or invalid export template for osx or

    Better check that there's no runtime error/warning before exporting for osx.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file