Search the Community
Showing results for tags 'call'.
Found 8 results
-
How to "call" script from Scheduled environment?
Leopard20 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys. Does anyone know a way to "call" a function/script from the scheduled environment? In other words, let's say I've already spawned a script: 0 spawn { call MY_fnc_TEST } Any function called inside this script will obviously get executed in the scheduled environment (canSuspend). But I want it to get called in the unscheduled environment. One way I know is to do something like this: 0 spawn { OnEachFrame {call MY_fnc_TEST; onEachFrame ""}; } which is quite awkward. Plus the function will not get executed before the rest of the script (it gets called in the next frame). This can be verified using: AAA = 1; 0 spawn { onEachFrame {AAA = AAA + 1; onEachFrame ""}; AAA = AAA/2 }; This gives AAA = 1.5 instead of 1. Does anyone know a better way?! -
params wogz187 learns Function Call Params
wogz187 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm going to learn how to use params in order to make future scripts more effective and you might learn something about params, too (please use the debug console if you want to follow along). A simple example, fnc_learnThis= { params ["_caller","_some","_thing","_luck"]; if (_luck>0) exitWith { systemChat format ["%1", _caller]; systemChat format ["%1 %2", _some, _thing]; }; }; With some luck this call will prompt the functions to run with the parameters set, [player, "is", "cool",1] call fnc_learnThis; The next example shows how to select from an array and sub-array. We can create some helpers and make the orb jump between them. Make three sets so the result isn't binary. Create the array of helpers from named objects like this, Enter the function, and call the function with, [orb, 0] call you_fnc_help; The orb should continue to go around between the three helpers each time you enter the call. To change to the next helper group, [orb, 1] call you_fnc_help; More examples continue throughout the discussion below, Have fun! -
Script stops running after fn call value changes?
scajolly posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
edit: completely replaced the code so no longer interested in help. Trying to find the delete button vOv -
Issues with Trigger and sleep, spent 10+ hours on this already
LifeSnatcher posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a function that i need to call when all the opfor is dead in a dynamically created trigger area. This function contains a sleep. I have tried all sorts of diff delays, all caused issues because i was using call in the dynamically created trigger statements. I have tried using a dynamically created trigger to create another trigger but for some reason it just kept creating triggers on load rather than after the opfor were dead. I have tried using spawn in both the int and the dynamically created trigger to fire the function for the first time. In the statement for the dynamically created trigger i used spawn to call the function that inevitably dynamically creates a new trigger. but for some reason like in my previous tests the trigger statement is getting activated on creation. i have been at this Arma 3 scripting for a week now and i keep running in to issues like this. I really could use some help on this. -
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.
-
player allowDamage true call on all machines help
sgtelis posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So from what I've been able to figure out the code "player allowDamage true;" only gets done on the client that it's called on. In my mission I'm making this turns out really strange. In the begining everyone are unkillable (using allowDamage false) and then when the mission actually starts I want them to take damage. However, due to it not being called properly the players can kill themselves with grenades but not kill eachother.- 9 replies
-
- allowDamage
- editor
-
(and 3 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)
-
I d like to learn more about that command cause i ve to use it in near future i think. In another thread we stuck at the point where we d like to send one variable together with the command to the clients and tried to let the other variable get the Client itsself. this command should be executed on all clients: player reveal _desired_object; _desired_object should be sent from Server to all clients but player should be executed at the clients itsself to get the local player entity. EDIT: Could this be the solution?: _desired_object remoteExec ["player reveal", -2];
- 11 replies
-
- remoteExec
- call
-
(and 3 more)
Tagged with: