Jump to content

BEAKSBY

Member
  • Content Count

    431
  • Joined

  • Last visited

  • Medals

Everything posted by BEAKSBY

  1. BEAKSBY

    Osprey typeOf name

    This: displayName = "Boeing MV-22 Osprey"; from configfile >> "CfgVehicles" >> "MV22" >> "displayName" side = 1;
  2. BEAKSBY

    Osprey typeOf name

    Wait! I have one in my mission on stratis and i grabbed it from the unit menu under air, same with the cargo plane. AND the Osprey can fly! I've flown it...but can't pilot the cargo plane. I guess they are imports from Arma 2? The cargo plane is "C130J_Cargo" what it the typeOf for the Osprey?
  3. Do closed doors improve the top speed of the aircraft? Curious if the simulation is that detailed?
  4. HI All, From the "Fired" EH if I use select 1 I get for example missiles_titan_static (weapon: String - Fired weapon). But I need the type of weapon so I can then call another script for it. I tried _gun1 addEventhandler ["Fired",{hint format ["magazines: %1", [(configfile >> (_this select 1)),true] call BIS_fnc_returnParents]}]; but this didn't work.
  5. Thanks Iceman77, I found if I use: hint format ["%1",(_this select 0)]; it returns the player in the gun BUT if I use hint format ["_this: %1", str typeOf (_this select 0)]; it retured the typeOf gun as a string...weird? Anyhow I got it working, but I can't get the gun to reload with loadMagazine at the end...please help. _gun1 = createVehicle ["B_static_AT_F", position player, [], 0, "NONE"]; _SWKilledEH = _gun1 addeventhandler ["fired", {hint format ["%1", str typeOf (_this select 0)]; if ((count magazines (_this select 0)) == 0) then { for "_i" from 1 to 4 do { (_this select 0) addMagazineTurret [ (getArray (configfile >> "CfgVehicles" >> typeOf (_this select 0) >> "Turrets" >> "MainTurret" >> "magazines")) select 0, [0]]; (_this select 0) loadMagazine [[0], str typeOf (_this select 0), str (_this select 5)]; }; }; }];
  6. Thanks Tajin, Appreciate you looking at it. I thought it would reduce load on the script if it only checked mines from the "diabled" array. I need to re-activate a mine if a player or AI is near the mine also while a temp_veh is there too. How would I write that programmatically? { _mine = _x { if ((_mine distance temp_veh < 5) and (_x distance _mine >3)) then { _mine enableSimulation false; _mine setVariable["disabled",true]; } forEach [allUnits + playableUnits]; } else { if (_x getVariable ["disabled", false]) then { _x enableSimulation true; }; }; } forEach allMines;
  7. Hi All, In this script I would like to deactivate all mines that are close to the "ghost vehicle" = temp_veh. The "ghost vehicle" is being positioned before I I spawn the real vehicle in its place. BUT I do not want the player to cheat and follow close behind the "ghost vehicle" thus allowing them to walk over the deactiveated mines. Why is the reactiveation of mines portion not working below? ["move_ghost", "onEachFrame", { _pos = screenToWorld [0.5,0.5];// land position //deactivate all mines in range of ghost vehicle disabled = []; { if (_x distance temp_veh < 5) then { disabled pushBack _x; _x enableSimulation false; }; } forEach allMines; //to prevent cheating using ghost vehicle to clear mines reactivate mines when it is close to player or other units { _unit = _x; { if (_unit distance _x < 2) then { _x enableSimulation true; disabled = disabled - [_x]; }; } forEach disabled; } forEach [allUnits + playableUnits]; //temp_hol setpos _pos; temp_hol setpos [(_pos select 0), (_pos select 1), 0.5]; temp_veh setDir (getdir player )+ dir1; //temp_hol setVectorUp surfaceNormal position temp_hol; temp_hol setVectorUp surfaceNormal getPosATL temp_hol; }] call BIS_fnc_addStackedEventHandler; waituntil {missionnamespace getvariable ["place",false] or missionnamespace getvariable ["cancel",false]}; _posDrop = getPosATL temp_veh; //_mouseZ = (findDisplay 46) displayAddEventHandler ["MouseZChanged","dir1=0"];// zero mouse wheel ["move_ghost", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;// terminates oneachframe //reactivate mines back {_x enableSimulation true} forEach disabled;
  8. I thought removeAllActions from post #7 would clear all addActions?...but still no luck.
  9. Hi Folks, I'm trying to create an addAction with a title that includes a countdown timer showing how much time is left before the addAction will be ready to execute. I have tried the following: myAction = player addAction ["dynamic",{ _return = [] call BEAKS_fnc_mines; },[],0,true,true, "", "_return = [] call BEAKS_fnc_mines; _specialTimeLeft = 0; if (_return == 1) then { _timeNow = time; _specialTimeLeft = 120 - (time - _timeNow); // seconds left in 2 minute countdown }; _display = _specialTimeLeft + ' Plant Mines '; player setUserActionText [myAction, _display ]; (_specialTimeLeft < 0)" ]; _return = [] call BEAKS_fnc_mines; will return "1" if the function mines is executed (and the mines are created) and will return "0" if it is aborted. I would like the addAction to be available to execute once _specialTimeLeft has run out. But the addAction will only appear if the condition is true or not. How do I get it to show but not be executable until the condition is met?
  10. HI All, I can't remember the command for showing your units on the map? ...it was something like showenable? Also, is there a command that prevents player from dropping weapons / inventory?
  11. Ok thanks again guys, ...and yes setGroupIconsVisible is the one I was looking for.
  12. Thanks Iceman77, I've modified you script a bit with the following: while {!timerDone} do { _seconds = _seconds - 1; _timer = ""; if ((_seconds - specialReadyTime) > 0) then { if ((_seconds mod 60)<10) then {_timer = format ["%1:0%2", floor (_seconds/60), _seconds mod 60]; } else { _timer = format ["%1:%2", floor (_seconds/60), _seconds mod 60]; }; hintSilent format ["UAV Time remaining: %1", _timer]; //...more code... also I found if _seconds = [_this, 1, 0, [0]] call BIS_fnc_param; is 0 then _seconds = _seconds - 1; generates a negative number and there is no if condition to satisfy this. Therefore the hint will show negative numbers.
  13. Thanks KK, What are you planning on doing with your MANW prize money? :) On a similar note... I've add the code you provided above to onPlayerRespawn.sqf // for sniper if (_respawnedPlayer hasWeapon "srifle_EBR_DMS_pointer_snds_F") then { player setVariable ["time", floor time]; player setVariable ["Ready", 1]; while {(_respawnedPlayer hasWeapon "srifle_EBR_DMS_pointer_snds_F")} do { waitUntil {sleep 0.5; (player getVariable "Ready" == 1)}; player setVariable ["id", player addAction ["", { if (player getVariable "time" > floor time) exitWith {}; player removeAction (_this select 2); //hint "PLANTING"; [] call BEAKS_fnc_mines; }, "", 1, false, true, "", " if (player getVariable 'time' > floor time) then { player setUserActionText [player getVariable 'id', format [ ""<t color='#00FFFFFF'>Plant Mines in %1</t>"", (player getVariable 'time') - floor time ]]; } else { player setUserActionText [player getVariable 'id', 'Plant Mines']; }; player setVariable ['Ready', 0]; true "]]; }; }; ...and inside BEAKS_fnc_mines I added player setVariable ["Ready", 0]; at the top of the script, followed by player setVariable ["Ready", 1]; player setVariable ["time", floor time + specialReadyTime]; ...once the function is complete. BUT, the addAction that calls the mines function remains when the player dies and respawns as another type of soldier. Inside onPlayerKilled.sqf I've added: _KilledPlayer = _this select 0; _KilledPlayer setVariable ["id", nil]; removeAllActions _KilledPlayer; ...but the addAction remains for the next player I respawn as ?... // for SAW if (_respawnedPlayer hasWeapon "Laserdesignator") then { player setVariable ["time", floor time]; player setVariable ["Ready", 1]; while {(_respawnedPlayer hasWeapon "Laserdesignator")} do { waitUntil {sleep 0.5; (player getVariable "Ready" == 1)}; player setVariable ["id", player addAction ["", { if (player getVariable "time" > floor time) exitWith {}; player removeAction (_this select 2); //hint "PLANTING"; [] call BEAKS_fnc_UAV; }, "", 1, false, true, "", " if (player getVariable 'time' > floor time) then { player setUserActionText [player getVariable 'id', format [ ""<t color='#00FFFFFF'>UAV CAS in %1</t>"", (player getVariable 'time') - floor time ]]; } else { player setUserActionText [player getVariable 'id', 'UAV CAS']; }; player setVariable ['Ready', 0]; true "]]; }; }; How can I get rid of the previous addAction so it does not appear for then next player I respawn as?
  14. Thanks again Iceman77, I also wanted to see if I can display the time left before the addAction would become availabe in the addAction itself, possibly using setUserActionText? Otherwise I'll create a dialog for it, for each player.
  15. What I've tried below is not working? I don't think formations for soldiers works on helicopters? switch(side player)do { case WEST:{_planeType = "B_Heli_Light_01_armed_F"}; case EAST:{_planeType = "O_Heli_Light_02_F"}; }; _grp = createGroup (side player); for "_i" from 0 to 2 do { sleep .1; _spos = [(getPosATL player select 0) - (sin _planeDirection) * _planeDistance, (getPosATL player select 1) - (cos _planeDirection) * _planeDistance , 50]; if (_i == 1) then { _plane1Pos = [_spos, _planeSpread,_planeDirection -90] call bis_fnc_relpos; _plane1Pos set [2,_flyHeight]; _spos = _plane1Pos; }; if (_i == 2) then { _plane1Pos = [_spos, _planeSpread,_planeDirection +90] call bis_fnc_relpos; _plane1Pos set [2,_flyHeight]; _spos = _plane1Pos; }; _spos set [2,_flyHeight]; _plane = createVehicle [_planeType, _spos, [], 0, "FLY"]; //_grp setSpeedMode "FULL"; _plane setDir _planeDirection; _plane flyInHeight _flyHeight; /* // PRESET VELOCITY _vel = velocity _plane; _plane setVelocity [ (_vel select 0) + (sin _planeDirection * _speed), (_vel select 1) + (cos _planeDirection * _speed), (_vel select 2) ]; */ // if (side player == WEST) then {_plane setAmmo ["missiles_DAR", 0]; // } else { _plane setAmmo ["missiles_DAGR", 0]}; _plane allowDamage _allowDamage; _plane setSkill 1; // MAY HAVE TO REMOVE CREW FIRST {deletevehicle _x} foreach (crew _plane); _crew = [_plane,_grp] call bis_fnc_spawncrew; //_grp setFormation "LINE"; _planeArray = _planeArray + [_plane]; _plane sideChat "Air Cav on it's way!"; }; hint format["%1 %2", _planeArray select 1, _planeArray select 2]; // PLANES ATTACK TARGETS _myNearestEnemy = player findNearestEnemy player; _heliAttackTime = time; _grp setFormation "LINE"; while {(time - _heliAttackTime) < 120} do { // KEEP ALL THE SAME ALTITUDE {_x flyInHeight _flyHeight} forEach _planeArray; // GET PLANE TO KEEP FLIGHT DISATNCE AND POSITION WITH MIDDLE PLANE { _middlePlane = _planeArray select 0; if (((_middlePlane distance _x) > (_planeSpread +2)) or ((_middlePlane distance _x) < (_planeSpread -2))) then { if (_x == _planeArray select 1) then {_sidePlaneDirection = -90} else {_sidePlaneDirection = 90}; _x setPosATL [getPosATL _middlePlane, _planeSpread, getDir _middlePlane + _sidePlaneDirection] call bis_fnc_relpos; //_x setDir getDir _middlePlane; }; } forEach [_planeArray select 1, _planeArray select 2]; hint format ["%1 \n %2 \n formation: %3", (_planeArray select 0) distance (_planeArray select 1), (_planeArray select 0) distance (_planeArray select 2), formation _grp]; //_grp setFormation "LINE"; if (alive _myNearestEnemy) then { { _x doTarget _myNearestEnemy; _x doFire _myNearestEnemy; //_x addeventhandler ["fired",{(_this select 0) sideChat format ["assignedTarget : %1 ", assignedTarget (_this select 0)]}]; }forEach _planeArray; } else {_myNearestEnemy = player findNearestEnemy player}; sleep .5; };
  16. Hi ALL, I have a script that creates a "ghost vehicle" using createVehicleLocal and allows the player to position it around him until he spawns the real one. But if there are mines in the area they are triggered by the ghost vehicle. How can I avoid triggering mines with the "ghost vehicle"? I don't want to position it 2m above the ground as this looks funny. Is there a way to deactivate the mines? If so, I could do so when the "ghost vehicle" is within a certain range? Otherwise I guess I have to use allMines within a certain range, store them, delete them and then re-createMine once the vehicle is out of range? BTW I noticed there is a mineActive command, but aren't all mines active once they are placed? How can you make them "non-active"?
  17. Thanks Folks, 2 questions: 1) why do you use modelToWorld [0,10,0]? I use modelToWorld [0.5,0.5] which I thought was the center of the screen? 2) Why can't you use forEach allMines instead of forEach disabled, when reactivating the mines back? I assume this will only reactivate those that were disabled from the entire array of mines?
  18. ...Yes this was the problem. Thanks guys (everyone above), appreciate the help for a small annoying problem.
  19. Why does my first _box spawn at one of the marker points created...but then all the others spawn at [0,0,0]? Is there something wrong with the order I created the marker while {true} do { //Need to change marker altitude in mission also before executing _markerArray = ["marker1","marker2","marker3"]; _box = createVehicle [_box ,[0,0,0], _markerArray, 50, "NONE"]; { _x setMarkerAlpha 0; _x setMarkerPos [(getMarkerPos _x) select 0, (getMarkerPos _x) select 1, 3000]; } forEach _markerArray; hint format ["goldDropTime POS: %1", getPosATL _box]; sleep goldDropTime; };
  20. How would I create something like the following using for do and arrays? I'm not sure how to create a series of variables with _i in them? veh0 = _veh0; veh1 = _veh1; veh2 = _veh2; //... n times and how would I do the following: _posDrop0 = getPosATL veh0; _posDrop1 = getPosATL veh1; _posDrop2 = getPosATL veh2; //... n times and _veh0 = createMine ["APERSMine",_posDrop0, [], 0]; _veh1 = createMine ["APERSMine",_posDrop1, [], 0]; _veh2 = createMine ["APERSMine",_posDrop2, [], 0]; //... n times
  21. I want to spawn the _box at any of the three marker positions randomly (that I've creaed in the mission editor), just like it states here "If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used." ...but I would like _box created at an altitude of 3000. When I run the script, it works for the first time the _box is spawned (at an altitude of 3000), but all the other spawned _boxes are created at [0,0,0].
  22. BEAKSBY

    Arrays and for do help

    OK thanks Entity... I managed to get by with the second part of your post, using a combination of for dos, forEachs and remebering that I can use the vehicle created as an element for creating an array of vehicles with pushBacks.
  23. Thanks DreadedEntity, I missed a lot of code efficiencies you pointed out. I'm trying to keep my helos all in formation but it's not working with setFormation. Thread: How do I keep my Helicopters in Formation?
×