I’ve been thinking about this one question for years… How hard would it be for the developers of GDevelop to create a custom scripting language, separate from JavaScript and the events system, using the underlying functionality set by the event system?
I think everyone has the same question, wouldn’t it be a ton of work to remap every action to work as something you can type? Usually, you’d be right. However, I realized something when I copied an action, and formatted the JSON.
Take for example the play a sound action.
![]()
This looks like you’d have to make some new interpretation of this, except I learned every action has a short, simple name.
This is the beautified JSON of a PlaySound action:
It has an internal name of “PlaySound”.
{
"000kind": "GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc",
"content": {
"eventsList": [],
"eventsCount": 0,
"actionsList": [
{
"type": {
"value": "PlaySound"
},
"parameters": [
"",
"freesound_community-trying-to-open-a-locked-door-104302.mp3",
"no",
"60",
"1"
]
}
],
"actionsCount": 1,
"conditionsList": [],
"conditionsCount": 0
}
}
This slightly differs from how it transpiles to JavaScript:
gdjs.evtTools.sound.playSound(runtimeScene, "doorclose.wav", false, 60, 1);
Theres all sorts of small differences. Different cases, “PlaySound” instead of “playSound”, “no” instead of “false”.
GDevelop already has it’s own internal system, that could simply be used just like this:
// pseudo code
PlaySound("doorclose.wav", no, 60, 1);
And with GDevelop’s expression system, can be expanded on.
// pseudo code
PlaySound("doorclose.wav", no, RandomInRange(50, 60), RandomFloatInRange(0.8, 1.2));
Already using things deeply familiar to GDevelop event system and JavaScript programmers.
I admit while this does seem quite similar to JavaScript, in practice, programming a GDevelop game in JavaScript never ends up looking this simple.
So am I wrong here? Any thoughts to add?
I also wish that these scripts would be put into files such as script.gs, NOT as blocks in the event editor.
