SLib Library For Useful Codes - Try it!

Hello! :wave:
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.

download:

2 Likes

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.

More on that can be found here.

2 Likes

I have done this and added new ones, this version is available, thank you very much!

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?

1 Like

A new version has been released, including a new suggested feature:

  • Consolidator of arrays

Available now from here, thanks for your participation!

The install instruction list:

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)

Oh I’ll check these out soon, if it’s possible to express them on GitHub.

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:

1 Like

I publish new beta update:

  • Add FindChildOfClass function.
  • Add expDecay function.
  • Write types.
  • Error and Warning functions update.
  • Create SLibSettings.
  • Add Appear function.
  • Add Disapear function.
  • Add PauseChange function.

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):

I have added a new feature that is very useful, here is the guide to use it:

1 Like

Version 1.0.3-Stable has been released!
New features, updated items, bug fixes and added a plugin for project settings.
Change Logs:

  • Add FindChildOfClass function.
  • Add expDecay function.
  • Write types.
  • Error and Warning functions update.
  • Add Appear function.
  • Add Disapear function.
  • Add PauseChange function.
  • Create SLibConfig plugin.

Special thanks to snipercup for the contribution.

Download and use this version:

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.

Oh, thanks, .gitignore file was corrupted in a merge.

A new version has been released!
Currently, this library has the following items:

  • Customization using the user interface for developers
  • Several different but useful, standard and fast ways to work with all kinds of files
  • A separate environment and GUI for working with paths and using them optimally
  • Integrated system for working with Tweens
  • Special tools for handling arrays and dictionaries
  • Intelligent management of scenes and easy to use them
  • Automatic recording of logs
  • Quick access to project settings
  • Intelligent and versatile communication with the OS
  • Automatic and simple management of pause and unpause
  • Built-in troubleshooting capabilities for your project
  • Improved delay system in Godot
  • Advanced and fast macros to speed up project development
  • and many other features…

SLib is free, open source, lightweight, easy to install, and helps make your code more readable and maintainable.

You can see all the details on the project page:

Or use the quick start notes:

Here is the latest version available for download:


SLib - Powered by GODOT ENGINE & SUBJECT TEAM


SLib is now available in AssetLib :tada: , installation guide from AssetLib: