Search the Community
Showing results for tags 'compile'.
Found 3 results
-
Hello. I am pretty sure this is a question that has been answered many many times but I really can't make differences between each of the forums topics that I have found so far. Everyone tells the same, yet for a totally different question. So I thought I might as well just create a topic and ask my questions here. Pretty sure someone will answer it sooner or later. 1. When I have multiple functions, in multiple SQFs, is it better to call them 1 by 1 with ExecVM or call them with compile or should I create functions.hpp ? -I want to use all of the scripts, and most of them are going to be used later in the mission. -Most of the scripts have a return value -Is there going to be any performance difference? 2. If I have a really huge script, (literally a random mission spawner with multiple arrays and public variables) is it better to compile it or execVM it? -The script is called each time a mission is finished. -It contains loops and many scopes -It doesn't return anything 3. If I have scripts that I want to run only on the client side, and not on the server side, do I still need to execVM it on the server? -Respawn scripts / spawn protection / addactions -Contains loops Furthermore, I want to know what is the time difference between execVM and Call? If I run bug functions multiple times, do they have a performance impact on the server? For example in the case of creating private arrays again, etc.
-
Dynamic getVariable in setWaypointStatements
usbstuck posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would like to access a variable with getVariable in setWaypointStatements. However, the variable name is dynamic, because I don't know how many variables there will be set. Referring to this post I came up with the following: params ["_group", "_pos", "_type", "_additionalStatements"]; private ["_wp", "_ref", "_refString"]; _wp = _group addWaypoint [_pos, 0]; _wp setWaypointType _type; // Make sure chopper lands on the spot _ref = "Land_HelipadCivil_F" createvehicle (_pos); // Save reference to Helipad on group leader _refString = "land_"+ str random [0, 5000, 10000]; _group setVariable [_refString, _ref, true]; hint format ["Reference to helipad: %1", _refString, _ref]; // Use reference on group leader to clean up Helipad after landing call compile format ["_wp setWaypointStatements [""true"", ""deleteVehicle ((group this) getVariable '%1'); %2""]", _refString, _additionalStatements]; (_wp) This works. But I have 2 objections: 1) It's not super-easy to read 2) Adding another format inside the statement (eg: `hint format ["%1", _someVar]` ) will break it. Does anyone know a better way? Thanks! **Edit: Actually objection #2 does work :rolleyes: . It was a different error I got... So basically the only thing that remains of the question is if it can be done neater. But hey, maybe I should just get used to it ;)- 1 reply
-
- getVariable
- setWaypointStatements
-
(and 1 more)
Tagged with:
-
[SOLVED] Howto compile and preprocess a bunch of functions in one file?
sarogahtyp posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys, usualy I write a function put it in an example.sqf and then I do this: fnc_example = compileFinal preprocessFile "example.sqf"; now I have a file with a bunch of functions in the file example_fncs.sqf like this: fnc_example_a = { }; fnc_example_b = { }; fnc_example_c = { }; how can I preprocess the file and precompile that functions for the later use with call and spawn?- 21 replies
-
- compile
- compileFinal
- (and 6 more)