I have 4 functions:
func1
func2
func3
func4
How do I call one randomly on start of game:
Example logic (not syntax, just logic):
OnStartOfLayout --- > Call "func"+(random)1,4));
I was told I could use javascript, but thats not really the answer I need as I assume you could do most anything in javascript as an alternative :-) Unless you're telling me "that is the ONLY way you can do it." If so could some suggest code - I believe this is fairly easy for a seasoned JS programmer (as I am not).
Thank you in advance!!!
You don't need to call it by name in that way (also not sure if possible). You would do on start of layout, set a local variable to choose(1,2,3,4) and then sub events : if var=1, call func1, if var=2, call func2 etc
Excellent!
Develop games in your browser. Powerful, performant & highly capable.
It's possible to call new functions by string name, see "Function maps" template. In this particular case it's not necessary though.
Easiest solution would be simply:
Call Function: choose(func1, func2, func3, func4)
If you have a lot of functions, then:
Call Function: "func"&str(round(random(1,100)))
El Constructorr I believe the questions was about new C3 functions, you can't call them like that.
dop2000 I believe we can.. just have to map the function(s) first.
nettemple srv-file7.gofile.io/download/SfFQ5K/mapFunction.c3p