Code Migration
In this chapter you will learn the steps to migrate from GDScript to Jenova Framework.
Script Structure
When migrating GDScript code to Jenova C++ Script, it's essential to understand how script structures differ between the two languages.
Inheritance
In GDScript, you can inherit from a base class to extend its functionality, like this:
extends Camera3D
func _ready():
var self_camera := self as Camera3D
if self_camera:
print("Camera Node Name : %s" % self_camera.name)
In Jenova C++ Scripts, we don't need this kind of inheritance. Instead, we directly access all the underlying classes using the Caller
parameter.
void _ready(Caller* instance)
{
auto self_camera = GetSelf<Camera3D>(instance);
Output("Camera Node Name : %s", GetCStr(self_camera->get_name()));
}
In this example, Camera3D
inherits from Camera3D → Node3D → Node → Object, so using GetSelf<T>
allows you to access any of these base classes directly within the script's logic.
📖 Learn more about Node Access
Signals
Properties
Equivent @export var prefab : PackedScene = JENOVA_PROPERTY(PackedScene, prefab, PackedScene(), Hint:PROPERTY_HINT_RESOURCE_TYPE, HintString:"PackedScene")