Jump to content

BEAKSBY

Member
  • Content Count

    431
  • Joined

  • Last visited

  • Medals

Everything posted by BEAKSBY

  1. HI All, Currently I have a script that works. It finds the value of a unit killed (vehicle or soldier) by an enemy unit (player or AI) and adds this value to the player who made the kill's account, all based on half the values listed in the _veh array. However I'm expanding this script to also include the value of units inside the vehicle (if it is occupied) as well as the vehicle depending what is killed. So that now I would like the money gained by the _killer (player or AI) to account for empty vehicles, units or a vehicle with the units killed inside. My new script is not working. Is there a problem with the nested _i variables, syntax or misunderstanding of functions? Please help... initServer.sqf ...thanks in-advance, fantastic community!
  2. Hi Again F2k Sel, It does and it doesn't. It does for vehicles that are empty and units outside of vehicles, BUT, when I destroy a vehicle with units inside it only seems to register the vehicle as the kill. I'm trying to reward the _killer with money for both the vehicle and if there are units inside. I'm using _unitType = typeOf _unit; and this seems to only return the vehicle if there are units inside. I think the "Killed" eventHandler is not registering the units inside...at least from the earlier scirpt version I was using.
  3. I want to concatenate vehicles and allUnits but... _unitsAndvehicles = [vehicles + allUnits]; // THIS DOES NOT WORK I tried forEach _unitsAndvehicles but this is not working for the list of vehicles and allUnits. I don't see concatenation of arrays in Array BIKI
  4. Thanks Tajin, It only took me an hour to figure it out. Why do you say it is "probably safer to assign them to variables first"?
  5. Thanks, so... _unitsAndvehicles = [vehicles] + [allUnits]; // should concatenate both arrays? I tried the above as well as _arrayA = vehicles; _arrayB = allUnits; _unitsAndvehicles = _arrayA + _arrayB; And when I run this: player addAction ["_unitsAndvehicles list", { hint format ["_unitsAndvehicles list is %1", _this select 3] }, _unitsAndvehicles]; the hint produces: _unitsAndvehicles list is any
  6. BEAKSBY

    Help my MP money script

    Thanks again albertfish...and your patience! It works for either forEach vehicles or forEach allUnits, BUT does not work for both forEach [vehicles, allUnits]; OR perhaps I need to concatenate both arrays? I would like the eventhandler to fire and collect money for the _killer when the _unit, either a soldier or vehicle (empty or occupied) of the opposite side is killed. ...also, for some reason [format ["You earned: $%1", _unitValue], "DNA_fnc_hint", _killer] call BIS_fnc_MP; is also not working. initServer.sqf OK, this works } forEach vehicles + allUnits; // THIS WORKS FOR BOTH The only problem remaining is the hint message is not executing for some reason still.
  7. Hi Folks, I've created a script hoping it would work for both soldiers and vehicles. Following my thread from the "Killed" event handler I realized that this only seemed to work for soldiers and it was not firing on vehicles. BTW, Thanks again for your help albertfish! so... I'm trying to get this script to work for a MP game. A unit from one side (AI or player) who kills/destroys a unit (soldier/vehicle) from opposite side is supposed to get money equivalent to half the original cost of the killed/destroyed unit/vehicle. I've added this this script to the initServer.sqf but I'm not sure why it is not working...can anyone please help me resolve the problem? initServer.sqf Thanks in advance!
  8. BEAKSBY

    Help my MP money script

    I realized that perhaps the reason addEventHandler [ "Killed", {... was not working except on soldiers is because this event handler does not fire on vehicles. Instead I willuse addEventHandler [ "HandleDamage", {... and get the damage: Number - Resulting level of damage for the selection. If this is 1 then the vehicle is destroyed and the money will then go to the unit's side that destroyed the vehicle. Can this also be used for soldiers? I will rewrite my script and test.
  9. Hi All, I'm trying to create a script that will allow my player to view all enemy units on the map but also on the 3D screen with a hexagon. I'm using IconsVisible [true,true]; in the unit's "init" but it ony show their marking on the map. How do I get the hexagons present? Is there a parameter I'm missing? Thanks
  10. BEAKSBY

    Help my MP money script

    Sorry, I did change it to global, I posted an earlier version when I was experimenting. I get it now, you have to initialize the variable before the if statement otherwise it will be lost. when I tried it using global variables the money was registering, although not correct amounts for other units than the basic soldiers and the hintnwas not displaying after each kill. I am also using an initPlayerLocal.sqf, would that have an impact?
  11. BEAKSBY

    Help my MP money script

    my initServer.sqf { //--- Add killed EH to unit _handle = _x addEventHandler [ "Killed", { _unit = _this select 0; _killer = _this select 1; _handle = _unit getVariable [ "DNA_EH_Killed_Money", -1 ]; //--- Check if opposite side is killed by killer if (side group _killer != side group _unit) then { //--- Determine money value of _unit based on unit class _unitType = typeOf _unit; // aray of original cost of units and do loop _veh = [[1200, "B_MBT_01_TUSK_F"],[900, "B_APC_Tracked_01_rcws_F"],[750, "B_APC_Tracked_01_AA_F"],[600, "I_APC_Wheeled_03_cannon_F"],[300,"B_MRAP_01_gmg_F"],[150,"B_MRAP_01_hmg_F"],[100,"B_G_Offroad_01_armed_F"],[200,"B_static_AT_F"],[200, "B_static_AA_F"],[150,"B_soldier_LAT_F"],[100,"B_G_Soldier_LAT_F"],[150,"B_GMG_01_high_F"],[100,"B_HMG_01_high_F"],[1200, "O_MBT_02_cannon_F"],[900, "O_APC_Tracked_02_cannon_F"],[750, "O_APC_Tracked_02_AA_F"],[600, "O_APC_Wheeled_02_rcws_F"],[300,"O_MRAP_02_gmg_F"],[150,"O_MRAP_02_hmg_F"],[100,"O_G_Offroad_01_armed_F"],[200,"O_static_AT_F"],[200, "O_static_AA_F"],[150,"O_soldierU_LAT_F"],[100,"O_G_Soldier_LAT_F"],[150,"O_GMG_01_high_F"],[100,"O_HMG_01_high_F"]]; for "_i" from 0 to (count _veh)-1 do { if _unitType = ((_veh select _i) select 1) then {unitValue = (((_veh select _i) select 1)/2)}; // unitValue will be half the original price of the unit }; //--- Add money to the client [ unitValue, "DNA_fnc_addMoney", _killer ] call BIS_fnc_MP; // hint format [ "You have gained $%1", unitValue ]; // THIS ONLY WORKS ON SERVER SIDE [format ["You earned: $%1", unitValue], "DNA_fnc_hint", _killer] call BIS_fnc_MP; }; //--- Remove the event handler _unit removeEventHandler [ "Killed", _handle ]; } ]; //--- Store killed EH handle in unit namespace _x setVariable [ "DNA_EH_Killed_Money", _handle ]; } forEach allUnits; Thanks for testing it on your side.
  12. BEAKSBY

    Help my MP money script

    I changed all the _unitValue local variables to global unitValue, this works to register the money for the kills...but ...the DNA_fnc_hint function is not hinting after every unit that is killed.
  13. BEAKSBY

    Help my MP money script

    Thanks albertfish. It works but also had to correct the condition in the if statement to: if (_unitType == ((_veh select _i) select 1)) then {unitValue = (((_veh select _i) select 0)/2)}; However the hint prompt is not prompting. I added the function you created above DNA_fnc_hint.sqf to the mission>>functions>>money folder. I placed hint format [["You earned: $%1", unitValue], "DNA_fnc_hint", _killer] call BIS_fnc_MP; in the initServer.sqf also. I thought it would work there for everytime a unit is "killed" using the eventhandler? initSever.sqf
  14. Hi All, I've posted this here http://forums.bistudio.com/showthread.php?149911-Deadfast-s-Third-Person-View-for-ARMA-3/page7 but thought someone might have a scripting solution which is really what I'm looking for. Is there a way to add our own custom view as a script in a mission I'm creating instead of adding it as a mod? I've tried pasting the cameraPosition.hpp in my mission folder then pasted the config.hpp to my description.ext, but the new 3rd person view did not take. I've modified the location of to find the cameraPosition.hpp with in the description.ext: class CfgPatches { class DFS_3rdPerson { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Characters_F"}; }; }; [b] #include "cameraPosition.hpp"[/b] class CfgVehicles { class Man; class CAManBase : Man { extCameraPosition[] = {__offsetX, __offsetY, __offsetZ}; }; }; I've even tried pasting the entire userconfig folder in Arma3 usercofig, and in the mission folder, but still no luck.
  15. Hi All, Is there a way to add our own custom view as a script in a mission I'm creating instead of adding it as a mod? I've tried pasting the cameraPosition.hpp in my mission folder then pasted the config.hpp to my description.ext, but the new 3rd person view did not take. I've modified the location of to find the cameraPosition.hpp with in the description.ext: class CfgPatches { class DFS_3rdPerson { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Characters_F"}; }; }; [b] #include "cameraPosition.hpp"[/b] class CfgVehicles { class Man; class CAManBase : Man { extCameraPosition[] = {__offsetX, __offsetY, __offsetZ}; }; }; I've even tried pasting the entire userconfig folder in Arma3 usercofig, and in the mission folder, but still no luck.
  16. Has any one created a way to only modify the stamina of a player and present it as a status bar?
  17. BEAKSBY

    Stamina Status Bar

    No worries, I'll work on this and post my results. Thanks for the support!
  18. BEAKSBY

    Stamina Status Bar

    You' right. Thanks for the starting points. I wasn't sure what it was called, i.e. endurance, stamina...etc. I am trying to modify the fatigue level for different player selections from the repawn template. I want to exaggerate the fatigue and recovery for certain soldier loadouts. So light weight sniper character can run faster/longer compared to heavier weapon support soldiers character. I would like to display the fatigue level as a status bar so players can strategicaly choose when and know how much sprint they have. I've seen a health status bar script develloped by Maxjoiner and was wondering if there was something similar with fatigue?
  19. Hi ALL, I am merging two missions, one that had respawn templates and one using initPlayerLocal.sqf using a MP money script. The repawn template is working but for some reason the mission is not executing any of the addActions in the initPlayerLocal.sqf? I don't have an init.sqf anymore, as I added it from the from the mission with the respawn template to the new initServer.sqf description.ext mission.sqm initServer.sqf initPlayerLocal.sqf
  20. I will add the following to the initPlayerLocal.sqf waitUntil {!isNull player}; //////////////////////////////////////////////////// If (side player == WEST) then {// for west units player addAction ["<t color='#FF0000'>M2A4 Slammer UP $1200</t>", "ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"] ; player addEventHandler ["RESPAWN", { player addAction ["<t color='#FF0000'>M2A4 Slammer UP $1200</t>", "ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and _this == _target && ((screenToWorld [0.5,0.5]) distance (_target) < 100)"]; }]; } else {// change this for east units player addAction ["<t color='#FF0000'>T-100 Varsuk $1200</t>", "O_ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and _this == _target"] ; player addEventHandler ["RESPAWN", { player addAction ["<t color='#FF0000'>T-100 Varsuk $1200</t>", "O_ArmorDrop.sqf",[],0,true,true,"","sector1 getVariable 'owner' == side _this and _this == _target"]; }]; };
  21. I have the forty-5 "hgun_Pistol_heavy_01_MRD_F" in my loadout but for some reason the gun is invisible in the first person view? Only the smaller caliber handguns seem to display in first person? description.ext
×