-
Content Count
335 -
Joined
-
Last visited
-
Medals
Everything posted by serena
-
Tying a trigger to a date
serena replied to Catchdog64's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Checking trigger conditions and unscheduled environment in which it is running apparently gives some strong guarantees of timely execution :/ It is a pity that we can not do something like this: setThreadPriority "REALTIME" :) P.S. Another funny moment: when the game performance falls so much that the scripts stop working, the last thing you think about is: "why is the sleeping script that is supposed to launch the spawn of the super-invasion force, fires 5 seconds later?" XDD -
Tying a trigger to a date
serena replied to Catchdog64's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Technically this can happen. The question is, how likely is it practically and how much will the gap be. I regularly use this approach and it always works perfectly. Maybe you're right, and I'll once face such a problem :) -
Tying a trigger to a date
serena replied to Catchdog64's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ehh, you're right. Trigger condition is checked every 0.5 sec, waitUntil condition is every 0.0166 sec - 60 times per second. :) For task that is solved in this particular case, there is not much difference, the thread will wake up exactly after 100500.000 seconds or after 100500.001 seconds. Right? Why? -
Tying a trigger to a date
serena replied to Catchdog64's topic in ARMA 3 - MISSION EDITING & SCRIPTING
When you do this game will check this condition 60 times each second until condition not satisfied. You can also create thread sleeping until date/time you want: SleepUntilDate = { sleep (60 * 60 * 24 * 365 * (dateToNumber _this - dateToNumber date) / timeMultiplier)}; // Usage: [2035,5,28,13,37] call SleepUntilDate; -
Dialogs defined with enableSimulation = 0 blocks game simulation until closed. If you need your script to continue working in such cases use uiSleep. In other cases sleep is the right choice.
-
Cannot set task as completed, am I stupid or something?
serena replied to Mynock's topic in ARMA 3 - MISSION EDITING & SCRIPTING
waitUntil {time > 0}; private _tsp = player createSimpleTask ["Parent"]; private _tsc = player createSimpleTask ["Child", _tsp]; player addAction ["Complete Parent Task", { params ["_trg", "_clr", "_aid", "_arg"]; _trg removeAction _aid; _arg setTaskState "Succeeded" }, _tsp]; player addAction ["Complete Child Task", { params ["_trg", "_clr", "_aid", "_arg"]; _trg removeAction _aid; _arg setTaskState "Succeeded" }, _tsc]; Sample mission (VR map, two actions to complete parent and child task) - just tested and works fine -
Cannot set task as completed, am I stupid or something?
serena replied to Mynock's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Briefly: use BIS_fnc_taskCreate to create tasks and BIS_fnc_taskSetState to update and everything will work. -
[Release] Infinite Inventory
serena replied to celludriel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Problems can appear when trying to access such function remotely or asynchronously -
[Release] Infinite Inventory
serena replied to celludriel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Variables with names beginning with an underscore are local. Local variables exist only in the scope where they are defined. More information: #Local_Variables -
Updated to killzone_kid variant: CivilianKillers = []; if (isServer) then { addMissionEventHandler ["EntityKilled", { params ["_vct", "_klr"]; if (_vct isKindOf "CAManBase" and {side group _vct isEqualTo CIVILIAN}) then { private _dta = CivilianKillers; private _rec = {if (_x select 0 isEqualTo _klr) exitWith {_x}} forEach _dta; if (isNil {_rec}) then {_rec = [_klr, 1]; _dta pushBack _rec} else {_rec set [1, (_rec select 1) + 1]} } }]; }; Sample mission
- 21 replies
-
- civ killer script
- civ killer
-
(and 1 more)
Tagged with:
-
Creating a functioning shot timer
serena replied to instagoat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sample mission: link (VR map, all code in init.sqf script, use Start Shot Timer action) -
Creating a functioning shot timer
serena replied to instagoat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
// handle unit fired event unit addEventHandler ["Fired", {/*code inside braces executed each time unit fires*/}]; // command pauses executing script for given period in seconds sleep 10; // command generate random number between 0 and given value random 100; https://community.bistudio.com/wiki/addEventHandler https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired https://community.bistudio.com/wiki/sleep https://community.bistudio.com/wiki/random -
30 degrees forward: // 30 degrees forward: -30 call {arrow setVectorDirAndUp [[0, cos _this, sin _this], [0, 0, 1]]}; // 30 degrees back: 30 call {arrow setVectorDirAndUp [[0, cos _this, sin _this], [0, 0, 1]]};
-
The simpler - the better, I think: // init.sqf CivilianKillers = []; if (isServer) then { { if (side _x == CIVILIAN) then { _x addEventHandler ["Killed", { params ["_vct", "_klr"]; private _dta = CivilianKillers; private _rec = {if (_x select 0 isEqualTo _klr) exitWith {_x}} forEach _dta; if (isNil {_rec}) then {_rec = [_klr, 1]; _dta pushBack _rec} else {_rec set [1, (_rec select 1) + 1]} }] } } foreach allUnits; }; player addAction ["List Civilian Killers", { { _x params ["_unt", "_cnt"]; systemChat format ["%1 killed %2 civilian(s)", _unt, _cnt] } forEach CivilianKillers }]; player addAction ["Count Killed Civilians", { private _cnt = 0; {_cnt = _cnt + (_x select 1)} forEach CivilianKillers; systemChat format ["Civilians killed: %1", _cnt] }]; Sample mission: link
- 21 replies
-
- civ killer script
- civ killer
-
(and 1 more)
Tagged with:
-
private _active = {inputAction _x > 0} count ["ReloadMagazine", "Throw", "MiniMap"] > 0; * measurements have shown that the shortest variant is also the fastest
-
Try this: // in group leader init field _tmp = (group this) execVM "myscript.sqf"; // in myscript.sqf file { _x setUnitPos "UP"; //_x disableAI "FSM"; // if you uncomment this line then units probably wont move _x disableAI "Cover"; _x disableAi "SUPPRESION"; } forEach units _this; _this setSpeedMode "FUll"; while {{alive _x} count units _this > 0} do { sleep 5; _this setCombatMode "BLUE"; sleep 5; _this setCombatMode "RED"; };
-
attachTo: How to enable collision for attached objects?
serena replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'll look at you guys when BI officially announces that they are working on a brand new engine for Arma IV with superphysics for attached objects. P.S. About editing. Interior interaction script in my signature allow to move and stack objects. Сan be useful. -
Using trigger: // in trigger activation condition time > TIME_SINCE_GAME_BEGIN_IN_SECONDS Using script: [] spawn { sleep TIME_INTERVAL_IN_SECONDS; // do what you want here }; https://community.bistudio.com/wiki/time https://community.bistudio.com/wiki/sleep
-
attachTo: How to enable collision for attached objects?
serena replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Undeceived, why so hopeless? The chance to meet a dinosaur is pretty good, 50/50: either meet or not XD -
attachTo: How to enable collision for attached objects?
serena replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Undeceived, what is the chance to meet a dinosaur on the street? XD -
If you do not know which way to go any direction is correct XD If it's convenient for you and does not worsen performance of the game, then why not?
-
private _id = player addAction ["Action A3", OnActionA3]; player setUserActionText [_id, "Some Action", "<t color='#ff0000'>Background-----------------</t><br/>Multiline<br/>Multiline<br/>Multiline<br/>. . .", "<t color='#00ff00'>-----------------Foreground</t>"];
-
Working sample: link (Virtual reality map, all code inside init.sqf) Actions map: A1 -> A2 -> A3 B1 -> B2
-
Delete spawned AI from near a marker
serena replied to FireWalker's topic in ARMA 3 - MISSION EDITING & SCRIPTING
1. Select all groups where side = WEST and distance to marker < 100m private _groups = allGroups select {side _x == WEST and {leader _x distance getMarkerPos "_marker" < 100}}; 2. Delete units and groups: {{deleteVehicle _x} forEach units _x; deleteGroup _x} forEach _groups; 3. All together: {{deleteVehicle _x} forEach units _x; deleteGroup _x} forEach (allGroups select {side _x == WEST and {leader _x distance getMarkerPos "_marker" < 100}}); * code fixed * test mission: link -
encrypt the mission files .pbo
serena replied to Rene-k's topic in ARMA 3 - MISSION EDITING & SCRIPTING