Jump to content

beako

Member
  • Content Count

    67
  • Joined

  • Last visited

  • Medals

Everything posted by beako

  1. What is the best way to create and eventhandler for currentThrowable items? I want an event handler to track every time I throw a throwable, so when my player's inventory of "HandGrenade"or "SmokeShellGreen" is depleted I can refill it. I have tried to use an "explosion" EH with the following but does not work as _throwableArray is an array of strings, and I can't figure out how to create an array of throwables on the player...Also I don't think this would work for a "SmokeShell" _throwableArray = []; { if (_x == _throwable) then {_throwableArray pushBack _x} } forEach (magazines player); { _x addEventHandler ["Explosion", { params ["_vehicle", "_damage"]; if (damage _vehicle > 0.1) then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }]; } forEach _throwableArray; I have tried to use "AnimDone" EH, but could not even find the common animation for throwing... player addEventHandler ["AnimDone", { params ["_unit", "_anim"]; if (_anim == "AmovPercMrunSlowWpstDf_AmovPercMstpSrasWpstDnon_gthThrow") then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }];
  2. Hi all, Just curious in case anyone has come accross a ruins model for bridges or bridge segments? Ultimately, I'm not sure if bridges can be destroyed in the game but would like confirmation. thanks
  3. HI All, I cannot get the AI to move to the top level waypoints of a tower. The AI seems to stay on the ground level. How can I get the AI to move to each building position on the top floor? for example: player addAction ["<t color='#f44298' size='1' > BUILDING SEARCH</t>", { _posTestGrp = screenToWorld [0.5,0.5]; _building = "Land_Cargo_Tower_V1_No1_F" createVehicle _posTestGrp; sleep 1; _testgrp = createGroup WEST; _soldier = "B_Soldier_F"; _newUnit = _testgrp createUnit [_soldier, _posTestGrp , [], 0, "NONE"]; _buildingPositionsArray = [_building] call BIS_fnc_buildingPositions; _buildingPositionsCount = count _buildingPositionsArray; for "_i" from 10 to _buildingPositionsCount - 1 do { _wp = _testgrp addWaypoint [AGLToASL (_building buildingPos _i), 0]; //_wp waypointAttachObject _building; _wp setWaypointHousePosition _i; _testgrp setCurrentWaypoint _wp; //_wp setWaypointType "MOVE"; _arrow = createSimpleObject ["Sign_Arrow_F", AGLToASL (_building buildingPos _i)]; hint format ["moving to %1", getPosATL _arrow]; waitUntil { sleep 1; hint format ["%1m to %2", round (AGLToASL getPos _newUnit distance AGLToASL (_building buildingPos _i)), AGLToASL(_building buildingPos _i)]; ((AGLToASL getPos _newUnit distance AGLToASL(_building buildingPos _i)) < 2) }; sleep 3; deleteVehicle _arrow; }; },"",2]; I also tried without waypoints and used ATL player addAction ["<t color='#f44298' size='1' > BUILDING SEARCH</t>", { _posTestGrp = screenToWorld [0.5,0.5]; _building = "Land_Cargo_Tower_V1_No1_F" createVehicle _posTestGrp; // Land_Cargo_HQ_V1_F sleep 1; _testgrp = createGroup WEST; _soldier = "B_Soldier_F"; _newUnit = _testgrp createUnit [_soldier, _posTestGrp , [], 0, "NONE"]; _buildingPositionsArray = [_building] call BIS_fnc_buildingPositions; _buildingPositionsCount = count _buildingPositionsArray; for "_i" from 0 to _buildingPositionsCount - 1 do { _buildingPos = [(_building buildingPos _i) select 0, (_building buildingPos _i) select 1,((_building buildingPos _i) select 2) + 5] ; _arrow = "VR_3DSelector_01_default_F" createVehicle _buildingPos; _arrow setPosASL _buildingPos; sleep 0.1; /* _wp = _testgrp addWaypoint [[(getPosATL _arrow) select 0,(getPosATL _arrow) select 1, ((getPosATL _arrow) select 2) + 5], 0]; _wp waypointAttachObject _building; _wp setWaypointHousePosition _i; _testgrp setCurrentWaypoint _wp; _wp setWaypointType "MOVE"; */ _newUnit move getPosATL _arrow; waitUntil { sleep 1; hint format ["%1m to %2", round (_newUnit distance getPosATL _arrow), getPosATL _arrow]; (( _newUnit distance getPosATL _arrow) < 3) }; sleep 3; hint format ["I am here at %1", getPosATL _arrow]; deleteVehicle _arrow; }; },"",2]; But soldier does not climb up the stairs to get the first building waypoint!
  4. HI All, I'd like to create a camera setting that can be toggled from the default 3rd person view to one where the camera is pulled back slightly and over the head, while in game and the player still has control of his unit. Thus I don't want to create a cpp for this. I've started with this below, but wondering if someone already has something scripted, whereby the player can toggled back and forth in game between two different 3rd person views? private _cam = "Land_HandyCam_F" createVehicleLocal [0,0,0]; _cam hideObject true; _cam attachTo [player, [0,-3,5]]; _cam camSetTarget getPos cursorTarget; _cam setVectorUp [0,0.60,0.40]; _cam switchCamera "EXTERNAL";
  5. HI All, I'm having problems trying to create a script that returns the value for the current active display. I want to know if the player is looking at the map or the main screen. allDisplays returns a list of all opened GUI displays, including both the map (findDisplay 12) and the main display (findDisplay 46). BUT I want to know if the map (findDisplay 12) is currently being shown and the main display (findDisplay 46) display is hidden underneath and vice-versa. Thansk in advance... RESOLVED: visibleMap
  6. OK thanks, it works. Not sure what I was doing wrong before, maybe I was running the development build but not using arma3diag_x64 ?
  7. HI All, I am trying to troubleshoot my SP mission, as I have an issue with a few AI groups that don't want to head to their waypoints, but don't know how to activate "All" diag_enable true; From https://community.bistudio.com/wiki/Arma_3_Diagnostics_Exe it states: Simply run the exe as you would use the standard arma3.exe. For example to perform diag on a PBO, add it as a launch parameter (-mod=@YOURMOD) Once the game is loaded, go into the editor and select 'Virtual Reality'. I am running the Development Build, but then where do I execute "All" diag_enable true;? Do I place it in initServer.sqf or Desciption.ext? I'm also don't know how to do the following as stated: For example to perform diag on a PBO, add it as a launch parameter (-mod=@YOURMOD) could someone please provide a few more steps to descibe this? Thanks in advance
  8. Thanks, but once it loads the devevlopment build how or where do I use "All" diag_enable true;?
  9. HI All, I'm creating a basic script that attaches a "B_Parachute_02_F" to a vehicle when it exits a plane and then opens the parachute. Sometimes the vehicle is not direction above and is slightly off the landing location, when is comes off the plane. I have set the wind to 0 in both directions. How can I script the parachute to steer to the landing location once the parachute is open? _class = "B_Parachute_02_F"; _para = createVehicle [_class, [0,0,0], [], 0, "FLY"]; _paras = [_para]; if (_vehType iskindof "car") then { _veh attachTo [_para, [0,0,0]]; //---attachment location of parachute to _veh }else{ _veh attachTo [_para, [0,0,-1]]; }; _veh allowDamage false;
  10. HI All, I'm trying to write a script that spawns units in a nearby building (like houses, farms, hangers, anything with a roof and door), but don't want them to spawn on telephone lines or electrical lines or any weird stuff... #1 I thought BIS_fnc_isBuildingEnterable would help filter these type of buildings out, but it didn't...how can I avoid spawn from these types of places? Here is my script. #2 Also, I keep getting a "Error undefined variable in expression: _building" on line 50, whenever my player leaves by 250m, but thought I defined it? Any ideas how to solve these 2 problems? thanks onMapSingleClick "player setPosATL _pos"; _civilianCount = 0; _nearbyLocations = []; _buildingArray = []; _realBuildingArray = []; while {true} do { sleep 3; waitUntil { // find "Building" near player to spawn civilians _buildingArray = nearestObjects [player, ["House"], 250]; { if ([_x, 3] call ) then {_realBuildingArray pushBackUnique _x}; } forEach _buildingArray; // player is near a location _building = objNull; if !(_realBuildingArray isEqualTo []) then { _realBuildingArray = nearestObjects [player, ["House"], 250]; _building = _realBuildingArray select ((floor random (count _buildingArray)) + 1); systemChat format ["_building: %1", typeOf _building]; // create groups of civilians _grp = createGroup civilian; for "_i" from 1 to floor random 6 do { _unit = _grp createUnit ["C_scientist_F", _building, [], 0, "NONE"]; _wp =_grp addWaypoint [position player, 10]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "LIMITED"; // spawn function for groups to keep moving to player then return then get deleted [_unit, _grp, _wp, _realBuildingArray] spawn { params ["_unit", "_grp", "_wp", "_realBuildingArray"]; waitUntil { sleep 3; // new waypoint for player that moves if ((player distance2D waypointPosition _wp) > 5) then { _wp =_grp addWaypoint [position player, 5]; _grp setCurrentWaypoint _wp; }; ( ((_unit distance2D player) < 10) or ((player distance2D _unit) > 250) ) }; // select building to return to _building = objNull; if !(_realBuildingArray isEqualTo []) then { _building = _realBuildingArray select ((floor random (count _realBuildingArray)) + 1); _wp =_grp addWaypoint [_building, 0]; _grp setCurrentWaypoint _wp; }; // return to building and get deleted waitUntil { sleep 3; (((_unit distance2D waypointPosition _wp) < 2) or ((player distance2D _unit) > 250) ) }; deleteVehicle _unit; }; }; sleep floor random 5; }; }; };
  11. Hi All, Any suggestions on how to conceal knowledge about an enemy mine after is has been revealed after a set amount of time. I was going to just delete it and recreate it in the same spot, after the player has left the area, but was wondering it there is a specific function or better work around.
  12. Hi All, How to I obtain the map dimensions of a particular map in Arma 3. worldSize returns the area bur for rectangular maps like Livonia. I want to create an area that is 500m from then end of the map height and width. hint format ["drawRectangle \n worldName: %1 \n worldSize: %2",worldName, worldSize] ; (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",{ (_this select 0) drawRectangle [ [worldSize / 2,worldSize / 2,0], (worldSize / 2) - 500, (worldSize / 2) - 500, 0, [0,0,1,1], "#(rgb,8,8,3)color(0,1,1,0.25)" ]; }];
  13. HI ALl, I have a script for a UAV (Sentinel) that targets enemy units (tanks and soldiers)... The problem is, as part of the script their is a JTAC soldier that uses laserTarget to target the same object as the UAV. The UAV is armed with PylonMissile_1Rnd_BombCluster_01_F and PylonMissile_Missile_AGM_02_x2, but I only want the UAV to fire the AT munition (PylonMissile_Missile_AGM_02_x2) on the tank, but because the laserTarget is on the tank from the JTAC, it fires the bombcluster munition instead. How should I script for the UAV to use weapon_AGM_65Launcher on Tanks only? I've tried the following with [0] and [-1] as a turretPath for selectWeaponTurret, but has no effect...I even tried using selectWeapon with no luck. I want to avoid forceFire, since it misses the target. // laserTarget from JTAC soldier _laserTarget = laserTarget _JTACUnit; // AT Ammo Count _getPylMagArray = getPylonMagazines _airTransport; _ammoCountATArray = [0,0]; for "_i" from 1 to 2 do { if (((_getPylMagArray select (_i - 1)) find "PylonMissile_Missile_AGM_02_x2") > -1) then { _ammoCountATArray set [(_i - 1), (_airTransport ammoOnPylon ("pylon" + str _i))]; } else { _ammoCountATArray set [(_i - 1), 0]; }; }; _ammoCountAT = 0; {_ammoCountAT = _ammoCountAT + _x} forEach _ammoCountATArray; // do not user clusterbomb on tanks if !(isNull _laserTarget) then { if (_ammoCountAT > 0) then { _sentinelUAV selectWeaponTurret ["weapon_AGM_65Launcher", []]; //"BombCluster_01_F" _sentinelUAV selectWeapon "weapon_AGM_65Launcher"; }; };
  14. HI All, I'm trying to get the a laserTarget on a soldier with a player or AI user the Laser Designator to target units. The laserTarget appears on all units, including soldiers in static weapons but passes through all other soldiers. #1) Any advise on creating a laserTarget attachedTo a soldier and deleting working around removing the one that passes through the soldier? Here is the script I'm using for creating a laser line and laserTarget. params ["_startObject"]; if (isNull _startObject) exitwith {}; ["laser", "onEachFrame", { params ["_startObject"]; //if (currentVisionMode _startObject == 1) exitwith {}; _designatedObj = laserTarget _startObject; if !(isNull _designatedObj) then { _lasercolour = [1,0,0,1.5-sunOrmoon]; // first 3 numbers are RGB _range = 2500; // laser range _maxsize = 5; _start = ASLToAGL eyePos _startObject; _end = getPos _designatedObj; _int = lineIntersectsSurfaces [atltoasl _start, atltoasl _end, _startObject, _designatedObj, true, 1, "VIEW", "GEOM"]; _size = _maxsize; //hintSilent format ["_int: %1", _int]; if !(_int isEqualTo []) then { _end = (_int select 0) select 0; _end = asltoagl _end; _length = _start vectorDistance _end; systemchat format ["_length: %1 _int: %2 ", round _length, typeOf ((_int select 0) select 2)]; if (_length >= _range) then { _size = 0; } else { _size = _maxsize; }; if (_length < 1) then {_size = 0}; } else { _length = _start vectorDistance _end; systemchat format ["_length: %1", round _length]; }; drawLine3D [_start, _end, _lasercolour]; // comment this out to remove the line drawIcon3D ["\a3\data_f\car_light_flare2.paa", _lasercolour, _end, _size, _size, random 360, "", 0, 0.05, "PuristaMedium"]; },[_startObject]] call BIS_fnc_addStackedEventHandler; #2) ALSO, Is there a way to make the actual laserTarget generated from the laser designator visible in daylight. I would like to use it instead if I can as it scales in size with distance appropriately? I've tried playing with setLightIntensity, setLightBrightness, setLightColor and setLightDayLight but had not luck. thanks
  15. HI All, Based on createUnit using syntax type createUnit [position, group, init, skill, rank] it states ""CARGO" - The unit will be created in cargo of the group's vehicle, regardless of the passed position. If group has no vehicle or there is no cargo space available, the unit will be placed according to "NONE"." Yet, I cannot create units inside a vehicle unless I use moveIn as below. _posLand = screenToWorld [0.5,0.5]; _veh = "O_T_LSV_02_armed_F" createVehicle [0,0,100]; _grp = createGroup EAST; _veh setVehiclePosition [_posLand, [], 0]; _grp addVehicle _veh; _unit = _grp createUnit ["O_V_Soldier_ghex_F", [0,0,0], [], 0, "CARGO"]; _unit moveInAny _veh; Is there a way to create units directly inside a vehicle with designating a position or moving them in?
  16. I thought so also at first so I used BIS_fnc_spawnVehicle, then tried to add a unit in the spawned vehicle with: _vehArray = [[0,0,100], getDir player, _x, _AIside] call BIS_fnc_spawnVehicle; _veh = _vehArray select 0; _vehCrew = _vehArray select 1; _grp = _vehArray select 2; _veh setVehiclePosition [_posLand, [], 0]; _grp addVehicle _veh; _unit = _grp createUnit ["O_V_Soldier_ghex_F", [0,0,0], [], 0, "CARGO"]; _unit moveInAny _veh; But this too does not create the unit in the "CARGO" of the vehicle.
  17. HI All, I need a better understanding of the consequences of using global variables in my MP game. I read the following Variables and KK's blog – Variables - ArmA Scripting Tutorials: Variables all three part by Killzonekid but still unsure how global variables will impact the performance of my MP game and the many scripts I have. For example, is it better to use the following in every function that requires the enemy's side _AIside = WEST; if (playerSide isEqualTo WEST) then {_AIside = EAST}; or simply create the following in initServer.sqf if (playerSide == WEST) then {AIside = EAST} else {AIside = WEST}; and use AIside in each function. What is better for overall performance?
  18. Hi ALL, Is there a way yet to disable Optics when pressing the RMB? I'm using the following to assign a value to the RMB that triggers a function, but unfortunately it also causes the player to use their optics. I would like to temporarily disable optics when triggering this function and reenable it after. _mouseM = (findDisplay 46) displayAddEventHandler ["MouseButtonDown", "if (_this select 1 == 1) then {missionnamespace setvariable ['place',true]};"];
  19. HI All, I've read the section in Arma 3 Dynamic Simulation but it is still not clear to me how to display the Ingame diagnostics, particularly the map with DynSimEntities. It states, "As the part of the Dynamic Simulation system 3 new diagnostic modes were added to the debug console. All 3 diagnostic modes overlay map with an extra information. The modes can all be active at the same time, if needed." yet where do I activate this in the debug console and how do I see the diagnostic map? Instead I get an error when I enter "DynSimEntities" diag_enable true; in the debug console saying "DynSimEntities" #diag_enable true; Error missing ; Is this because I am running it in an MP game? Has anyone used this before? If so, please provide more detailed steps to see the map grid with DynSimEntities.
  20. Thanks warlord554, I could sill not find the .p3d file for a soldier holding his secondary weapon over his shoulder. But I thought I could somehow cheat using BIS_fnc_createSimpleObject even though Arma 3 Simple Objects states "Simple Object Capability - Not all objects work well as simple objects - some objects require adjustment data (that need to be prepared properly by the content creator), some do not work at all (like units, game logics, weapon holders etc.)." So far I have only managed to create a headless body of a man with arms out to the side. My goal is to find a way to create an soldier holding his secondary weapon over his shoulder, setObjectTexture to it and rotate and translated it to wherever screenToWorld is pointed to, then spawn it. So far, I can do this for vehicles using BIS_fnc_createSimpleObject, as it is less demanding on framerate. if (_vehType isKindOf "Man") then { _text = getText (configfile >> "CfgVehicles" >> _vehType >> "model"); _textArray = toArray _text; _textArray deleteAt 0; _text = toString _textArray; _veh = [["B_Soldier_base_F", _text, 0, 0, ["AmovPercMstpSrasWrflDnon_AmovPercMstpSrasWlnrDnon_end",1]], _pos, 0, true, false] call BIS_fnc_createSimpleObject; } Any ideas?
  21. Where could I locate the .p3d models for various animations of soldiers? I would like to create a model of an AT soldier aiming his secondary weapon, rotate it and position it with the screenToWorld function before spawning it at that location.
  22. HI All, I'm trying to update information within the custom menu and sub-menu so I don't have to keep exiting the menu for it to rerun the function. I there are certain conditions that may get updated during game play, like _ownsRadioTower, my_Money and player getVariable ["REINFORCEMENTS", FALSE] that may change while the player in the custom menu, and I would like it to update the status from being disabled (in grey )to enabled. MY_MENU_inCommunication = [ ["DESTRUCTION MENU",true], ["MOTOR POOL", [2], "#USER:MENU_MOTOR_POOL", -5, [["expression", " player sideChat ""Order Vehicles"" "]], "1", "1"], ["ARMORY", [3], "#USER:MY_SUBMENU2_inCommunication", -5, [["expression", " player sideChat ""Order Emplacements"" "]], "1", "1"], ["RADIO TOWER", [4], "#USER:MY_SUBMENU3_inCommunication", -5, [["expression", " player sideChat ""CALL IN SUPPORT/INTEL"" "]],"1", missionnamespace getvariable ["mainActive3","0"] ], ["REINFORCEMENTS", [5], "#USER:MY_SUBMENU4_inCommunication", -5, [["expression", " player sideChat ""CALL IN REINFORCEMENTS"" "]], "1", missionnamespace getvariable ["mainActive4","0"] ] ]; if (_ownsARadioTower) then { mainActive3 = 1} else {mainActive3 = 0}; //&& sector1 getVariable "owner" == WEST if (my_Money >= 25 and player getVariable ["REINFORCEMENTS",FALSE]) then { mainActive4 = 1} else {mainActive4 = 0}; _array5 = MY_MENU_inCommunication select 3;// 4th line menu item _array5 set[6, str mainActive3];// change grey out status _array5 = MY_MENU_inCommunication select 4;// 4th line menu item _array5 set[6, str mainActive4];// change grey out status showCommandingMenu "#USER:MY_MENU_inCommunication"; Thanks for any advice in advance.
  23. HI ALL, I am simply trying to replace the current secondary weapon with a different type of launcher, but have it added already preloaded. Instead I have to wait until the unit reloads the weapon then I have to restock his backpack with the magazine he just used. Is there a simpler way to add a preloaded weapon? _man2 = objNull; {if (typeOf _x == "B_T_Soldier_LAT_F") then {_man2 = _x}} forEach units player; _lancherMagArray = []; _BP = ""; _BPItems = []; _backPackCamo = 'B_Kitbag_sgg'; // for units with secondaryWeapons _lancherMagArray = getArray (configfile >> "CfgWeapons" >> secondaryWeapon _man2 >> "magazines"); if !(_lancherMagArray isEqualTo []) then { // for B_T_Soldier_LAT_F replace NLAW with launch_RPG32_ghex_F if (typeOf _man2 == "B_T_Soldier_LAT_F") then { [_man2, "launch_RPG32_ghex_F", 2, "RPG32_F"] call BIS_fnc_addWeapon; _lancherMagArray = ["RPG32_F","RPG32_HE_F"]; }; // replaceBP with "B_Kitbag_cbr" removeBackpack _man2; _man2 addBackpack _backPackCamo; // B_Kitbag_sgg B_Kitbag_mcamo B_Kitbag_rgr B_Kitbag_cbr // fill backpack { if (_man2 canAddItemToBackpack _x) then { waitUntil { _man2 addItemToBackpack _x; !(_man2 canAddItemToBackpack _x) }; }; } forEach _lancherMagArray; _BP = backpack _man2; _BPItems = backpackItems _man2; }; // cheat to fill backpack after reloading launcher if (typeOf _man2 == "B_T_Soldier_LAT_F") then { waitUntil { ((_man2 ammo "launch_RPG32_ghex_F") == 1) }; _man2 addItemToBackpack "RPG32_F"; };
  24. HI all, I'm trying to set the brightness of an object based on the ambient brightness of the environment. But so far the only way I found how to do this is based on the time of day. Is there a way to determine the ambient brightness in the based on the current time of day? _intensity = 0; _timeOfDay = daytime; switch (TRUE) do { case ( (_timeOfDay >= 0) and (_timeOfDay < 2) ) : {_intensity = 0.5}; case ( (_timeOfDay >= 2) and (_timeOfDay < 3) ) : {_intensity = 0.75}; case ( (_timeOfDay >= 3) and (_timeOfDay < 4) ) : {_intensity = 1.0}; etc... }; ...
×