Godot

1049 readers
11 users here now

A community for discussion and support in development with the Godot game engine.

Official links to other communication platforms

GitHub

Other Godot communities on Lemmy

founded 4 years ago
MODERATORS
1
2
 
 

cross-posted from: https://vger.social/post/19509421

godot-rust v0.3 brings type-safe signals to the table.
If you register a signal:

#[signal]
fn damage_taken(amount: i32);

you can now freely connect it with other Rust functions:

fn ready(&mut self) {
    // Connect signal to the method:
    self.signals().damage_taken().connect(Self::on_damage_taken);
    
    // Or to an ad-hoc closure:
    self.signals().damage_taken().connect(|amount| {
        println!("Damage taken: {}", amount);
    });
    
    // Or to a method of another object:
    let stats: Gd<Stats>;
    self.signals().damage_taken().connect_other(&stats, |stats, amount| {
        stats.update_total_damage(amount);
    });
}

Emitting is also type-safe:

self.signals().damage_taken().emit(42);

Furthermore, you can now await signals, effectively introducing async tasks:

godot::task::spawn(async move {
    godot_print!("Wait for damage to occur...");
    
    let (dmg,) = player.signals().damage_taken().to_future().await;
    godot_print!("Player took {dmg} damage.");
});

There are many other improvements, see devlog and feel free to ask me anything :)

Huge thanks to all the contributors who helped ship these features!

~this was originally posted by @bromeon@mastodon.gamedev.place the project author on reddit. I'm just maintaining some parts of the project.~

3
 
 

video by GDQuest
very awesome to see tutorial and encouragement for 3D game
Godot would get much greater recognition if there were more 3D games made with it.

4
 
 
5
 
 

Added the swords to have something else for a change than boxes in all ratios. And, well, every Bulletheaven game needs something to collect, right?

6
7
 
 

A few seconds longer and it would take off like a choppa

8
 
 

ofc the boxes should be swords or something like that

9
 
 

Wanted to have them orbiting while maintaining center alignment, didn't fully work out ¯_(ツ)_/¯ But I do kinda like it

10
11
12
13
14
 
 

クロスポスト: https://sh.itjust.works/post/32413510

After having cancelled my 2 previous projects I've finally been able to finish something!

About: Nairu is a simple note taking app that I made mostly for myself, right now it doesn't have a lot of features (just the basics of a note taking app), but I plan to add a few more things to it.

Any feedback is appreciated!

15
16
17
 
 

I'm not the author, but posting it here because it is amazing project that deserves exposure.

18
19
20
21
22
23
 
 

I am writing a GDExtension for binding libpd, library version of PureData. I have added a property with appropriate getter and seterr.

  ADD_PROPERTY(
      PropertyInfo(Variant::STRING, "patch_path", PROPERTY_HINT_FILE, "*.pd"),
      "set_patch_path", "get_patch_path");

I do something like this to get the file path and load it to puredata

Ref<FileAccess> file = FileAccess::open(path, FileAccess::READ);
patch = pd.openPatch(
      file->get_path_absolute().utf8().get_data()->get_path_absolute().utf8().get_data(), "/");

I can select *.pd files from my resources directory, they load and work normally inside the editor. However, they do not work when I export the project.

The complete error message:

Godot Engine v4.3.stable.official.77dcf97d8 - 
Vulkan 1.3.296 - Forward+ - Using Device #0: Intel - Intel(R) Iris(R) Xe Graphics (RPL-U)

pd 0.55.2
bonk version 1.5
fiddle version 1.1 TEST4
pd~ version 0.54
pique 0.1 for PD version 23
PureDataGD constructor
ERROR: File does not exist: 
   at: file_exists (/home/kureta/Documents/repos/PureDataGD/src/puredatagd.cpp:60)
Trying to set path to: res://patches/test-2.pd

read (31 184) -> -1
//: Is a directory
Set patch path to: res://patches/test-2.pd
Setting DSP status to truehttps://godotengine.org

What am I doing wrong? Full code is here.

24
25
view more: next ›