Useful toolset for creating games/plugins/etc. with Godot Engine
Useful toolset for creating games with Godot Engine.
It is intended to expand and modify the toolset on your needs.
It is high customizable and offers a simple, but efficient basis.
You can use this in your own project, even a commercial one.
Examples | jTools in Action |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Just copy in the addons folder in to your Godot Project.
Then head to the projectsettings -> addons, and activate jTools!
For quick start just look at the provided example.tscn and example.gd how to use them.
Attention:
At game start jAudioManager loads in it’s own audio bus layout located inres://addons/jean28518.jTools/jAudioManager/jAudoManager_bus_layout.tres
.
You are welcome to expand this layout for your own needs.
If you don’t want to use this audio bus layout, set enable_jAudioManager_bus
in jConfig.gd:15
to false
.
If you don’t want to use all components of jTools you can deactivate some modules by editing res://addons/jean28518.jTools/jConfig.gd
.
With it you can very easy save values of your game persistently.
In code it can be accessed very easy over jSaveManager
.
It stores all saved data at res://jSaveManager.save
. It can be changed in the jSaveManager Script.
jSaveManager.save_value(key : String, value): Stores a value with a specific key.
jSaveManager.get_value(key : String): Gets the value which is stored under that key.
If this value doesn’t exist, null is returned.
jSaveManager.save_value("level", 3)
var level = jSaveManager.get_value("level")
If you need a local jSaveManager e.g. for a specific level, you can insert res://addons/jean28518.jTools/jSaveManager/jSaveModule.tscn
into your scene. It extends jSaveManager. jSaveModule is faster than jSaveManager because it is using an internal cache.
write_to_disk(): Writes cache to hard drive. Call is optional, jSaveModule writes to disk automatically.
load_everything_into_cache(): Loads everything from hard drive to cache. After this get_value()
doesn’t need read disk calls anymore.
reload(): Reloads cache of jSaveModule. If you duplicate some values with other objects in it, this function could be usefully.
Additionally you can change the path of the save file with set_save_path(save_path : String)
. That works even ingame.
You can also define the path of the save file in the inspector. The file extension is irrelevant. But make sure to use one. Otherwise some OS could have difficulties with it. Example of a save_path: res://Levels/Level1/Level1.save
Powerful table for godot. Usable ingame but also for editor plugins.
res://addons/jean28518.jTools/jTable/jTable.tscn
to your scene.headings
array. If you want to have 3 columns, then the size of it has to be 3.keys
array in the inspector. It should be the same size as the headings array. In keys these keys are specified, with wich you can access the values in the retrieved data later.If you have problems at any time, check out the example.tscn
with example.gd
.
Is some (custom) node type for the jTable missing? No problem! Just edit res://addons/jean28518.jTools/jConfig.gd
in the section “jTable”.
You can get the current data of the table by calling get_data()
. With set_data(tableData : Dictionary)
you can load data to the table.
In the end it is a Dictionary containing for each value a specific array. If you want to get e.g. the age of the 5th line you have to call var age = dataTable["age"][4]
Example:
var dataTable = {
"Street": [ "Gubener Straße", "Büsingstrasse", "Karl-Liebknecht-Strasse" ],
"city": [ "Bad Tölz", "Gilching", "Kaltenkirchen" ],
"firstName": [ "Laura", "Kevin", "Monika" ],
"gender": [ 1, 0, 0 ],
"housenumber": [ "51", "94", "21" ],
"lastName": [ "Hoch", "Egger", "Schweitzer" ],
"postalCode": [ 83633.0, 82205.0, 24560.0 ]
}
With it you can integrate an editable list very easily. jList is highly integrateable with your code. It throws signals at every user interaction.
While every user action jList checks its consistency. Also it can handle wrong user actions (e.g. trying to add a entry called ""
is not allowed) and doesn’t send signals for these.
Setting up jList is very easy. Add res://addons/jean28518.jTools/jTable/jTable.tscn
to your scene. Watch the example.tscn in Page2 how the jLists where setup.
jListManager.get_jList(id : String)
from everywhere in the code. Set it to _random
, if a random id should be generated._duplicate
to the new entryYou also can define custom descriptions for buttons and messages. These are translated automatically from the internal godot translation server.
Can be accessed from everywhere.
""
._duplicate
. Returns the resulting (unique) entry_name.With these signals you can integrate jList very easy to your current enviorment.
Signals are just emitted, if the user itself does something. While calling functions via code no signals are emitted.
Play easy sounds by calling just one function from anywhere. Music even keeps playing while switching to another scene.
If you want you could define specific game and music bus ids in the jConfig.gd file.
play_music(soundPath : String, loop : bool = true, volume_db : float = 0.0) Plays music from a given path. By default it is looped.
play_game_sound(soundPath : String, volume_db : float = 0.0) Plays simple game sound (no 3D/2D Effects) from a given path. By default it is not looped.
play(soundPath : String, loop : bool = false, pausable : bool = true, volume_db : float = 0.0 , bus : String = “Game”) You wanna get advanced? Just use this function.
clear_all_sounds(): That’s very helpful if you want to change the level for example. That clears the music too.
set_main_volume_db(volume : float) This function is usually called by jSettings. But you can change the volumes too. If you want.
set_game_volume_db(volume : float) This function is usually called by jSettings. But you can change the volumes too. If you want.
set_music_volume_db(volume : float) This function is usually called by jSettings. But you can change the volumes too. If you want.
jAudioManager.play_music("res://addons/jean28518.jTools/example/SampleMusic.ogg")
jAudioManager.play_game_sound("res://addons/jean28518.jTools/example/SampleSound.ogg")
Currently unfortunately jSettings doesn’t offer the comfort you have for example in jList. You can use jSettings as a good template/starting point.
When you call the function jSettings.popup()
. The Settings window opens. Everywhere. The game won’t be paused. But the option window also can work while the game is paused.
To add a setting, add some nodes to the GridContainer in JSettings.tscn
. Then add some code in the JSettings.gd
at _ready()
, apply_saved_settings()
update_settings_window()
. Also add your own setter/getter functions in the end of the script. Connect the new nodes in the grid per signals with your set/get functions, if as possible.
If you don’t need some setting just hide some entries in the jSettings.tscn.
It’s a collection of simple methods, which make developing a lot cleaner and easier.
jEssentials.call_delayed(delay : float, object : Object, method : String, arg_array : Array = []): With this function you don’t have to use Timers anymore. Just specify the delay in seconds, the object on which the given function should be accessed. In the end you have to create an array with the arguments of the function. Example: jEssentials.call_delayed(1.5, jSaveManager, "save_value", ["level", 3])
jEssentials.remove_all_pending_delayed_calls(): Removes all pending delayed calls. Useful, if the user quits the level.
jEssentials.find_files_recursively(directory_path : String, file_extension : String): With this function you can crawl a directory for a specific file extension. It returns an array of Strings containing the full path of the files. Ignores files beginning with a .
. (This function works recursively. Crawling over big directorys could cause lags) Example: var scripts = jEssentials.find_files_recursively("res://", "gd")
jEssentials.copy_folder_recursively(from : String, to : String): Copies whole folder with all content and subfolders to another location. Overwrites existing files.
jEssentials.create_direcotry(path: String): Creates one or more directories to the given path.
jEssentials.copy_file(from: String, to: String)
jEssentials.rename_file(from: String, to: String)
jEssentials.remove_folder_recursively(path: String): Removes all files and all subfolders.
jEssentials.remove_duplicates(array : Array): Removes duplicates out of the array. Returns the new array without duplicates.
jEssentials.show_message(message : String, title : String = “”): Opens a popup dialog with given message and optional title.
jEssentials.does_path_exist(path : String): Returns true if at the given path is a directory or a file.
jEssentials.crawl_directory_for(directory_path : String, file_extension : String): Searches the whole directory with all subdirectories files with given file extesnsion. Returns an array of strings with full paths of found files. Example: var all_text_files = jEssentials.crawl_directory_for("/home/test", "txt")
jEssentials.get_subfolders_of(directory_path : String): Get direct subfolder names of given folder. Returns array of strings.
-> Open an issue at https://github.com/Jean28518/Godot-jTools