Desrat 0 Posted September 5, 2011 can someone post a "for dummies" example (maybe the obligatory "hello world") of an sqf function that could be precompiled (for use with the call command) that will return a value,array or whatever. Thanks in advance Share this post Link to post Share on other sites
loyalguard 15 Posted September 5, 2011 There area a couple of examples on the Biki Function Page. The return value examples would be the most appropriate for your purpose. Share this post Link to post Share on other sites
twirly 11 Posted September 5, 2011 In simple form.... A useless but simple example to return the height (z value) of an object Create a file called "fn_getZ.sqf" in your mission folder. fn_getZ.sqf:- private ["_obj","_z"]; _obj = _this select 0; _z = getPos _obj select 2; _z In your init.sqf (precompile):- getZ = compile preprocessFileLineNumbers "fn_getZ.sqf"; To call:- _height = [_plane] call getZ; _height will contain the height (z value) of the _plane. This returns a single value. If you can't figure out returning an array I can post another example for you. Share this post Link to post Share on other sites
Desrat 0 Posted September 6, 2011 that should put me on the right track, thx to the pair of you :) Share this post Link to post Share on other sites