Encrypt GDScript funcrion implementations easier
Note that this is not a safe way to protect your codes because .pck includes raw encryption keys.
Use pck encryption if you need stronger protection.
External script editor is recommended. Godot editor does not recognize .impl as a text file.
- Activate this plugin.
res://secret
and encryption keys are generated. - Write function definitions and variables etc... to .gd file.
call_impl()
accepts 3 arguments: method name, object, and arguments(optional). If you need more arguments, pass array or dictionary.
extends Node
var _impl:=preload("res://main.gd.impl") # load implementation
var variable
func _ready():
_impl.call_impl("_ready",self)
func function(greetings:String):
_impl.call_impl("function",self,"hello")
- Write function implementations to .impl files.
These scripts do not need to extend any class.
All functions must be like
function_name(this:Object,args)
. Do not useself
in .impl file, usethis
passed bycall_impl()
instead. You can also use super class function by passing lambda as a argument.
func _ready(this:Object,_args):
this.variable=1
func function(_this:Object,args):
print(args)
- .impl is encrypted and decrypted when loaded.