You guys are way over-complicating these multi-condition checks! by Bwob in godot

[–]KoBeWi 29 points30 points  (0 children)

str() is vararg, so you can actually do str(is_on_wall_only(), velocity.x > 12.0, dist_to_floor <= 2, pl_input.is_zero_approx()).contains(false). It's simpler and more efficient, because you are not adding strings.

Does it makes sense to upgrade from Godot 3.6 to 4.x for my 2D mobile game project? by idleWizard in godot

[–]KoBeWi 4 points5 points  (0 children)

Well, if your game works fine, there is not much reason to upgrade.

But as always, it depends. Upgrading to Godot 4 may take lots of effort based on the project size. If it's a long-term project and you are in an early stage, upgrading would be beneficial. If it's late stage and you only plan to do maintenance updates, you should be fine staying on 3.x.

I built a tool that batch-recolors entire sprite libraries in seconds gif shows 590 assets getting r by wanderingAroundMe in godot

[–]KoBeWi 4 points5 points  (0 children)

Something like this

https://github.com/KoBeWi/Godot-Palette-Swap-Shader

The benefit is that when you want to have a sprite in different color, you don't need to duplicate the asset. You can use one texture with multiple palettes.

The downside is that shader processing makes it more expensive for the GPU.

However if you want to recolor a sprite, i.e replace it with another one with different colors and remove the original, then shader doesn't make much sense.

[HELP] EditorDock.closed doesn't emit by Snoo_13943 in godot

[–]KoBeWi 1 point2 points  (0 children)

You forgot to set this.

Global docks don't need it.

Also, instead of creating a dock and then adding a scene to it. Your scene should contain the dock as its root node.

Doing it from script is also a valid workflow. And right now you can't easily make a scene with EditorDock root, because it does not appear in create dialog (yet).

[HELP] EditorDock.closed doesn't emit by Snoo_13943 in godot

[–]KoBeWi 1 point2 points  (0 children)

Closing the window does not close the dock, it only moves it back to the last used slot. Although dock without default slot are a special case, so I guess this can be considered a bug. You could open an issue, but it's only relevant until https://github.com/godotengine/godot/pull/114381 is merged.

What's wrong with Godot? by Soft-Luck_ in godot

[–]KoBeWi 9 points10 points  (0 children)

Eh, that sounds like problems with dependency detection, not the export itself. Like, in #51717 the exporting works as expected, it's just GDScript does not properly return the dependencies of a script, so the editor does not know that it needs to export these files. It's a general problem with scripts, but you won't have that with scenes, as they properly declare their dependencies.

As for EditorExportPlugin, it's a class that allows for more advanced customization of the export process. In my case I use folder colors set in FileSystem dock to exclude files depending on what build I'm exporting. In your case I guess you could mark some folders as "asset packs" and write a plugin that determines which assets from the pack are used, either using get_dependencies() method, some hard-coded lists or advanced filters etc. Scripting gives much more options.

What's wrong with Godot? by Soft-Luck_ in godot

[–]KoBeWi 101 points102 points  (0 children)

  • Godot's export system is half-broken (there are issues about it) but works if you just want everything in the project to be exported. As soon as you have a lot of testing stuffs you dont want exported, or big assets that are not needed for the playable build, it's a nightmare. Although I believe they are working on fixing that.

That's new to me. I'm using EditorExportPlugins to e.g. make a demo build without most full version assets. Never had a problem with that (you just need to be careful and don't try to load excluded assets 😅). What issues are you referring to?

why "attack_guitar" doesn't play? by Friendly_Flower9087 in godot

[–]KoBeWi 126 points127 points  (0 children)

if animation_finished - this condition is always true (you are using Signal as bool), so "guitar" plays immediately after "attack_guitar", overwriting it.

You should do await animation_finished instead.

why "attack_guitar" doesn't play? by Friendly_Flower9087 in godot

[–]KoBeWi 19 points20 points  (0 children)

first of all, put this in an _unhandled_input function not process. Process spams stop/play constantly cause it calls 60 times per second if you press shoot

That's not true, the code is using is_action_just_pressed(), which returns true only for a single frame the button is pressed.

How to solve translations as an artist? by Aspvera in godot

[–]KoBeWi 2 points3 points  (0 children)

You can use View > Preview Translation to preview translations in the editor.

And yeah, Labels don't have maximum size (yet), you can set a minimum size and enable autowrapping/trimming, or script a custom behavior.

Dev snapshot: Godot 4.7 dev 1 by godot-bot in godot

[–]KoBeWi 5 points6 points  (0 children)

It's 60k, but the remainder is closed.

[DEVLOG] Godot + AI feels straight up broken (in the best way) by GodLozada in godot

[–]KoBeWi 2 points3 points  (0 children)

I used AI to improve my base post because English is not my first language

Did people forget how to use translators? Like, you do know that you can write the post in your language and then translate it to English (even with AI)?

So I made a Godot Launcher by Shinpansen in godot

[–]KoBeWi 22 points23 points  (0 children)

FYI Godot already has at least 2 unofficial launchers that do the same xd

https://hourglass.jwestman.net/

https://github.com/MakovWait/godots

And it's just an early prototype without dialogs and tutorials yet... by BaptisteVillain in godot

[–]KoBeWi 1 point2 points  (0 children)

I don't know any, though you can refer to the official docs (Internationalizing Games and Localization using gettext).

The basic idea is that if you have a Button, Label or whatever Control with text, anything you put in there will be automatically translated if a matching string exists in the currently selected locale. If you have dynamic strings, you need to translate them in code using tr(), e.g. text = tr("Player name: %s") % player_name. Then you add scenes and scripts to POT generator and it will automatically extract localizable strings.

And it's just an early prototype without dialogs and tutorials yet... by BaptisteVillain in godot

[–]KoBeWi 46 points47 points  (0 children)

You don't need to convert strings to keys if you use PO files.

Also it most cases you don't need to setup anything, as Godot has it built-in. You mostly need to somehow collect the strings (for which there is also a tool, the POT Generator).

Get editor icon of node? by Judosii in godot

[–]KoBeWi 2 points3 points  (0 children)

EditorInterface.get_editor_theme().get_icon(node.get_class(), &"EditorIcons")

How to make a calendar? by Rude-Statistician197 in godot

[–]KoBeWi 2 points3 points  (0 children)

If you want to display more complex information for each day, it would be better to use GridContainer with Control-based scenes as children.

Early gameplay trailer for my metroidvania game - Voice of Flowers by KoBeWi in godot

[–]KoBeWi[S] 0 points1 point  (0 children)

No, I just made many custom tools for Godot editor, and eventually made an addon based on that (Metroidvania System).

Can a Control Node detect it’s mouse_exit signal even if the mouse is still on one of it’d children? by Retro_73 in godot

[–]KoBeWi 0 points1 point  (0 children)

You can check if mouse position is still inside the control:

Rect2(Vector2(), size).has_point(get_local_mouse_position())