→ كل المشاريع

WeightedChoice

بواسطة @rehhouari

16

Chance Based Random Choice in Godot 4 (Weighted Probability)

عن هذا المشروع

Weighted Choice This Godot 4 plugin provides a static WeightedChoice.pick() method you can call to randomly choose an item from a dictionary based on weights. Usage: Includes in-editor documentation! pick(dict: Dictionary, weightkey: Variant) Takes a dictionary dict, and randomly picks one item based based on weights. If weightkey is set, the function will search for weights in a nested dictionary. Returns a key. Examples Non-nested weights: Nested weights Loot Box Demo You can check the loot box demo for an example on how to use this plugin Try it in the browser Installation Install from the Asset Library, or clone the repository and copy the weightedchoice folder into your addons folder. When installing, you can uncheck the "demo" folder Credits MIT License Copyright (c) 2023 Rafik El Hadi Houari Uses code from Mickeon https://github.com/godotengine/godot-proposals/issues/3948#issuecomment-1035074260 mentioend in: https://youtu.be/lckgjXM3CeE Demo assets: https://admurin.itch.io/free-chest-animations https://snowhex.itch.io/mini-tools-pack-harvestsummer

من ملف README الخاص بالمشروع على GitHub

النجوم
16
التفريعات
0
الرخصة
MIT
آخر تحديث
03/01/2025

أضف هذه الشارة إلى ملف README

أظهر أن مشروعك مُدرج على «صُنع في الجزائر».

Made in Algeria
[![Made in Algeria](https://www.madeinalgeria.dev/badge/weightedchoice.svg)](https://www.madeinalgeria.dev/projects/weightedchoice)

مشاريع ذات صلة