Closed rcoconnor closed 3 years ago
I don't have macOS so can't check it.
Could you try to (in terminal):
godot scenename.tscn
I just tested it and I got the following error:
However, If I just run "godot" from the directory, it runs the main scene without creating a new editor window. Not sure on how to make it work with a separate scene though.
I'm going to search around and see how to rectify this error to see if there are any other problems on my end.
Update: If I run "godot scenes/myscene.tscn" from where my whole project is located, it will open the correct scene without creating a new editor window.
Update: If I run "godot scenes/myscene.tscn" from where my whole project is located, it will open the correct scene without creating a new editor window.
What about open godot scenes/myscene.tscn
?
Also, when you do it in vim, what is your :pwd
? Does it match the godot project root dir?
When I run open godot scenes/myscene.tscn:
It appears that :open godot
is not a command. And yes, my :pwd
does match my godot project root, as in it is the same directory that my project.godot file is in.
When I run open godot scenes/myscene.tscn:
I mean do it from the command line, open
is the OSX version of xdg-open
of linux and start
version of windows.
Oh, my bad. I ran it while my Godot editor was closed and when I type open scenes/Level.tscn
nothing happens. However, if I have the Godot editor already open, then it will display the scene correctly.
Oh, my bad. I ran it while my Godot editor was closed and when I type
open scenes/Level.tscn
nothing happens. However, if I have the Godot editor already open, then it will display the scene correctly.
Interesting. Do you mean the scene is run or is opened in an editor?
If you are able to run a scene with this, could you replace:
with
call system('open ' . shellescape(a:scene_name))
Run godot, restart vim, and try :GodotRun scenes/Level.tscn
I meant that the scene is run without opening an editor. I will try this now.
Update: so I've tested this and when I type :GodotRun Scenes/Level.tscn
, nothing will happen strangely enough. From what I see, the problem is the "open" call. On the terminal, you should just type Godot /path/to/scene.tsn
without the word "open", everything seems to work as expected.
@rcoconnor Did you follow the Command line tutorial in the Godot docs? It suggests adding the executable to the PATH environment variable; however, as I found in the related issue, opening directly from the executable (e.g. /Applications/Godot.app/Contents/MacOS/Godot
) inside the app opens an extra instance. If you use let g:godot_executable=/Applications/Godot.app
(adjust as necessary pertaining to where you have it installed, of course), it should work as expected.
@habamax I imagine adding the executable to PATH is fairly common, but for the sake of accessibility, I think you could fix it one of two ways:
g:godot_executable
@miltsghostrehab Does it mean that current implementation works if g:godot_executable
is set to Godot.app
?
Yeah, I'm pretty sure it does :)
I am running macOS catalina with neovim and iTerm 2. I have installed vim-godot and when I run ":GodotRun /path/to/scene.tscn" in vim, Godot will not only run the scene, but also open a whole new Godot editor. This frustrating because I have to close out of the new editor anytime I want to test my game, or else I end up with a lot of instances of godot running. I believe the error may be at lines 66-67 of autoload/godot.vim.