this post was submitted on 24 Jul 2024
72 points (98.6% liked)

Godot

6005 readers
2 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 2 years ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] pe1uca@lemmy.pe1uca.dev 10 points 5 months ago

Good tip, just also good to remember there's no way to control the seed of the generator, for example for a seeded world.
For that use case you still need to manually run the generator you created with your seed to select an item.

[–] GammaGames@beehaw.org 6 points 5 months ago

And in case you’re trying to play random sounds: you can use AudioStreamRandomizer!

[–] subignition@fedia.io 4 points 5 months ago

I think convenience methods like this are great, but making small little functions like this yourself can also be good exercises for beginner programmers.

[–] WerDei@lemmy.blahaj.zone 1 points 5 months ago

This function was so convenient, I wrote an extension function in c# that works in any c# collection, as well as one for the weighted random.