Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
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?
Develop games in your browser. Powerful, performant & highly capable.
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.
Hey man it worked great! Thanks!