runtimeScene.callFunction(‘myCustomFunction’, Param_1, Param_2);
Also I was wondering how to do a “If Else” condition with the visual editor.
I tried doing a simple switch where a variable is either “On” or “Off” and clicking a text object, switches between states.
But for whatever reason both “On” and “Off” conditions run at the sametime, even after having one of the events as “Inverted”.
I’m wondering is there something specific that needs to be done to have an “If Else” condtion with the visual editor.
Any help would be appreciated, thanks!
For the if/else you need an extra variable, check this out: [url]on/off Button for Background music]
Thanks for your help on the “If Else” issue.
Are they exposed on the runtimeScene object? I also saw a GDJS object, but can’t figure out where I would access the functions.
I already tried calling them like any other normal JS function:
My guess is that they are chained to one of the main game objects, and there is some type of method to call them, but I haven’t been able to find it.
Functions are generated like events in JS functions with a “mangled” name.
Is there any reason why you would call a GDevelop function from a JS function? Any particular reasons?
Because it would be possible for you to find the function name and call it - you can open the debugger and inspect the generated JS files
But this can break if at some point some refactoring is done in the way the function name is generated. It’s not meant to be “public”, at least for now. (hence this is why I’m asking what’s your precise need behind this, to better understand what you’re trying to achieve )
Thanks for your reply and also providing us with an awesome game engine.
But I also wanted the flexibility of configuring a few GDevelop functions, taking advantage of the actions/features available “out of the box”.
I figured it would be quicker to build certain features visually, eliminating the need to search though runtime documentation to do certain things, and also having to rebuild functionality that already exists.
Thanks again for your help and your game engine!
I’ll look into the debugger to see what I can find for my project.