HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is there anyway to do a function prototype?

09-27-2004, 04:28 PM#1
RaeVanMorlock
Basically, I have two functions that have a percent-chance to call each other. But since the compiler doesn't recognize functions that are below the current statement, I need a prototype or something like you would use in C++. So does anyone know how to do this?
09-27-2004, 05:12 PM#2
weaaddar
Interestingly enough you can use the ExecuteFunc command with a string of a function located at the bottom of the map while your function is located at the very top.
09-27-2004, 05:17 PM#3
RaeVanMorlock
Quote:
Originally Posted by weaaddar
Interestingly enough you can use the ExecuteFunc command with a string of a function located at the bottom of the map while your function is located at the very top.

Ha! Awesome. Thanks for the info.
09-27-2004, 11:08 PM#4
AIAndy
That is no wonder as ExecuteFunc is evaluated at run-time and not at compile-time as the normal calls.
Be careful though that ExecuteFunc with a non existing function name crashes the game.
09-28-2004, 01:13 AM#5
weaaddar
I know, AiAndy but it is the loop whole that many people don't know about.
Plus I think if you made a code global variable and set it to a function at the very bottom of the map from the bottom of the map you could use that code var at the very top of the script. (E.g. you can gamecache and return bug it ahoy!)
09-28-2004, 10:00 PM#6
Alfryd
Is there any way to get ExecuteFunc to pass additional function arguments?
09-28-2004, 10:20 PM#7
fugly
sorry but no, only global variables and game cache can pull that off