Jump to content

BEAKSBY

Member
  • Content Count

    431
  • Joined

  • Last visited

  • Medals

Everything posted by BEAKSBY

  1. OK thanks, I've got the setVariable to the _unit in the spawning script already...but... ...in the initPlayerLocal.sqf how do I get the _unit getVariable into the player's addAction? player addAction ['REINFORCE EMPLACEMENT', {[cursorTarget] execVM "ReinforceStaticWeapon.sqf"}, nil, 6, true, true, "", "_allowAddAction = _gun1 getVariable ""addAction""; (cursortarget iskindof 'staticWeapon') && (cursortarget distance _this ) < 5 && !(alive gunner cursorTarget) && alive cursorTarget && _allowAddAction"]; the above does not seem to work? hold on...In think I got it... I just replaced _allowAddAction = _gun1 getVariable ""addAction""; with _allowAddAction = cursortTarget getVariable ""addAction""; ...this might work.
  2. HI All, I'm using objectName setVariable [name, value, (public)] in for an addAction condition. I've added this inside initPlayerLocal.sqf player setVariable ["addAction", TRUE, TRUE]; player addAction ['REINFORCE EMPLACEMENT', {player setVariable ["addAction", FALSE, TRUE]; [cursorTarget] execVM "ReinforceStaticWeapon.sqf"}, nil, 6, true, true, "", "_allowAddAction = player getVariable ""addAction""; (cursortarget iskindof 'staticWeapon') && (cursortarget distance _this ) < 5 && _allowAddAction"]; Yet, another player will have the addAction appear in the their menu when one player has already activated the addAction and setVariable "addAction" to FALSE. I thought the variable would have been broadcasted to all computers and therefor the addAction would not be available once it has been activated? Is it because I've placed this addAction inside initPlayerLocal.sqf?
  3. Not sure what you mean when you say You have set the variable to the player. "Not the player vehicle. (Which must be named)."? Do you mean set the variable to the staticWeapon? If so how do I set a variable to something that has not been created yet? Basically, how do I setVariable to a unit that will be called in by a script later on during the game? I tried this but it did not change anything... p1 = player; p1 setVariable ["addAction", TRUE, TRUE]; player addAction ['<t size=''0.85''>REINFORCE EMPLACEMENT </t>' + '<t size=''0.85'' color=''#ff0000''>$ 25 </t>', {p1 setVariable ["addAction", FALSE, TRUE]; [cursorTarget] execVM "ReinforceStaticWeapon.sqf"}, nil, 6, true, true, "", "_allowAddAction = p1 getVariable ""addAction""; (cursortarget iskindof 'staticWeapon') && (cursortarget distance _this ) < 5 && !(alive gunner cursorTarget) && alive cursorTarget && _allowAddAction"];
  4. Fair enough, This is for a 3v3 MP remake of The Outfit (2004 XBOX 360). Players can call in all types of assest on the fly (via parachute drop) given they have enough money and they control certain key sectors such as a Motor Pool for vehicles, Armory for staticWeapons and Radio Tower for artillery/CAS...etc. If they encounter a staticWeapon, that no longer has a gunner, when they place the cursorTarget on the staticWeapon, the addAction above should be initiated, given the conditions (within 5m of staticWeapon and _allowAddAction) are true. In the code portion of the addAction I added, _p1 setVariable ["BEAKS_addAction", FALSE, TRUE]; so once they click the 'REINFORCE EMPLACEMENT' addAction and are waiting for a new gunner to parachute in, the player or any other players do not see an addAction for the same staticWeapon. I use a "Killed" EH on the gunner reinforcement parachuting in and use _p1 setVariable ["BEAKS_addAction", TRUE, TRUE]; if he is killed during the game so any player can call in another reinforcement, once more...and the cycle continues. I use _allowAddAction = _p1 getVariable ""BEAKS_addAction""; to retrieve the variable for the condition in the player's addAction to enable it or not.
  5. OK, Thanks guys, You mean something like this? initPlayerLocal.sqf player = _p1; _p1 setVariable ["addAction", TRUE, TRUE]; player addAction ['REINFORCE EMPLACEMENT', {_p1 setVariable ["BEAKS_addAction", FALSE, TRUE]; [cursorTarget] execVM "ReinforceStaticWeapon.sqf"}, nil, 6, true, true, "", "_allowAddAction = _p1 getVariable ""BEAKS_addAction""; (cursortarget iskindof 'staticWeapon') && (cursortarget distance _this ) < 5 && _allowAddAction"]; I have a number of other setVariables in other scripts that will change the condition of _allowAddAction that I will change from player to _p1. The (public) boolean is realy helpful... ... but wondering if it comes at a cost to performance and how to handle lag between different clients?
  6. Hi All, After watching BangaBob's / H8er's video (BTW...thanks for the video tutorial!) on AttachTo and BIS_fnc_MP I deciced to use his approach for my script. I wanted to addAction to the object (in this case _gun1) instead of the player in the initPlayerLocal.sqf But I want _gun1 to have the addAction so any player in MP from either side, to access the addAction based on certain conditions. I thought the script below would ensure it works on the server so all players will see the addAction...but it's not working? StaticWeaponDrop.sqf ////////////////////////////////////////////////////////// // ...code that creates _gun1 with createVehicle...// ///////////////////////////////////////////////////////// if (isServer) then { [[_gun1],"BEAKS_addAction",true,true] call BIS_fnc_MP; }; BEAKS_addAction = { _gun1 = (_this select 0); _gun1 setVariable ["reinforce",true]; _gun1 addAction ["REINFORCE EMPLACEMENT",{call BEAKS_ReinforceStaticWeapon}, nil, 9, true, true, "","(_target getVariable ""reinforce"") && (_target distance _this ) < 5 && !(alive ((crew _target) select 0))"]; }; BEAKS_ReinforceStaticWeapont = { _gun1 = (_this select 0); _gun1 setVariable ["reinforce",false]; // addAction should not be available [_gun1] execVM "ReinforceStaticWeapon.sqf"; // _gun1 setVariable ["reinforce",true] inside ReinforceStaticWeapon.sqf to make the addAction available again };
  7. Thanks Guys! With you advice, in the end I decided to add the addAction the player instead, as there will be only a few players in the MP game I'm creating (max 4 Vs 4) and shouldn't be to taxing on the system whereas there could be dozens of StaticWeapons with the addAction. I did use some techniques from your video however BangaBob/H8er. I have not fully tested it all out yet but here's what I used. in the initPlayerLocal.sqf player setVariable ["addAction", TRUE, TRUE]; player addAction ['<t size=''0.85''>REINFORCE EMPLACEMENT </t>' + '<t size=''0.85'' color=''#ff0000''>$25 </t>', {player setVariable ["addAction", FALSE, TRUE]; [cursorTarget] execVM "ReinforceStaticWeapon.sqf"}, nil, 6, true, true, "", "_allowAddAction = player getVariable ""addAction""; (cursortarget iskindof 'staticWeapon') && (cursortarget distance _this ) < 5 && !(alive gunner cursorTarget) && alive cursorTarget && _allowAddAction"]; and then in ReinforceStaticWeapon.sqf I've added at the end of the script sleep 5; player setVariable ["addAction", TRUE, TRUE]; // Cannot call addAction for REINFORCE EMPLACEMENT until this script is done Thanks for you help and keep up the good videos...BangaBob/H8er please continue to elaborate on all the details for scripting & editing in your videos (10-15 minutes is worth the watching if it's instructive!)
  8. HI All, I running a script to set-up a tripod (StaticWeapon) if it has fallen-over. So far I'm checking if its abs vectorUp is > 0.66, but I feel this is kind of arbitrary? Is there a better way of checking whether it has fallen over and requires to be set-up? Thanksin advance.
  9. BEAKSBY

    Immune to falling damage?

    Does anyone know if damage caused by nearby explosions also results in souce of damage (_this select 4) == ""?
  10. HI ALL, How do I keep my AI from ejecting from a plane? I don't see the opposite of the following? soldierOne action ["Eject", vehicle soldierOne];
  11. Hi all, I can't seem to get the _text to create a separate line for the str _distance. I tried /n and <br> but they did not work. Is it even possible? _text = format ["%1 %2m", _displayName, (str _distance)]; _picture = ""; if (_x isKindOf "LandVehicle") then {_picture = getText (configfile >> "CfgVehicles" >> typeOf _x >> "picture"); } else { _icon = getText (configFile >> "CfgVehicles" >> typeOf _x >> "Icon"); _picture = getText (configFile >> "CfgVehicleIcons" >> _icon); }; _unitPos = getPosATL _x; drawIcon3D [ _picture, [1,0,0,1], [(visiblePosition _x) select 0,(visiblePosition _x) select 1,((visiblePosition _x) select 2) + 10], 0.8, 0.5, 0, _text, 0, 0.03, "PuristaMedium" ];
  12. HI All, Currently in my script you get a reward if you (or your AI) kill the enemy, but doesn't work if you run them over in a tank or other vehicle and they are in a StaticWeapon. Does it have something to do with "Killed" --> Triggered when the unit is killed. Be careful when the killer has been a vehicle. For most cases the reference of the vehicle is the same as the effectiveCommander, but not always.? Here are my conditions: //--- Check if opposite side is killed by _killer && _Killer is not an renegade && unit killed is in an vehicle or a vehicle if ((side group _killer != side group _unit) && (side _killer != sideEnemy) && (typeOf vehicle _unit isKindOf "LandVehicle") ) then { and //--- Check if opposite side is killed by _killer && _Killer is not an renegade && _unit is a man not in a vehicle unless it is a StaticWeapon if ((side group _killer != side group _unit) && (side _killer != sideEnemy) && (((typeOf _unit isKindOf "Man") && (vehicle _unit == _unit)) || (typeOf _unit isKindOf "Man") && (typeOf vehicle _unit isKindOf "StaticWeapon" )) ) then {
  13. This worked for a similar script using createVehicle instead. for "_i" from 0 to 2 do { _center = createCenter sideLogic; _group = createGroup _center; _CAS = _group createUnit ["ModuleCAS_F",[(_pos select 0) + _i*(10* sin(_vehDir)), (_pos select 1) + _i*(10* cos(_vehDir)), 0], [], 0, ""]; _CAS setDir _vehDir; _CAS setSkill 1; _CAS setVariable ["vehicle",_vehType,true]; _CAS setVariable ["type", 2, true]; _vehKilledEH = _CAS addeventhandler ["killed",{_this spawn BEAKS_fnc_reward_veh}]; sleep 5; };
  14. OK, thanks for the function code and solving the problem folks. Do you know how to increase the gun fire so the strafe lasts longer? Do I simply need to increase the _duration?
  15. Thanks, but I thought _this passes both as an array and I do not need to define them. They are defined in the function.
  16. Yes it worked, thank-you Even when the player is dead he still belongs to the group and as a result his squad is still waiting for orders. I feel sorry for them...
  17. HI All, I'm trying to get my group to re-assign themselves as their own group, when the player the initially belong to dies. I created a "Killed" EH that triggers the following playerKilled.sqf _KilledPlayer = _this select 0; _myUnitCount = count units _KilledPlayer; _nObject = nearestObject [getPosATL _KilledPlayer, "tank"]; _ReinforcemnentsGroup = units _KilledPlayer; _SideHQ = createCenter side player; _NewGroup = createGroup _SideHQ; // re-group all units for "_i" from 1 to _myUnitCount do{ _ReinforcemnentsGroup select _i join _NewGroup; }; ... but when the player repawns they still belong to the player. How can I get them to create their own autonomous group?
  18. HI All, How do I get all the _newUnits to be created all at once then open their parachutes once they reach the desired height, INSTEAD of waitUntil each unit one at a time OpenParachute? I think I need to create an array, then run forEach on the array but not sure how to build it in the first place? for "_i" from 0 to _NumberOfExtras-1 do { _newUnit = group player createUnit [_newUnitType, _airPos, [], 0, "FORM"]; waitUntil {position _newUnit select 2 < 55}; _newUnit addBackpack "b_parachute"; waitUntil {position _newUnit select 2 < 50}; _newUnit action ["OpenParachute", _newUnit]; };
  19. THanks again for a the references, I went with this: //Create paratrooper group for "_i" from 0 to _NumberOfExtras-1 do{ _man1 = _men select _i; //(floor(random(count _men))); _man2 = group player createUnit [_man1, _airPos, [], 0, "NONE"]; _man2 allowDamage false; if (str(_men select _i) == str _newUnitType) then {_BP = backpack _man2}; [_man2,_openHeight] spawn{ private ["_man2","_openHeight","_para"]; _man2 = _this select 0; _openHeight = _this select 1; removeBackpack _man2; waitUntil{((getPosATL _man2)select 2)<_openHeight}; _man2 addBackpack "b_parachute"; (backpack _man2) allowDamage false; waitUntil {getPosATL _man2 select 2 < 50}; _man2 action ["OpenParachute", _man2]; }; sleep _jumpDelay; // AI Behaviour _man2 SetUnitPos "Up"; _man2 SetSpeedMode "Full"; _man2 SetCombatMode "YELLOW"; _man2 SetBehaviour "AWARE"; _man2 allowFleeing 0; };
  20. Hi All, Is there a way to order all units in the recently dead player's group to get in side the vehicle without having to assign each to a specific position first? _PlayerKilledEH = addeventhandler ["killed",{ _nObject = nearestObject [(_this select 0), "tank" or "car"]; hint format ["_nObject: %1", _nObject]; { _x moveInAny _nObject; } forEach units (_this select 0:)
  21. Hi All, I can't find this in the search. I'm looking for a funtion that will display the enemy units on the map. I don't want the military symbols module. I would like to place the icons "picture" and "displayname" of each enemy unit on the map, as I've done with the 3D screen. fn_Draw3D = { { private "_private, _displayName, _picure, _unitPos, _text, _distance, _sandGlass"; _unit = _x; //typeOf cursorTarget; _distance = round (_x distance player); _displayName = getText (configfile >> "CfgVehicles" >> typeOf _x >> "displayName"); _text = format ["%1 %2m", _displayName, (str _distance)]; _picure = getText (configfile >> "CfgVehicles" >> typeOf _x >> "picture"); if (_picture == "") then {_picture = "pictures\Soldier_CA.paa"}; _unitPos = getPosATL _x; drawIcon3D [ _picure, [1,0,0,0.75], [(visiblePosition _x) select 0,(visiblePosition _x) select 1,((visiblePosition _x) select 2) + 10], 0.8, 0.5, 0, _text, 0, 0.03, "PuristaMedium" ]; } forEach vehicles+allUnitsUAV ; }; private ["_addNew"]; _addNew = ["BIS_id", "onEachFrame", "fn_Draw3D"] call BIS_fnc_addStackedEventHandler; sleep 5; ["BIS_id", "onEachFrame", "fn_Draw3D"] call BIS_fnc_removeStackedEventHandler;
  22. BEAKSBY

    Espionage Script

    Did you say "molotovs"? Could you please share this one with me? Also, do you know of a tear gas script too. I thought I saw one on Armaholic that had good player side affects.
  23. Thanks GOM, Does it slow down you system? I've incorportated inside of my fn_Draw3D and when I call it through BIS_fnc_addStackedEventHandler my system chugs. I's like to add custom text too but don't want to have to setVariables and getVariables...so I went with player reveal _x inside the function above.
  24. HI All, I would like to select the appropriate type of path to generate a correct .paa. _icon = getText (configfile >> "CfgVehicles" >> typeOf _x >> "icon"); returns --> icon = "iconManAT"; but now I wantv add it to "\A3\ui_f\data\map\vehicleicons\ _icon_ca.paa"}; how would I add it to the path? so it looks like this: "\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa"};
×