Jump to content

HallyG

Member
  • Content Count

    254
  • Joined

  • Last visited

  • Medals

Everything posted by HallyG

  1. Not sure but, this maybe? true remoteExec ["disableUserInput ", P6];
  2. Or just because we can :) { _x addEventHandler ["HandleDamage", { params ["_unit", "", "_damage", "_source"]; [_damage, 0] select (side _unit isEqualTo side _source); }]; } forEach (allUnits select {!isPlayer _x});
  3. HallyG

    UH-80 Dazzle Texture

    Everyone knows that reiterating a point makes it more valid..
  4. HallyG

    Remove diaryrecords?

    brute force time This will prevent the player from selecting the desired diary subject (unless they click like a mad man but even then it will appear for less than a second). It won't hide the subjects name either. h =[] spawn { waitUntil {!isNull (findDisplay 12)}; disableSerialization; _a = player createDiarySubject ["testPage1","My page 1"]; _b = player createDiarySubject ["testPage2","My page 2"]; player createDiaryRecord ["testPage1", ["Intel", "TEST 1 "]]; player createDiaryRecord ["testPage2", ["Intel", "TEST 2"]]; INDEX = [_a]; ["HGF", "onEachFrame", { { ((findDisplay 12) displayCtrl 1001) lbSetData [(_x-2), ""]; } forEach INDEX; }] call BIS_fnc_addStackedEventHandler; }; I originally tried to delete the subject from the listbox but it seemed to add it back each time and prevent me from selecting any further custom subject: h = [] spawn { waitUntil {!isNull (findDisplay 12)}; disableSerialization; _a = player createDiarySubject ["testPage1","My page 1"]; _b = player createDiarySubject ["testPage2","My page 2"]; player createDiaryRecord ["testPage1", ["Intel", "TEST 1 "]]; player createDiaryRecord ["testPage2", ["Intel", "TEST 2"]]; INDEX = [_a]; ["HGF", "onEachFrame", { { ((findDisplay 12) displayCtrl 1001) lbDelete (_x-2); } forEach INDEX; }] call BIS_fnc_addStackedEventHandler; };
  5. HallyG

    Scripting help needed.

    You'll need to use getMarkerPos to return the location of a marker. Additionally, why not make (example code): _armored2 = "(configfile >> ""CfgGroups"" >> ""East"" >> ""OPF_T_F"" >> ""Armored"" >> "; _armored21 = _armored2 + selectRandom Armored1; this: _armored1 = ["O_T_SPGPlatoon_Scorcher"]; _armored21 = (configfile >> "CfgGroups" >> "East" >> "OPF_T_F" >> "Armored" >> selectRandom _armored1); That way it remains a config entry and doesn't become a string.
  6. HallyG

    Scripting help needed.

    Is _position an object or what? BIS_fnc_spawnGroup's first argument is a position which should be in an array format, thus meaning it can't be something like [object]. Additionally, the third argument is either: an array of unit types, a number, or a config entry. You're using a config entry, which does not need to be in an array, as far as I know.
  7. HallyG

    Scripting help needed.

    nul = [[_position], _faction, [_armored21]] call BIS_fnc_spawnGroup; to nul = [_position, _faction, _armored21] call BIS_fnc_spawnGroup;
  8. I edited the picture as well as its position, give it another try. Hopefully it'll work- it seemed to work for me. :)
  9. Not meaning to be pedantic, but: missionNamespace ["spotted", true, true]; missionNamespace ["spotted", false, true]; to missionNamespace setVariable ["spotted", true, true]; missionNamespace setVariable ["spotted", false, true];
  10. Possible starting point: h = [] spawn { PICTURE = "\A3\Weapons_F\Data\UI\gear_item_compass_ca.paa"; with uiNamespace do { TAG_Picture = findDisplay 46 ctrlCreate ["RscPicture", -1]; TAG_Picture ctrlSetPosition [safeZoneX, safezoneY, safeZoneW, safezoneH]; TAG_Picture ctrlCommit 0; }; findDisplay 46 displayAddEventHandler ["KeyDown", { params ["_control", "_key", "_shift", "_ctrl", "_alt"]; if (_key in (ActionKeys "NightVision")) then { (uiNamespace getVariable "TAG_Picture") ctrlSetText (["", PICTURE] select !(currentVisionMode player > 0)); }; false }]; };
  11. Maybe there isn't enough space in the inventory for the magazines? also you can replace gunman addMagazine "30Rnd_9x21_Mag"; gunman addMagazine "30Rnd_9x21_Mag"; gunman addMagazine "30Rnd_9x21_Mag"; with gunman addMagazines ["30Rnd_9x21_Mag", 3];
  12. This is just a simple hostage rescue script that I wrote today while playing around with the new BIS subtitle and holdAction functions; it spawns a hostage, with animations, and creates a task which will complete if the hostage is freed, or fail if the hostage dies. You have to be within 5 meters of the hostage to untie them. The hostage will automatically be deleted upon task completion. Just paste the following code into the debug console (not MP tested because I haven't tried to make it 100% MP compatible). Enjoy. private _position = player getPos [linearConversion [0, 1, random 1, 10, 5], random 360]; h = [_position, WEST] spawn { comment "HallyG's (probably buggy) hostage script"; params [ ["_pos", [], ["", [], objNull]], ["_side", WEST, [sideUnknown]] ]; _pos = _pos call { if (_this isEqualType objNull) exitWith {getPosATL _this}; if (_this isEqualType "") exitWith {getMarkerPos _this}; if (_this isEqualType locationNull) exitWith {locationPosition _this}; if (_this isEqualTo []) exitWith {[0,0,0]}; _this }; if (_pos isEqualTo [0,0,0]) exitWith {}; private _fnc_hostageSpawn = { params ["_centre", "_side"]; private _type = (["b","o","i"] select ([WEST,EAST,INDEPENDENT] find _side)) + "_soldier_unarmed_f"; private _grp = createGroup CIVILIAN; private _unit = _grp createUnit [_type, _centre, [], 1, "NONE"]; _unit setCaptive true; _unit disableAI "MOVE"; _unit setMimic "dead"; removeAllWeapons _unit; _unit spawn { while {(alive _this) && (captive _this)} do { _this playMoveNow ("acts_aidlpsitmstpssurwnondnon" + format ["0%1",str (ceil random 5)]); sleep 0.1; }; if (alive _this) then { _this enableAI "MOVE"; _this playMoveNow ("acts_aidlpsitmstpssurwnondnon_out"); }; }; _unit }; private _randomString = { private _string = ""; private _alp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for "_i" from 1 to _this do { _string = _string + (_alp select [floor random count _alp, 1]); }; _string }; sleep 1; private _unit = [_pos, _side] call _fnc_hostageSpawn; private _taskID = 8 call _randomString; [ _side, [_taskID], ["Rescue the hostage near to the player! You have to be within 5 meters of the hostage to untie them!", "HOSTAGE RESCUE", ""], [_unit, false], "Assigned", 10, true, "Default", false ] call bis_fnc_taskCreate; [_unit, _taskID] spawn { params ["_unit", "_taskID"]; waitUntil {!alive _unit}; if !(([_taskID] call BIS_fnc_taskState) isEqualTo "SUCCEEDED") then { [_taskID, "FAILED"] call bis_fnc_taskSetState; }; }; [ _unit, "Untie Hostage", "\a3\Data_f\clear_empty.paa", "\a3\Data_f\clear_empty.paa", "(alive _target) && (_target distance _this < 5)", "(alive _target) && (_target distance _this < 5)", { ["Hostage #1","Hurry the f*ck up!"] remoteExec ["BIS_fnc_showSubtitle", _caller]; }, {}, { _unit = (_this select 3) select 0; ["Hostage #1","Thank you!"] remoteExec ["BIS_fnc_showSubtitle", _caller]; _unit setMimic "combat"; _unit enableAI "MOVE"; _unit setCaptive false; sleep 1; [(_this select 3) select 1, "SUCCEEDED"] call bis_fnc_taskSetState; sleep 5; deleteVehicle _unit; }, { ["Hostage #1","What are you doing? Don't f*cking leave me here!"] remoteExec ["BIS_fnc_showSubtitle", _caller]; }, [_unit, _taskID], 3, 0, true, false ] remoteExec ["bis_fnc_holdActionAdd", 0]; };
  13. HallyG

    UK leaves Europe

    The referendum was an advisory vote for the House of Commons dictating what 'the majority' of people in the UK thought about our position in the EU. This does not necessarily meaning the house has to act upon this information, but, for the UK to legally leave the European Union, article 50 has to be revoked. I highly recommend reading these few articles: - Scotland Majority Remain and Northern Ireland majority Remain - Potential for Vetoing any actions taken to leave the EU. - http://www.politico.com/magazine/story/2016/06/brexit-change-europe-britain-us-politics-213990:The conservative party needs someone to step up as a leader (essentially meaning the PM will not elected be the public) and to take the entire responsibility of leaving and changing legislation on their shoulders. - Vote Leave campaign's ambiguous NHS funding pledge
  14. Maybe something like this: _Forests = selectBestPlaces [position player, 500, "(1 + forest + trees) * (1 - sea) * (1 - houses)", 30, 20]; _Forests = _Forests apply {_x select 0}; _Position = (selectRandom _Forests) findEmptyPosition [0, 10, "B_UAV_01_F"]; You would need to add a check to make sure an actual position is returned, though.
  15. Just dug this up- I started to this write a while a go but I gave up. I've attempted to update the script as much as possible but it should mainly be used as a starting point for a disguise script (AKA it's far from perfect): /* HallyG's Disguise Script v0.1 Put this in the units init line: this addAction ["Steal Uniform","_this call HGF",[],1,false,true,"","!alive _target AND (_target distance player) <3"]; */ HGF = { params [ ["_Enemy", objNull, [objNull]], ["_Friendly", objNull, [objNull]], ["_ID", 0, [0]], ["_arg",[],[[]]], ["_radius", 25, [0]] ]; if !(vehicle _Friendly isEqualTo _Friendly) exitWith {systemChat "YOU CANT CHANGE CLOTHES WHILE IN A VEHICLE!"}; if (({(_x distance vehicle _Friendly) < 3} count _Enemies) > 0) exitWith {systemChat "You are too close to an enemy!"}; if (({[objNull, "VIEW"] checkVisibility [getPosASL _x, getPosASL player] >0} count _Enemies) > 0) exitWith {systemChat "An enemy can see you!"}; private _Enemies = ((getposATL _Friendly) nearEntities [["Man"], _radius]) select {!(side _x in [CIVILIAN, playerSide]) && {(vehicle _x isEqualTo _x) && (_x != player)}}; _Enemies pushBack objNull; private _Uniform_Friendly = [uniformItems _Friendly]; _Uniform_Friendly pushBack [uniform _Friendly, headgear _Friendly]; private _Uniform_Enemy = [uniformItems _Enemy]; _Uniform_Enemy pushBack [uniform _Enemy, headgear _Enemy]; _Enemy removeAction _ID; [_Friendly, _Enemy, _Uniform_Enemy, _Uniform_Friendly, "AinvPknlMstpSnonWnonDnon_medic0"] spawn { params ["_Friendly", "_Enemy", "_Uniform_Enemy", "_Uniform_Friendly", "_Anim"]; _Friendly playMoveNow _Anim; waitUntil {animationState _Friendly != _Anim}; {removeUniform _x; removeHeadgear _x;} forEach [_Enemy, _Friendly]; _Friendly forceAddUniform ((_Uniform_Enemy select 1) select 0); _Friendly addHeadgear ((_Uniform_Enemy select 1) select 1); _Enemy forceAddUniform ((_Uniform_Friendly select 1) select 0); _Enemy addHeadgear ((_Uniform_Friendly select 1) select 1); private _grWH = createVehicle ["WeaponHolderSimulated", _Friendly modelToWorld [0,1,0], [], 0, "CAN_COLLIDE"]; { _grWH addItemCargoGlobal [_x, 1]; } forEach ((_Uniform_Enemy select 0) + (_Uniform_Friendly select 0)); }; private _oGroup = group _Friendly; [_Friendly] joinSilent createGroup (side _Enemy); deleteGroup _oGroup; systemChat "SUCCESS"; };
  16. <marker name= 'MARKER NAME'> TEXT TO BE UNDERLINED </marker>
  17. Take a look at the HitPart Event Handler
  18. HallyG

    subSkill Array Problem

    Not entirely sure what you want, but, to obtain the arithmetic mean for the 'aimingAccuracy' values of a group: _group = group player; _count = 0; _skill = "AimingAccuracy"; { _count = _count + (_x skillFinal _skill); } foreach units _group; _average = _count/(count (units _group));
  19. My bad- I should have read the wiki propely :)
  20. Or if you use the apply and configClasses commands: _music = ("isClass _x" configClasses (configFile >> "cfgMusic")) apply { [ configName _x, if (isText (_x >> "name")) then {getText (_x >> "name")} else {""}, if (isNumber (_x >> "duration")) then {getNumber (_x >> "duration")} else {0} ] };
  21. I haven't tested it in game but from the function a negative z value can be produced. For example, if the origin had a value z=0, and a radius >0 then a negative z could occur. Could just change z to its abs value
  22. It'll only produce position on the surface of the sphere. To produce a random position within the sphere, use: _theta = (2 * pi * (random 1)) * (180/pi); Moreover, it can produce positions underneath the terrain, too.
  23. Or just because it's more fun to over complicate everything, why not use spherical coordinates? :D _radius = 2; _origin = (getPosASL player) vectorAdd [0,0,20]; for "_i" from 1 to 300 do { _veh = createVehicle ["Sign_Sphere10cm_F", ASLtoAGL _origin, [], 0, "CAN_COLLIDE"]; _veh enableSimulation false; _theta = ((2 * pi * _i)/300) * (180/pi); _phi = acos((2 * (random 1)) - 1); _x = _radius * sin(_phi) * cos(_theta); _y = _radius * sin(_phi) * sin(_theta); _z = _radius * cos(_phi); _veh setPosASL (_origin vectorAdd [_x, _y, _z]); }; Produces random positions on the surface of a sphere. Not meant to be the most ideal solution ;)
×