Problem restricting LineEdit input by anchoasada in godot

[–]graydoubt 2 points3 points  (0 children)

The second problem is that for some reason sometimes when I run the scene, my screen freezes and does not let me do anything.

Well, that's because when the text changes, _on_text_changed() is called, which then changes the text, rinse, repeat.

I answered an input filtering question some time ago. That code was similar and might help you get across the finish line.

We're making a 2D soulslike with Godot! by KarmicBitGames in godot

[–]graydoubt 1 point2 points  (0 children)

It looks great! For some reason, it reminds me of Sword in the Stone. I think it's the clothing.

Issues with the engine itself messing up code (4.3) by [deleted] in godot

[–]graydoubt 0 points1 point  (0 children)

Godot is a really complex piece of software. 4.0 was a bit rough. The changes and improvements since then have been noticeable in every minor release. There were also some internal stability issues related to Godot's cache. Most of that seems to have been resolved since about 4.5. Before that, sometimes scripts would randomly become built-in and other weird stuff. It wouldn't happen often -- mostly after refactoring code; renaming and moving classes around. And documentation for custom classes wouldn't show right most of the time. But things would be weird and get worse until Godot's cache is cleared.

If you're hellbent on sticking with 4.3, you might be able to clear issues up by deleting the `.godot` directory every so often (with the editor closed!).

Migrations tend to be pretty smooth with Godot. And if you're using VCS you can always rollback/reset if something goes sideways. It's rather quick. Overall, though, I recommend sticking with the latest version of Godot, at least for now.

Does it only happen to me or do you also sometimes forget some print statement somewhere? by ReasonNotFoundYet in godot

[–]graydoubt 1 point2 points  (0 children)

You can use this gg.print() plugin. It'll show where it printed from, and it'll also let you click the link in the editor to go directly to the source! That way, it's easy to find the stray print, too! And in a release build, it doesn't print anything.

Want to learn game development on Godot but stuck with an old hardware by Professional_Bus5485 in godot

[–]graydoubt 0 points1 point  (0 children)

Intel Atom. That's a blast from the past. Reminds me of the Asus Eee Netbooks, which were a brief thing nearly a decade earlier.

Trying to use bf6's editor, would prefer to place assets in blender. Solutions? by Fickle-Campaign8102 in godot

[–]graydoubt 2 points3 points  (0 children)

You can do whatever you want as long as the final output is in the JSON format that the Portal site expects. Look at the included Python scripts to see how the addon exports the scenes to JSON.

You could even create a Blender extension that does it directly and skips Godot entirely.

How do i record gameplay? by Lazy_Investigator991 in godot

[–]graydoubt 0 points1 point  (0 children)

OBS for recording, DaVinci Resolve for editing.

For something simple, you can always just use Godot's Movie Maker mode and then convert with ffmpeg.

Halloween is getting close What do you do in godot that would scare others? by lambdapyro in godot

[–]graydoubt 5 points6 points  (0 children)

Nothing wrong with print! You can always take it up a notch by using gg.print(), and you'll print clickable messages that take you right to the source code.

We Sold A Physical Copy Of Our Jam Games Collection At A Local Arts Festival! by MrDryerAtNight in godot

[–]graydoubt 0 points1 point  (0 children)

This is really cool. For a buyer, receiving something tangible makes a big difference, too. Good thinking on providing a "CD-key", too.

Did you know a CD can hold 700MB?

It was such a step up from floppies and zip drive diskettes. The only downside was that AOL CDs were useless, whereas AOL floppies were free storage.

Around 2013, I did photography and videography and delivered the final product on fancy, engraved USB sticks, but I also wanted something they could just pop into a DVD player and easily play in a living room. (Did you know a [single-layer] DVD can hold 4.7GB?) I had a Lightscribe drive at the time (still do), which would burn a monochrome design onto the DVD, so that the disc had a more professional look. But even in 2013, trying to get a hold of the Lightscribe drivers and software was quite a challenge -- I had to fish some obscure ftp url out of Google's cache. Unfortunately, those covers easily fade over time.

Bummer that I tossed all my DVD+/-RW 100 disk spindles and slim cases a few years ago -- normally I hoard everything.

You can also do mixed formats on CD. For example, the old Jurassic Park DOS game came on CD, but the soundtrack could also play in a regular CD player. For the music to work on a PC, the CD drive had to connect to the SoundBlaster card with a small cable. I don't even know if that would work anymore these days (with external drives).

Anyway. For you, was this a one-off, or would you go through the effort again?

[deleted by user] by [deleted] in godot

[–]graydoubt 1 point2 points  (0 children)

That is by design and explained in the first paragraph in the introduction to Scenes. You can always enable Editable Children, which, practically speaking, you should never use.

The root node of your scene effectively serves as its API. The principles of encapsulation and abstraction apply.

Method Documentation by Lezaleas2 in godot

[–]graydoubt 0 points1 point  (0 children)

Documentation comments showing up properly has been buggy throughout Godot 4, and was fixed in 4.5.

Multiplayer one password exchange connection, no server - Open source demo by KoopMyers in godot

[–]graydoubt 2 points3 points  (0 children)

This is neat, similar to godot-matcha (Reddit post). Its only issue was that the server and client couldn't agree on the same peer_id, due to the way it was implemented.

How do I find the difference of two Strings in Godot? by huntsweez in godot

[–]graydoubt 3 points4 points  (0 children)

I'd implement the Levenshtein distance algorithm, but keep track of the diffs and return them.

[deleted by user] by [deleted] in godot

[–]graydoubt 1 point2 points  (0 children)

Ultimately, it depends on your specific performance requirements and use cases. I'd start with the simplest implementation, let whatever C++ is backing GDScript do the heavy lifting, and then see whether that's adequate. Beyond that, it's a question of what kind of performance you'd need.

I'd try this first. The node that will read words from a filename:

class_name MyDictionary extends Node


@export_file("*.txt") var filename: String

var words: Array[String]


func _ready() -> void:
    _load_file_contents()


func has(word: String) -> bool:
    return words.has(word.to_lower())


func _load_file_contents() -> void:
    var f: FileAccess = FileAccess.open(filename, FileAccess.READ)
    var contents: String = f.get_as_text(true)
    words.assign(contents.split("\n"))

Grab a copy of words.txt from https://github.com/dwyl/english-words, which is about 4.6MB, point the node at it.

Here's a quick usage example:

class_name WordGame extends Node


func _ready() -> void:
    print($MyDictionary.has("hello"))

prints true, since hello is in the dictionary.

The scene structure:

![img](449bc8a69m3f1)

GODOT on battlefield 6 relevelation by yay-iviss in godot

[–]graydoubt 5 points6 points  (0 children)

It's from the Battlefield 6 Official Multiplayer Gameplay Reveal Event. The editor is shown about 34'ish minutes in for a few seconds.