Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Is there a way to call functions by string WITHOUT mapping? I'd need to map 100+ things otherwise.
You can do it with a bit of scripting:
runtime.callFunction("FunctionName", param1, param2, ...)
Thanks! I tried doing this but it didn't seem to work, the function is in the audio event sheet, whereas this is in the menu event sheet.
Is this a problem with the scripting or something else?
That's not how you access instance variables from the script. You need something like this:
var t = runtime.objects.Trigger.getFirstInstance();
And if there are multiple Trigger instances, you'll have to pick the correct one..
It may be much easier to use a local variable - copy function name from the TriggerTrigger.AudioTrigger into the local variable and then do this:
Alright thanks! Will try it now.
Develop games in your browser. Powerful, performant & highly capable.
Hey man it worked great! Thanks!