-
Content Count
335 -
Joined
-
Last visited
-
Medals
Posts posted by serena
-
-
4 minutes ago, killzone_kid said:What he needs (Step 3) is the smallest marker returned with unit in, and you return any marker with unit in.
Not "any", first marker unit in from array of markers ordered from smallest to biggest by area :))
-
13 minutes ago, killzone_kid said:The code above will return the first marker unit is in, what is all business with getting the size and sorting???
Yes, you're right. Code above will return the first marker unit is in, from markers array ordered by marker area, and this is exactly what he needs.
// return marker name or empty string if unit outside of any marker SmallestMarkerUnitIsIn = { {if (_this inArea _x) exitWith {_x}; ""} forEach allMapMarkersOrderedByArea}; // Usage: private _marker = player call SmallestMarkerUnitIsIn;
-
// in init.sqf waitUntil {time > 0}; player linkItem "ItemGPS"; sleep 0.75; hintC "Open your GPS"; // marker area function MarkerArea = { switch (markerShape _this) do { case "RECTANGLE": {getMarkerSize _this params ["_msw", "_msh"]; _msw * _msh}; case "ELLIPSE": {getMarkerSize _this params ["_msw", "_msh"]; _msw * _msh * 0.25 * pi}; default {0} } }; // create list of all markers ordered by area allMapMarkersOrderedByArea = [allMapMarkers,[],{_x call MarkerArea},"ASCEND"] call BIS_fnc_sortBy; // poll smallest marker with player and log in system chat while {true} do { private _smallestMarker = {if (player inArea _x) exitWith {_x}; ""} forEach allMapMarkersOrderedByArea; systemChat ("Player inside marker: " + _smallestMarker); sleep 1; };
Demo mission: link
-
We have to guess the answers to these questions?
- Where do you put this code?
- How do you run this code?
- Which errors occur during execution?
-
// disabe automatic target popup globally nopop = true; // popup target manualy (0 - up, 1 - down) _target animate["terc", 0]; // check target popup state (0 - up, 1 - down) private _state = _target animationPhase "Terc"; // target individual settings [DEV. VERSION ONLY!] _target setVariable ["nopop", true]; _target setVariable ["popDelay", 10]; // handle target hit event _target addEventHandler ["Hit", { systemChat format ["Target %1 hit by unit %2", _this select 0, _this select 1]}];
Did we not have the same thread just recently?
-
Are you sure that:
- Your gear have been saved before you disconnect (commands are executed properly and profile namespace contains saved data)
- Saved data extracted and applied when you resume mission (commands are executed properly and profile namespace contains saved data)
-
// save loadout profileNamespace setVariable ["PlayerLoadout", getUnitLoadout player]; // restore loadout profileNamespace getVariable "PlayerLoadout" call {player setUnitLoadout _this}; // reset loadout profileNamespace setVariable ["PlayerLoadout", nil];
-
* it is not working code but only the concept
while {true} do { sleep 1; { private _time = _vehicle getVariable "AbandonedAt"; if (VEHICLE_ABANDONED_CONDITION) then { if (isNil "_time") then {_vehicle setVariable ["AbandonedAt", time]} else { if (time - _time > ABANDONED_VHICLE_RESPAWN_DELAY) then { _vehicle setVariable ["AbandonedAt", nil]; // -------------------------- // put your respawn code here // -------------------------- } } } else { if (not isNil "_time") then { _vehicle setVariable ["AbandonedAt", nil]} } } forEach allMyVehicles; };
-
// init.sqf waitUntil {time > 0}; player addAction ["Spawn BMP", { private _veh = createVehicle ["O_APC_Wheeled_02_rcws_F",getMarkerPos "X1",[],0,"NONE"]; createVehicleCrew _veh; private _grp = group commander _veh; private _wpp = _grp addWaypoint [getMarkerPos "X1a", 0]; _wpp setWaypointType "MOVE"; _wpp setWaypointSpeed "LIMITED"; _wpp setWaypointBehaviour "SAFE"; }];
Sample mission: Link
BIS_fnc_initVehicleCrew seems broken in my client.
-
-
Very simple, just two steps:
- Create custom inventory dialog
- Handle player gear opening event, where replace default dialog with your own
- 1
-
When you look inside Ravage or any other true dynamic scenario, you find mission file absolutely empty - only player unit and number of markers / modules. Using mission editor waypoints and triggers you can create simple scenarios. To create a dynamic sandbox scenarios, there is only one way: scripting, scripting, scripting...
-
10 minutes ago, rness said:2/ I want auto generate a multi array with addition (_1 _2 and _3) :
--> _mutliarray = [["toto_1", "toto_2", "toto_3"],["titi_1", "titi_2", "titi_3"],["tata_1", "tata_2", "tata_3"]];// So private _multiarray = ["A", "B", "C"] apply {private _pre = _x; [1, 2, 3] apply {_pre + "_" + str _x}}; // Or private _multiarray = ["A", "B", "C"] apply {private _pre = _x; [1, 2, 3] apply {format ["%1_%2", _pre, _x]}}; // Result: // [["A_1","A_2","A_3"],["B_1","B_2","B_3"],["C_1","C_2","C_3"]] // Selecting private _chosen = _multiarray apply {selectRandom _x}; // Result: // ["A_3","B_1","C_2"]
- 1
-
13 minutes ago, celludriel said:If people would start to convert my missions to work with CUP or RHS would BIS_fnc_baseWeapon or BIS_fnc_weaponComponents still work ? Is the base weapon an attribute of a complex template ?
BIS_fnc_baseWeapon = { private _class = _this param [0,"",[""]]; private _cfg = configFile >> "cfgWeapons" >> _class; if !(isClass _cfg) exitWith { if (_class != "") then {["Class '%1' not found in CfgWeapons", _class] call BIS_fnc_error}; _class }; private _base = getText (_cfg >> "baseWeapon"); if (isClass (configFile >> "cfgWeapons" >> _base)) exitWith {_base}; private _return = _class; { if (count (_x >> "linkeditems") == 0) exitwith {_return = configname _x;}; } foreach (_cfg call BIS_fnc_returnParents); _return; };
- 1
-
5 minutes ago, mrcurry said:If you input the tropic MX class into BIS_fnc_baseWeapon it will return the basic weapon only. i.e. it strips out the camo and/or colour variants
systemChat ("arifle_MX_khk_F" call Bis_fnc_BaseWeapon); systemChat ("arifle_SPAR_01_GL_blk_F" call Bis_fnc_BaseWeapon); // Output: // arifle_MX_khk_F // arifle_SPAR_01_GL_blk_F
My function is working properly. Did I do something wrong?
-
4 minutes ago, mrcurry said:private _baseWeapon = (_x call BIS_fnc_weaponComponents) select 0; _obj addItemToBackpack _baseWeapon;
https://community.bistudio.com/wiki/BIS_fnc_baseWeapon
- 1
-
darkxess, what is the prize to those who supposed to guess weapons from that "unstoppable" 30% ?
- 1
-
Try define variable:
nopop = true
Then, to popup target manually:
_target animate["terc", 0]
To get all mission targets:
AllMissionObjects "TargetBase"
-
I absolutely agree with killzone_kid. The right choice of variable name - the main key to success! XD
-
Also interesting information about initialization order and executing environment: Initialization_Order
-
In end game trigger activation condition:
{alive _x and {side _x == EAST}} count entities "Tank" < 1
* side and number of alive entities you can replace as you want
-
KeyFunctions = [//dik //shift //ctrl //alt [[23, true, false, false], "YOURSCRIPT1"], // I + Shift [[23, false, true, false], "YOURSCRIPT2"], // I + Ctrl [[22, false, false, false], "YOURSCRIPT3"]];// U while {isNull(findDisplay 46)} do {sleep 0}; (findDisplay 46) displayAddEventHandler ["KeyDown", { private _kpd = _this select [1, 4]; {_x params ["_key", "_scr"]; if (_key isEqualTo _kpd) exitWith {execVM _scr; true}; false; } forEach KeyFunctions; }];
- 1
-
KeyFunctions = [//dik //shift //ctrl //alt [[23, true, false, false], "YOURSCRIPT1"], // I + Shift [[23, false, true, false], "YOURSCRIPT2"], // I + Ctrl [[22, false, false, false], "YOURSCRIPT3"]];// U while {isNull(findDisplay 46)} do {sleep 0}; (findDisplay 46) displayAddEventHandler ["KeyDown", { private _key = _this select [1, 4]; private _scr = {if (_x select 0 isEqualTo _key) exitWith {_x select 1}} forEach KeyFunctions; if (isNil {_scr}) then {false} else {execVM _scr; true} }];
-
while {isNull(findDisplay 46)} do {sleep 0}; (findDisplay 46) displaySetEventHandler ["KeyDown","call OnKeyDown"]; KeyFunctions = [//dik //shift //ctrl //alt [[23, true, false, false], "YOURSCRIPT1"], // I + Shift [[23, false, true, false], "YOURSCRIPT2"], // I + Ctrl [[22, false, false, false], "YOURSCRIPT3"]];// U OnKeyDown = { private _key = _this select [1, 4]; private _scr = {if (_x select 0 isEqualTo _key) exitWith {_x select 1}} forEach KeyFunctions; if (isNil {_scr}) then {false} else {execVM _scr; true} };
Determine smallest of multiple marker areas unit is inside of.
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
When you walk into area overlapped by three different markers my code returns smallest marker you're in