Jump to content

beako

Member
  • Content Count

    57
  • Joined

  • Last visited

  • Medals

Everything posted by beako

  1. 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)" ]; }];
  2. 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"; }; };
  3. 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
  4. 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?
  5. 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.
  6. 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?
  7. 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]};"];
  8. 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.
  9. 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?
  10. 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.
  11. 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.
  12. 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"; };
  13. 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... }; ...
  14. HI All, In the BIS_fnc_moduleSector under the parameter setting #6 it describes the following: 6: _onOwnerChange (String) - Code as STRING that runs when a sector is captured, code is passed [ _sector, _owner, _old Owner ] in _this, code is also run at sector initialisation _owner will be default owner and _oldOwner will be sideUnknown I'm tried to insert the following code that lowers the _oldOwner flags then raises the _owner flags but the module seems to override the setFlagTexture function, and I cannot raise the flag once it hits the bottom. //Code as STRING that is run when sector changes ownership [ "_onOwnerChange", " private _flagsArray = (_this select 0) getVariable 'flags'; private ['_flagSideTexture']; _flagSideTexture = ''; switch (_this select 2) do { case EAST : {_flagSideTexture = '\A3\Data_F\Flags\Flag_CSAT_CO.paa'}; case WEST : {_flagSideTexture = '\A3\Data_F\Flags\Flag_NATO_CO.paa'}; default {_flagSideTexture = '\A3\Data_F\Flags\Flag_white_CO.paa'}; }; {_x setFlagTexture _flagSideTexture} forEach _flagsArray; {[_x, flagAnimationPhase _x - 1, 0.1] call BIS_fnc_animateFlag} forEach _flagsArray; switch (_this select 1) do { case EAST : {_flagSideTexture = '\A3\Data_F\Flags\Flag_CSAT_CO.paa'}; case WEST : {_flagSideTexture = '\A3\Data_F\Flags\Flag_NATO_CO.paa'}; default {_flagSideTexture = '\A3\Data_F\Flags\Flag_white_CO.paa'}; }; {_x setFlagTexture _flagSideTexture} forEach _flagsArray; {[_x, flagAnimationPhase _x + 1, 0.1] call BIS_fnc_animateFlag} forEach _flagsArray; ", [ "" ] ], Any ideas on how I can do this? Ideally I would like the old owner's flag to lower completely, then replace the texture with the new owner and raise to the top, to match the BIS_fnc_moduleSector vertical bar animation.
  15. Thanks everyone. Larrow this does exactly what I want, I work with this to incorporate into my game. Thanks again, this would have taken me weeks.
  16. 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};}; }; }];
  17. 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};}; }; }];
  18. HI All, In my description.ext below I have 3 different displayNames, but want to identify the "displayName" the player selected from the respawn menu? description.ext respawnTemplates[] = {"MenuPosition","MenuInventory"}; class CfgRespawnInventory { class WEST1 { displayName = "Capt 'Deuce' Williams"; // Name visible in the menu ... }; class WEST2 { displayName = "Sgt Thomas 'Mac' Macintyre"; // Name visible in the menu ... }; class WEST3 { displayName = "Lt John Davis Tyler"; // Name visible in the menu ... }; }; How could I use [missionconfigfile >> "CfgRespawnInventory" >> "WEST2"] call BIS_fnc_displayName to identify the character the player selected from the respawn menu?
  19. I thought you could run the "HitPart" EH by adding it to the shooter according to this; "While you can add "HitPart" handler to a remote unit, the respectful addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well. The event will not fire if the shooter is not local, even if the target itself is local. Additionally, if the unit gets damaged by any means other than shooter's shooting, "HitPart" will not fire. Because of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation. If so, how to I get the "HitPart" EH to execute? I tried the following for a MP game for each player that is the shooter: onPlayerRespawn.sqf player addMPEventHandler ["HitPart",{hint str _this}]; ..but I assume it does not fire because it is not local?
  20. Can someone suggest why the createMission.sqf exits to the main menu and then crashes Arma the second or third time I run it? Which dialog should I not close to return to mission menu? I am trying to select a map or choose randomly before starting a MP game.
  21. Hi all, How do I go about creating and filling in a circle that covers the world terrain so a player can see the area visually and not on the map? Not sure where to start, do I create a "#lightpoint"?
  22. Thanks, Not sure if I should start a new thread on this. I am creating sectors using _logic= (createGroup sideLogic) createUnit ["ModuleSector_F", _pos, [], 0,"NONE"]; which should create a sector that is global. Then initiating it with _logic call BIS_fnc_moduleSector.
  23. Hi All, I'm trying to delay the respawn menu I created with: respawnTemplates[] = {"MenuInventory","MenuPosition"}; because I want to watch the footage from my deathcam function play out to completion, but instead the respawn menu interrupts and automatically pops-up. Does anyone know how I can delay it or is this out of our control?
  24. Hi All, I'm trying to delay the respawn menu I created with: respawnTemplates[] = {"MenuInventory","MenuPosition"}; because I want to watch the footage from my deathcam function play out to completion, but instead the respawn menu interrupts and automatically pops-up. Does anyone know how I can delay it or is this out of our control?
  25. Thanks, but this does not solve the problem. The respawn UI menu still appears and overides the deathcam.
×