Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by GamersFortitude

  1. Hi all, here's whats happening, got a server running ifa3 and i have it set so when players spawn, they get a random uniform, vest, backpack & headgear, it all works like a charm except for the backpacks. Below is the code im using to give the random setup every time, is 'AddBackpack' the issue? or should it be AddBackpackGlobal? Uploaded a screenshot to steam for reference. Had a message pop up a few times with different backpacks used mentioning bone structure? Also, if its mod sided i can just swap the backpacks out for vanilla ones.. waitUntil {!isNull player}; _unit = _this select 0; //Removing All removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; //Arrays _arrayuniform = ["U_LIB_FSJ_Soldier","U_LIB_ST_Soldier_E44","U_LIB_SOV_Strelok","U_LIB_SOV_Sergeant","U_LIB_US_Private","U_LIB_US_Sergeant"]; _arraybp = ["GerBag_K98","B_LIB_SOV_MinesBag","B_LIB_SOV_MosinAmmoBag","B_LIB_SOV_MinesBag","B_LIB_SOV_MinesBag"]; _arrayhat = ["H_LIB_GER_FSJ_M38_Helmet","H_LIB_GER_FSJ_M44_Helmet","H_LIB_SOV_RA_Helmet","H_LIB_SOV_Ushanka","H_LIB_US_Helmet","H_LIB_US_Rangers_Helmet"]; _arrayvest = ["V_LIB_GER_FSJ_VestKar98","V_LIB_GER_TankPrivateBelt","V_LIB_SOV_IShBrVestMG","V_LIB_SOV_RA_PPShBelt","V_LIB_US_AB_Vest_Garand","V_LIB_US_AB_Vest_Thompson"]; //Adding Random from arrays _clothingU = selectRandom _arrayuniform; _clothingB = selectRandom _arraybp; _clothingH = selectRandom _arrayhat; _clothingV = selectRandom _arrayvest; _unit forceAddUniform _clothingU; _unit addVest _clothingV; _unit addHeadgear _clothingH; _unit addBackpack _clothingB; //Give M1911 + 28 rounds _unit addMagazine "LIB_7Rnd_45ACP"; _unit addMagazine "LIB_7Rnd_45ACP"; _unit addMagazine "LIB_7Rnd_45ACP"; _unit addMagazine "LIB_7Rnd_45ACP"; _unit addMagazine "LIB_7Rnd_45ACP"; _unit addWeapon "LIB_Colt_M1911"; if(true) exitWith{};
  2. Hi all, Im looking into modifying a file for my arma 3 wasteland server where it has a hostile plane patrol going around the map, based on random waypoints, which are set as towns. What im wanting to do is make the plane drop a bomb when its for example 50m away from the town. Having found examples of code and using the wiki i came up with this, but unfortunately i get the following error (_bomb is defined further up in the file) private _bombspace = _vehicle distance2D currentWaypoint; if (_bombspace < 49) then { _bomb = "LIB_MG81_Ju87" createVehicle ((getpos _vehicle) vectorAdd [0,0,-1]); _bomb setDir getDir _vehicle; _bomb setVelocityModelSpace [0,50,0];} else { waitUntil _bombspace = 50; }; Here's the error. What am i missing? 21:43:08 Error position: <; if (_bombspace < 49) then { _bomb = "> 21:43:08 Error Invalid number in expression 21:43:08 File mpmissions\__cur_mp.malden\server\missions\sideMissions\mission_HostilePlane.sqf..., line 126 Line 126 is this private _bombspace = _vehicle distance2D currentWaypoint; Thanks to anyone than can help
  3. That's perfect! thank you very much Wogz, Works like a charm. Out of curiosity thou, what defines the bomb count to be dropped? eg if i wanted to make it 8 etc
  4. Ok so what I've done is basically create triggers at set distances away from towns with a predetermined flightpath for a, at this stage, C47 Skytrain . Yet to add in another mod which will give me a B17. After a few hours of fiddling with a code, I managed to get 4 bombs dropping with a interval of 1 second or so, between impacts. if isServer then {_bomb = "Bomb_03_F" createVehicle ((getpos plane1) vectorAdd [0,0,-1]); _bomb setDir getDir plane1; _bomb setVelocityModelSpace [0,40,-10];}; if isServer then {_bomb2 = "Bomb_03_F" createVehicle ((getpos plane1) vectorAdd [0,0,-1]); _bomb2 setDir getDir plane1; _bomb2 setVelocityModelSpace [0,30,-15];}; if isServer then {_bomb3 = "Bomb_03_F" createVehicle ((getpos plane1) vectorAdd [0,0,-1]); _bomb3 setDir getDir plane1; _bomb3 setVelocityModelSpace [0,20,-20];}; if isServer then {_bomb4 = "Bomb_03_F" createVehicle ((getpos plane1) vectorAdd [0,0,-1]); _bomb4 setDir getDir plane1; _bomb4 setVelocityModelSpace [0,10,-25];}; Originally used the MK82 bomb but just went with the the one above. I tried putting 'sleep 1;' into each line just before the next bomb dropped, in order to get a uniform drop, but i get a syntax error.. Checking to see how it's used didnt seem to help, as I still got the error. Now seeing that Sleep is used in conjunction with Spawn, would it be more efficient to create a script which gets called on each trigger ?
  5. GamersFortitude

    Giving ammo based off random weapons chosen

    Thanks for that, yeah the file is called in other files when missions get created. i'll modify the file in the weekend and see if that works. Thank you.
  6. Hi all, Im running a wasteland server with IFA3 and ive got the AI groups that spawn for missions being created with mod weapons, unfortunately they spawned in with no ammo. Looking through the A3 Wiki i found the 'if' statements and based off the SetAmmo command 'example 3' (as below), I made an attempt at giving the AI ammo. I originally posted this on the A3Wasteland forums but no one has been able to help, let alone reply. if (local vehicle player) then { vehicle player setAmmo [currentWeapon vehicle player, 5]; } else { hint "Vehicle must be local to this machine for 'setAmmo' to work"; }; I grabbed the code and tried to modify it so it grabs the current weapon and gives the appropriate ammo class. I originally based it off the uniform, and i had this in the code if (uniform _soldier isequalto _usrifleman) then ( _solder addMagazine "LIB_15Rnd_762x33_t"; _solder addMagazine "LIB_15Rnd_762x33_t"; _solder addMagazine "LIB_15Rnd_762x33_t"; _solder addWeapon "LIB_M1_Carbine"; ); Having the above code in the file resulted in the below error. So i removed it and tried a different method. 0:40:26 File mpmissions\__cur_mp.malden\server\missions\factoryMethods\createUnits\createRandomSoldierC.sqf..., line 33 0:40:26 Error in expression <_solder addMagazine "LIB_15Rnd_762x33_t"; _solder addMagazine "LIB_15Rnd_762x33_> 0:40:26 Error position: <; _solder addMagazine "LIB_15Rnd_762x33_> What you see below is what i attempted , starting at "If currentweapon _soldier =" (fig.2) I only did a few to test to see if it works. But alas it does not. (fig.2) // ****************************************************************************************** // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com * // ****************************************************************************************** // @file Name: createRandomSoldierC.sqf if (!isServer) exitWith {}; private ["_soldierTypes", "_weaponTypes", "_group", "_position", "_soldier"]; _soldierTypes = ["LIB_US_rifleman", "LIB_US_FC_rifleman", "LIB_US_smgunner", "LIB_SOV_rifleman", "LIB_SOV_LC_rifleman","LIB_SOV_scout_smgunner", "LIB_GER_rifleman", "LIB_GER_ober_rifleman", "LIB_GER_mgunner"]; _weaponTypes = ["LIB_P38","LIB_MP40","LIB_K98","LIB_G43","LIB_TT33","LIB_M9130","LIB_M1895","LIB_PPSh41_m","lib_f1","LIB_M1A1_Thompson","LIB_M1_Carbine","LIB_M1_Garand","LIB_Colt_M1911","LIB_US_Mk_2"]; _group = _this select 0; _position = _this select 1; _soldier = _group createUnit [_soldierTypes call BIS_fnc_selectRandom, _position, [], 0, "NONE"]; [_soldier, _weaponTypes call BIS_fnc_selectRandom, 3] call BIS_fnc_addWeapon; //if (currentWeapon _soldier = LIB_P38) then setAmmo [LIB_8Rnd_9x19 _solder, 10]; if (currentWeapon _soldier = LIB_P38) then { _solder setAmmo [LIB_8Rnd_9x19 _solder, 5]; } else if (currentWeapon _soldier = LIB_MP40) then { _solder setAmmo [LIB_32rnd_9x19 _solder, 5]; { else if (currentWeapon _soldier = LIB_K98) then { _solder setAmmo [LIB_5Rnd_792x57 _solder, 5]; }; /* // Unsure about this & disabled switch (_condition) do { case 1: {if (currentWeapon _soldier = LIB_P38) then setAmmo [LIB_8Rnd_9x19 _solder, 10]}; case 2: {if (currentWeapon _soldier = LIB_MP40) then setAmmo [LIB_32rnd_9x19 _solder, 10]}; } */ _soldier call setMissionSkill; _soldier addEventHandler ["Killed", server_playerDied]; _soldier I decided to look into the switch command but im still learning with that aspect, thats why it's disabled. Is there anything i can do otherwise to get the appropriate ammo given to the AI? On a side note, a3wasteland comes with a "refilPrimaryAmmo" which only seems to work for mods that actually have a cfg file, where as IFA3 does not. Hense my attempt at giving ammo. Thanks to anyone who can help with this matter.