Hello!
I have created a functional library for use in Godot, you can download, install and use it in your applications. I’m sure your program will be more readable, shorter and faster development.
Available ability in this library now:
Fast, safe and similar change scene
Easy project setting modify and use with code
Optimized reload scene system
Similar exit and close application code
Best wait timer system for readability
Internal and automatic save and load files system
Fast backuping system
Optimized debugging with error and warning sender
optimized alert system for all OS
Customizable logging system
Similar URI using system
Fast path convertor
I will be very grateful if you share your comments and ideas with me to improve it.
Thank you for your contribution.
One way to make it even better is if you could incorporate Godot-styled documentation. That way, the method documentation can be opened and explained straight from within the editor.
Thanks for your work! I am looking for something like your library but at the moment I’d use maybe 2 functions, since it’s very project specific you know? I have the same issue with similar libraries for Godot that are hosted on Github. Will you accept contributions?
But this variable is already accessable by the autoload? I believe this will produce a warning/error for shadowing the autoload and recommend removing this step 3 from the install instructions.
The SendError function is being used backwards in the SLib.gd, the first argument is defined as the error message, and the second argument is the location. So the doc comments reports errors will say
“Can’t load from -->file_location<–, file not exists!” From “BackupFile”
But the actual error reads:
“BackupFile” From “Can’t load from -->file_location<–, file not exists!”
I find myself using these two functions often, if you want to include them:
## finds the first child of a given class, does not find class_name declarations
func find_child_of_class(node: Node, typename: StringName, descendants: bool = false) -> Node:
for child in node.get_children():
if child.is_class(typename):
return child
elif descendants:
var found: Node = find_child_of_class(child, typename, descendants)
if found:
return found
return null
## time based smooth interpolation, [b]not framedependant[/b] like [code]a = lerp(a, b, delta)[/code]
## Set [i]decay[/i] to 1-25 for a good range of values
func exp_decay(a, b, decay: float, delta: float):
return b + (a - b) * exp(-decay * delta)
Thank you very much! All fixed and added the two functions you mentioned, I have publish a pre-release version for try, if there are any problems with it I will be happy to state it here!
The pre-release is available here:
The major changes of these changes have been made according to the participation in this topic.
Thank you all and I hope you find this helpful!
I still welcome new suggestions but I recommend creating a fork.
1.0.3 Beta (2):
A heads up, seems like you’ve committed the .godot directory to your github. It’s highly recommended to remove and ignore that directory. I can see your personal editor changes in the repository and some of your computer’s filepaths.