binogure-studio / godot-uuid Goto Github PK
View Code? Open in Web Editor NEWUnique identifier generation v4 for Godot Engine
License: MIT License
Unique identifier generation v4 for Godot Engine
License: MIT License
Shouldn't the randomness be (randi() % (max_value + 1 - min_value)) + min_value
?
In order to load globally on auto load I had to add the extends Node
on the top of the file
Since randomize
is called at the start of the v4_rng
function.
Please see this PR for a fix:
Which allows for deterministic creation of uuid, I think this was just a bug?
func get_rng(item: Dictionary) -> RandomNumberGenerator:
var rng = RandomNumberGenerator.new()
rng.set_seed(1)
return rng
func _init(item: Dictionary) -> void:
# The following ID should always be the same
self.id = preload("uuid.gd").v4_rng(get_rng(item))
uuid.gd file uses inconsistent tabs and spaces.
Line 76:Used tab character for indentation instead of space as used before in the file.
Line 84:Used tab character for indentation instead of space as used before in the file.
fix:
Convert tabs to spaces
or
Yeet as_dict
Thanks a lot for your plugin!
The official documentation suggests that you put your plugin in addons/uuid/
. Otherwise all the files of the plugin are copied to the root of a user's project when they install it. This might cause some clashes (e.g., I now have your README.md at the root of my project).
When creating non-project assets, it is common practice to place your files inside of an addons/asset_name/ folder. Do this to avoid having your files clash with other assets, or with the files of users installing your asset. This folder will not be automatically generated when a user installs your asset.
This is more like a question rather than an actual issue. Is there any particular reason the script extends Node
? Correct me if I'm wrong please, but wouldn't it be enough to just not extend anything at all (which implicitly extends Object
)?
It's for sure not a performance killer or something. Though I think, where we don't need any node features it makes more sense to just not extend it, right?
Long story short, it might be no problem to simply delete line 3
from the script.
By the way, thanks for the implementation. I am considering using it for a tool I'd like to build in combination with an SQLite database. ๐
I'm trying to use the code for my own project, but I do not know which is the function needed to be called or where is the generated uuid located. Can we get a short step-by-step or shot explanation on how to use it?
Thanks for writing this utility method. Can you add this to the asset library so we don't have to copy the file into the project?
Would help simplify things like licensing, as well as easily let people get updates.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.