Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Woodpeckersam

Member
  • Content Count

    230
  • Joined

  • Last visited

  • Medals

Everything posted by Woodpeckersam

  1. Woodpeckersam

    How to make boundry for whole team?

    Do you mean for the whole side instead of the whole team? try in the leader's init (on Act) field just for the team/group: {_x setDamage 1} forEach units group this;
  2. No luck :/ That error is related to these commands: if (_OpFOR > _Civ) then if (_Civ > _OpFOR) then if (_Civ == 0 && _OpFOR == 0) then it seems to not be able to check the numbers assigned to _civ and _opfor as it gives that error underfined variable in expression: _opfor / _civ Strange ---------- Post added at 18:58 ---------- Previous post was at 18:57 ---------- private ["_OpFOR","_Civ","_trigger","_markerArray"]; _trigger = _this select 0; _markerArray = _this select 1; _OpFOR = 0; _Civ = 0; while {true} do { _OpFOR = ({alive _x AND side _x == east} count list _trigger); _Civ = ({alive _x AND side _x == civilian} count list _trigger); if (_OpFOR > _Civ) then { {_x setMarkerColor "ColorRed"} forEach _markerArray; }; if (_Civ > _OpFOR) then { {_x setMarkerColor "ColorBlue"} forEach _markerArray; }; if (_Civ == 0 && _OpFOR == 0) then { {_x setMarkerColor "ColorBlack"} forEach _markerArray; }; sleep 20; }; Updated code so you can see where I am at. Ok this code if (_Civ == 0 && _OpFOR == 0) then is not a problem at all. Once there are no units inside the trigger, it actives that part of the code but gives another error that I will worry about once the current issue is resolved.
  3. Ok thanks man, that removed the error, however it has created a couple of new errors.
  4. init.sqf fnc_markerColor = compile preprocessFile "Functions\MarkerColor.sqf"; ["NorthPoint",[01,02,03,04]] call fnc_markerColor; thats it at the moment, no other code.
  5. Hmm.. still getting that error :/ https://dl.dropbox.com/u/43380313/107410_screenshots_2013-03-24_00001.jpg (343 kB) alt link: http://cloud-2.steampowered.com/ugc/595872808915405974/9E77BEFD1EA8D14477DE65C4D13EB699A12C6050/
  6. Woodpeckersam

    what's wrong with this code

    Ahhh ok try this. In the leader of the group, open his unit interface and add to the init field: allunits = group this; Basically assigns the name allunits to the leader and his group. so when you do the {_x #code#} foreach units _group, you have specified allunits on the execVM so that code will select each individual units assigned to _group (allunits) and runs the code individually between them. Alternatively get rid the entire code at the bottom - from the if (side _x .... to .... foreach units _group; and replace it with (leader _group) doMove [_posX, _posY]. private ["_x1","_y1","_posx","_posy","_marker","_time","_group","_mpos","_mposX","_mposY","_minX","_minY","_msizeX","_msizeY"]; //_this select 0 is linked to the first index on the execVM which you can change to what you want any time. //ie. _n1 = [ai] execVM "movetoWEST.sqf"; This is the marker's name _marker = _this select 0; //_this select 1 is linked to the second index on the execVM //ie. _n1 = [ai, 2] execVM "movetoWEST.sqf"; Change this to the random time you want. _time = _this select 1; //This is the group's name for index 3 //ie. _n1 = [ai, 2, allunits] execVM "movetoWEST.sqf"; _group = _this select 2; _mpos = getMarkerPos _marker; //Gets the marker's position _mposX = _mpos select 0; //Gets the marker's X position _mposY = _mpos select 1; //Gets the marker's Y position _msizeX = getMarkerSize _marker select 0; //Gets the marker's X width _msizeY = getMarkerSize _marker select 1; //Gets the marker's Y height sleep (random _time); //Sleeps for a random time specified in the execVM _time _minX = (_mposX - _msizeX) / 2; // get min x pos. so i can add the random[_size] to it and stay within bound of marker _minY = (_mposY - _msizeY) / 2; // get min y pos. ditto _x1 = random (_minX +_msizeX); _y1 = random (_minY + _msizeY); _posx = _minX + _x1; _posy = _minY + _y1; (leader _group) doMove [_posX, _posY]; That means you need to run the execVM code for every group you want to move inside the marker. There are better ways, but im not at my home pc right now so... i cant really check. ---------- Post added at 13:25 ---------- Previous post was at 13:15 ---------- Maybe use the code here as a way to implement your random position checks? http://forums.bistudio.com/showthread.php?130975-Generate-Units-Within-Area-With-Marker-as-Center&p=2103226&viewfull=1#post2103226 Looks straight forward lol and uses sin/cosine. Anyways back to work. Good luck mate =)
  7. Woodpeckersam

    what's wrong with this code

    I've changed the code a bit more _n1 = [ai,2,allunits] execVM "movetoWEST.sqf"; private ["_x1","_y1","_posx","_posy","_marker","_time","_group","_mpos","_mposX","_mposY","_minX","_minY","_msizeX","_msizeY"]; //_this select 0 is linked to the first index on the execVM which you can change to what you want any time. //ie. _n1 = [ai] execVM "movetoWEST.sqf"; This is the marker's name _marker = _this select 0; //_this select 1 is linked to the second index on the execVM //ie. _n1 = [ai, 2] execVM "movetoWEST.sqf"; Change this to the random time you want. _time = _this select 1; //This is the group's name for index 3 //ie. _n1 = [ai, 2, allunits] execVM "movetoWEST.sqf"; _group = _this select 2; _mpos = getMarkerPos _marker; //Gets the marker's position _mposX = _mpos select 0; //Gets the marker's X position _mposY = _mpos select 1; //Gets the marker's Y position _msizeX = getMarkerSize _marker select 0; //Gets the marker's X width _msizeY = getMarkerSize _marker select 1; //Gets the marker's Y height sleep (random _time); //Sleeps for a random time specified in the execVM _time _minX = (_mposX - _msizeX) / 2; // get min x pos. so i can add the random[_size] to it and stay within bound of marker _minY = (_mposY - _msizeY) / 2; // get min y pos. ditto { if (side _x == west) then { _x1 = random (_minX +_msizeX); _y1 = random (_minY + _msizeY); _posx = _minX + _x1; _posy = _minY + _y1; _x domove [_posX,_posY]; }; } foreach units _group;
  8. Woodpeckersam

    what's wrong with this code

    I am not at home, I have no idea if this will work or not. I think the issue is trying to get a random number between the minimum position and the maximum position. The minimum could be coords 011050.10 and the maximum could be 011052.90 and I have no idea how to get a random number between those positions. So i just cleaned the code up a bit. edit: I seem to recall somewhere that a sin and/or cos are required. Im no maths expert, I havent done sin and cosine for years so i am clueless on the subject. Maybe someone with more experience can help. edit 1: _n1 = [ai,2] execVM "movetoWEST.sqf"; private ["_x1","_y1","_posx","_posy","_marker","_time","_group","_mpos","_mposX","_mposY","_minX","_minY","_msizeX","_msizeY"]; //_this select 0 is linked to the first index on the execVM which you can change to what you want any time. ie. _n1 = [ai] execVM "movetoWEST.sqf"; This is the marker's name _marker = _this select 0; //_this select 1 is linked to the second index on the execVM ie. _n1 = [ai, 2] execVM "movetoWEST.sqf"; Change this to the random time you want. _time = _this select 1; //This is the group's name ie. _n1 = [ai, 2, allunits] execVM "movetoWEST.sqf"; _group = _this select 2; _mpos = getMarkerPos _marker; //Gets the marker's position _mposX = _mpos select 0; //Gets the marker's X position _mposY = _mpos select 1; //Gets the marker's Y position _msizeX = getMarkerSize _marker select 0; //Gets the marker's size _msizeY = getMarkerSize _marker select 1; //Gets the marker's size sleep (random _time); //Sleeps for a random time specified in the execVM _time _minX = (_mposX - _msizeX) / 2; // get min x pos. so i can add the random[_size] to it and stay within bound of marker _minY = (_mposY - _msizeY) / 2; // get min y pos. ditto { if (side _x == west) then { _x1 = random (_minX +_msizeX); _y1 = random (_minY + _msizeY); _posx = _minX + _x1; _posy = _minY + _y1; _x domove [_posX,_posY]; }; } foreach units _group;
  9. Woodpeckersam

    ARMA 3 Alpha - 3D Editor

    Ignore this post.
  10. Woodpeckersam

    Arma 3 editor hot keys?

    When typing part of a code, for example... this setDama You will see a highlight of the code it thinks you are typing? Press F1 to see ingame documentation for that code =)
  11. I've got it working. If anyone is interested, here is the script. Feel free to change it around it and use it. This could be useful for a rearming script in a mission, and using eventHandlers you may be able to change the script to allow a unit to rearm from anywhere. private ["_unit","_crate","_uniform","_backpack","_vest","_helmet","_goggle","_weapon", "_weaponcount","_weaponselect","_uniformcount","_uniformselect","_backpackcount", "_backpackselect","_vestcount","_vestselect","_helmetcount","_helmetselect","_gogglecount", "_goggleselect","_wearing"]; _unit = _this select 0; _crate = _this select 1; //If the unit is equalled to the player, then exit. This is because the player can change weapons/ //Gear/Items themselves if (_unit == player) exitWith {}; //The Uniform is from the UK Special Forces Mod _uniform = [ "U_mas_uk_B_CombatUniform_mcam_tshirt", "U_mas_uk_B_CombatUniform_mcam_vest", "U_mas_uk_B_CombatUniform_mcam" ]; //Copied the Backpacks that the UK special forces uses by looking at the config in the editor (CTRL+G) _backpack = [ "B_AssaultPack_rgr_Medic", "B_Bergen_sgg_Exp", "B_AssaultPack_rgr_Repair" ]; //Copied over the vests the UK Special Forces uses from the config _vest = [ "V_mas_uk_PlateCarrier1_rgr", "V_mas_uk_PlateCarrierGL_rgr", "V_mas_uk_PlateCarrier2_rgr", "V_mas_uk_BandollierB_rgr", "V_mas_uk_ChestrigB_rgr" ]; //Same above with the helmets _helmet = [ "", "H_HelmetB", "H_mas_uk_HelmetB", "H_mas_uk_Cap_headphones", "H_mas_uk_HelmetB_paint", "H_mas_uk_HelmetB_light", "H_mas_uk_MilCap_mcamo", "" ]; //An array of Goggles already in the game alongside "none" I dont want my units to always wear //goggles. _goggle = [ "None", "G_Shades_Black", "None", "G_Shades_Blue", "None", "G_Sport_Blackred", "None", "G_Tactical_Clear", "None" ]; //An array of some of the weapons and their attachments that are currently in the game, mainly //BLUFOR related weapons. _weapon = [ //EBR Sniper Rifles "srifle_EBR_F", "srifle_EBR_ACO_grip_F", "srifle_EBR_ACO_point_grip_F", "srifle_EBR_Holo_grip_F", "srifle_EBR_Holo_point_grip_F", "srifle_EBR_ACOg_grip_F", "srifle_EBR_ACOg_point_grip_F", "srifle_EBR_ARCO_grip_F", "srifle_EBR_ARCO_point_grip_F", //Light Machine Guns "LMG_Mk200_F", "LMG_Mk200_ARCO_bipod_F", "LMG_Mk200_ARCO_pointer_bipod_F", "LMG_Mk200_COWS_pointer_bipod_F", "LMG_Mk200_ACO_grip_F", "LMG_Mk200_ACO_point_gripf_F", //MX "arifle_MXC_F", "arifle_MX_F", "arifle_MX_GL_F", "arifle_MX_SW_F", "arifle_MXM_F", "arifle_MX_ARCO_point_grip_F", "arifle_MX_Hamr_point_grip_F", "arifle_MX_ACO_point_gripod_mzls_F", "arifle_MX_ACOg_point_gripod_mzls_F", "arifle_MX_ACO_point_grip_F", "arifle_MX_ACOg_point_grip_F", "arifle_MX_GL_ACO_point_F", "arifle_MX_GL_ACOg_point_F", "arifle_MX_GL_ARCO_point_mzls_F", "arifle_MX_GL_Hamr_point_mzls_F", "arifle_MXC_Holo_F", "arifle_MXC_Holo_point_grip_F", "arifle_MXC_Holo_point_grip_snds_F", "arifle_MXC_ACO_point_grip_mzls_F", "arifle_MXC_ACOg_point_grip_mzls_F", "arifle_MXC_ACO_point_grip_F", "arifle_MXC_ACOg_point_grip_F", "arifle_MXC_ACO_flash_grip_mzls_F", "arifle_MXC_ACOg_flash_grip_mzls_F", "arifle_MX_SW_ARCO_point_gripod_F", "arifle_MX_SW_Hamr_point_gripod_F", "arifle_MXM_ARCO_point_gripod_F", "arifle_MXM_Hamr_point_gripod_F" ]; //Randomly selects a Backpack in the array and assigns the index number of that Backpack to a //variable which then can be used for a unit to wear. _backpackcount = (random (count _backpack)); _backpackselect = _backpack select _backpackcount; //Randomly selects a Vest in the array and assigns the index number of that Vest to a //variable which then can be used for a unit to wear. _vestcount = (random (count _vest)); _vestselect = _vest select _vestcount; //Randomly selects a Helmet in the array and assigns the index number of that Helmet to a //variable which then can be used for a unit to wear. _helmetcount = (random (count _helmet)); _helmetselect = _helmet select _helmetcount; //Randomly selects Goggles/Glasses in the array and assigns the index number of the Goggles/Glasses //to a variable which then can be used for a unit to wear. _gogglecount = (random (count _goggle)); _goggleselect = _goggle select _gogglecount; //Commands a unit to move to the crate specified. Depending on if there is a leader available or not //It will issue different commands to get the unit to move to a specified crate if (count alive (group _unit) > 1) then {_unit commandMove getPos _crate}; if (count alive (group _unit) == 1) then {_unit doMove getPos _crate}; //Waits until the unit is at a certain distance from the crate. waitUntil {_unit distance _crate <= 6}; sleep 2; //Remove the teammates uniform and weapons removeAllWeapons _unit; sleep (random 0.3); removeUniform _unit; sleep (random 0.3); removeAllContainers _unit; sleep (random 0.3); removeAllAssignedItems _unit; sleep (random 0.3); /////////////////////////////////// Uniform Loop /////////////////////////////////////////////////// _nouniform = uniform _unit; //Gets the current non-uniform of the unit sleep 0.1; while {uniform _unit == _nouniform} do //Loop back here if the unit has no uniform. { _uniformcount = (random (count _uniform)); _uniformselect = _uniform select _uniformcount; _unit addUniform _uniformselect; //Adds uniform from Random Uniform Select sleep 0.5; }; //////////////////////////////////////////////////////////////////////////////////////////////////// _unit addVest _vestselect; sleep 0.5; _unit addBackpack _backpackselect; sleep 0.5; _unit addHeadGear _helmetselect; sleep 0.5; /////////////////////////////////// Weapon Loop ///////////////////////////////////////////////////// _noweapon = primaryWeapon _unit; //Gets the current non-weapon of the unit sleep 0.1; while {primaryWeapon _unit == _noweapon} do //Loop back here if the unit has no weapon. { _weaponcount = (random (count _weapon)); _weaponselect = _weapon select _weaponcount; _unit addWeapon _weaponselect; //Adds a random weapon from the Weapon Select Array sleep 0.5; }; //////////////////////////////////////////////////////////////////////////////////////////////////// _unit addGoggles _goggleselect; sleep 0.5; _unit doMove getPos _crate; _unit setDir (getDir _crate) - (getDir _unit); sleep 1; //Rearm at the specified crate _unit action ["rearm", _crate]; exit;
  12. Hello, I have been stuck with this problem most of the day. On the mission the player's team starts in enemy infested waters as they have left a submarine (long gone at this stage of the mission as there are no models of one yet). Upon arriving to land there are a few enemy divers preparing to get into the waters to lay mines, they have left a Nato Ammo Crate and a truck behind, but the player's team must kill them to carry on the mission. The player is the leader controlling 3 AI units. I really wanted to simulate AI getting out of the Diver's suit and changing into gear that is inside the Ammo Crate. But since this may never be an official feature, I tried to script it the best looking way I can. Seeing that the AI will never be able to get gear out of Ammo crates, I had an array of 4 different types of soldiers. I put each of their gear into an array and made it so that when a teammate gets to the Ammo Crate, it will randomly choose Uniform, HeadGear, BackPack and Vests out of the units in the array (they are well off map so they will never be seen). However I have a problem. I have no way, and know no way of checking if the randomly chosen unit has lets say a backpack or not. Because when this scripts runs, randomly it will work 100% but maybe on the 3rd unit it will fail as it would appear as "Undefined variable given for _backpack" for example, which leads me to suggest maybe the unit does not have a backpack, therefore it errors out and stops the code from continuing. Here is the code, can anyone help? _unitArray = [Marksman,Rifleman,Grenadier,Engineer]; //4 units off map used for randomly getting gear/clothing for use in variables to equip teammates //Loop from 1 to 3 to be used with selecting individual group members. Changing it from 1 to 0 would select the leader too. For "_i" from 1 to 3 do { //Select a group member in sequence from unit 1 to unit 3 NOT unit 0 to unit 3 as unit 0 is the group leader (player) _team = units group player select _i; //Get the current clothing that _unitGuy is wearing _clothes = uniform (_unitArray select (random(count _unitArray))); _vest = vest (_unitArray select (random (count _unitArray))); _head = headgear (_unitArray select (random (count _unitArray))); _backpack = backpack (_unitArray select (random (count _unitArray))); _team commandMove getPos Crate; waitUntil {_team distance Crate <= 5}; sleep 2; //Remove the teammates uniform and weapons removeAllWeapons _team; removeUniform _team; sleep (random 0.3); removeAllContainers _team; sleep (random 0.3); removeAllAssignedItems _team; sleep (random 0.3); _team addUniform _clothes; sleep 0.5; _team addVest _vest; sleep 0.5; _team addBackpack _backpack; sleep 0.5; _team addHeadGear _head; sleep 0.5; };
  13. All of them, assuming that they have a history over the years all the way up to 2035 =) Big changes, town increases in size or towns decimated, an island once full of life turned into a wasteland. An small island once used as a NATO Military Base has transformed into a huge OPFOR Prison (Island scale prison) with tall walls and buildings. Anything is possible :D
  14. Woodpeckersam

    Arma 3 SeaLife Project

    How great would it be if there would be Bowhead Whales - http://www.in2greece.com/english/animals_plants/dolphins_sharks_whales.htm read the bottom one.
  15. Woodpeckersam

    Arma 3 SeaLife Project

    Just did a quick google search and found this. Hope it find use =) http://www.in2greece.com/english/animals_plants/fish.htm (use the menu at the top to switch between sea life)
  16. Well it may be possible to edit a map to a certain extent. I found this scripting command... http://community.bistudio.com/wiki/buldozer_LoadNewRoads and scripting commands can only be used in game even if this is used with Bulldozer afaik. Im only guessing here, but it could be possible to a certain extent? Would be nice to have tunnels and underground structures. They would have to fix the AI first.
  17. Woodpeckersam

    Arma 3 SeaLife Project

    Would underwater wrecks be considered as part of sea life? Be great if you could include more of them :D Great work!
  18. Woodpeckersam

    SQF Editor

    Hey, i've been using this a while. Now ArmA 3 is out, ever thought about allowing support for the new ArmA 3 commands? ps. I know i've posted in another thread for a similar tool (which i have not used). It would be nice to see support for either of them for ArmA 3.
  19. Woodpeckersam

    ArmADev Eclipse Plugin

    Hey, ever thought of supporting ArmA 3 with this software?
  20. I have changed the script heavily and I am still receiving the Error: Undefined variable in expressions (this time its _ammo or _backpackselect) This time it is not getting info out of a config, but straight from an array itself. Can someone explain to me why I am getting this error? Here is the updated script. (Too long I know, but the best I can do) _uniform = [ "U_B_CombatUniform_mcam", "U_B_CombatUniform_mcam_tshirt", "U_B_CombatUniform_mcam_vest", "U_B_CombatUniform_mcam_worn", "U_B_GhillieSuit" ]; _backpack = [ "B_AssaultPack_khk", "B_AssaultPack_khk_holder", "B_AssaultPack_khk_Ammo", "B_AssaultPack_khk_Medic", "B_AssaultPack_dgtl", "B_AssaultPack_dgtl_AAR", "B_AssaultPack_dgtl_Spotter", "B_AssaultPack_rgr", "B_AssaultPack_rgr_AT", "B_AssaultPack_rgr_Medic", "B_AssaultPack_rgr_ReconMedic", "B_AssaultPack_rgr_Repair", "B_AssaultPack_cbr" ]; _vest = [ "V_Rangemaster_belt", "V_BandollierB_khk", "V_BandollierB_rgr", "V_BandollierB_cbr", "V_PlateCarrier1_rgr", "V_PlateCarrier1_cbr", "V_PlateCarrier2_rgr", "V_PlateCarrier2_cbr", "V_PlateCarrierGL_cbr", "V_PlateCarrierSpec_rgr", "V_PlateCarrierSpec_cbr", "V_Chestrig_khk", "V_ChestrigB_rgr", "V_ChestrigB_khk", "V_Chestrig_camo", "V_TacVest_khk", "V_TacVest_brn", "V_TacVest_camo", "V_TacVest_oli", "V_TacVestIR_blk", "V_HarnessO_brn", "V_HarnessOGL_brn", "V_HarnessOSpec_brn", "V_TacVestCamo_khk", "V_PlateCarrierIA1_khk", "V_PlateCarrierIA2_khk", "V_PlateCarrierIAGL_khk" ]; _helmet = ["H_HelmetB", "H_HelmetB_paint", "H_HelmetB_light", "H_HelmetB_plain_mcamo", "H_HelmetB_plain_blk", "H_HelmetIA", "H_HelmetI_net", "H_HelmetI_camo", "H_MilCap_ocamo", "H_MilCap_oucamo", "H_MilCap_rucamo", "H_MilCap_mcamo", "H_MilCap_gry", "H_MilCap_dgtl", "H_MilCap_blue", "H_MilCap_chck1", "H_MilCap_chck2", "H_MilCap_chck3" ]; _goggle = [ "None", "G_Shades_Black", "None", "G_Shades_Blue", "None", "G_Sport_Blackred", "None", "G_Tactical_Clear", "None" ]; _weapon = [ //EBR Sniper Rifles "srifle_EBR_F", "srifle_EBR_ACO_grip_F", "srifle_EBR_ACO_point_grip_F", "srifle_EBR_Holo_grip_F", "srifle_EBR_Holo_point_grip_F", "srifle_EBR_ACOg_grip_F", "srifle_EBR_ACOg_point_grip_F", "srifle_EBR_ARCO_grip_F", "srifle_EBR_ARCO_point_grip_F", //Light Machine Guns "LMG_Mk200_F", "LMG_Mk200_ARCO_bipod_F", "LMG_Mk200_ARCO_pointer_bipod_F", "LMG_Mk200_COWS_pointer_bipod_F", "LMG_Mk200_ACO_grip_F", "LMG_Mk200_ACO_point_gripf_F", //MX "arifle_MXC_F", "arifle_MX_F", "arifle_MX_GL_F", "arifle_MX_SW_F", "arifle_MXM_F", "arifle_MX_ARCO_point_grip_F", "arifle_MX_Hamr_point_grip_F", "arifle_MX_ACO_point_gripod_mzls_F", "arifle_MX_ACOg_point_gripod_mzls_F", "arifle_MX_ACO_point_grip_F", "arifle_MX_ACOg_point_grip_F", "arifle_MX_GL_ACO_point_F", "arifle_MX_GL_ACOg_point_F", "arifle_MX_GL_ARCO_point_mzls_F", "arifle_MX_GL_Hamr_point_mzls_F", "arifle_MXC_Holo_F", "arifle_MXC_Holo_point_grip_F", "arifle_MXC_Holo_point_grip_snds_F", "arifle_MXC_ACO_point_grip_mzls_F", "arifle_MXC_ACOg_point_grip_mzls_F", "arifle_MXC_ACO_point_grip_F", "arifle_MXC_ACOg_point_grip_F", "arifle_MXC_ACO_flash_grip_mzls_F", "arifle_MXC_ACOg_flash_grip_mzls_F", "arifle_MX_SW_ARCO_point_gripod_F", "arifle_MX_SW_Hamr_point_gripod_F", "arifle_MXM_ARCO_point_gripod_F", "arifle_MXM_Hamr_point_gripod_F" ]; _ammo = [ //EBR Sniper Rifles "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", "20Rnd_762x45_Mag", //Light Machine Guns "5000Rnd_762x45_Belt", "5000Rnd_762x45_Belt", "5000Rnd_762x45_Belt", "5000Rnd_762x45_Belt", "5000Rnd_762x45_Belt", "5000Rnd_762x45_Belt", //MX "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green", "30Rnd_65x39_case_mag_green" ]; _alive = count units group player; //Loop from 1 to 3 to be used with selecting individual group members. Changing it from 1 to 0 would select the leader too. For "_i" from 1 to _alive do { _weaponcount = (random (count _weapon)); _weaponselect = _weapon select _weaponcount; _uniformcount = (random (count _uniform)); _uniformselect = _uniform select _uniformcount; _backpackcount = (random (count _backpack)); _backpackselect = _backpack select _backpackcount; _vestcount = (random (count _vest)); _vestselect = _vest select _vestcount; _helmetcount = (random (count _helmet)); _helmetselect = _helmet select _helmetcount; _gogglecount = (random (count _goggle)); _goggleselect = _goggle select _gogglecount; //Select a group member in sequence from unit 1 to unit 3 NOT unit 0 to unit 3 as unit 0 is the group leader (player) _team = units group player select _i; _team doMove (getMarkerPos "Crate"); waitUntil {_team distance (getMarkerPos "Crate") <= 4}; sleep 2; //Remove the teammates uniform and weapons removeAllWeapons _team; removeUniform _team; sleep (random 0.3); removeAllContainers _team; sleep (random 0.3); removeAllAssignedItems _team; sleep (random 0.3); _team addUniform _uniformselect; sleep 0.5; _team addVest _vestselect; sleep 0.5; _team addBackpack _backpackselect; sleep 0.5; _team addHeadGear _helmetselect; sleep 0.5; _team addWeapon _weaponselect; sleep 0.5; _team addGoggles _goggleselect; sleep 0.5; _team addMagazine (_ammo select _weaponcount); }; (ps. I know I have duplicated the ammo many times, I just dont know how to match ammo with a gun, so I copied the amount of ammo to the amount of guns so the correct ammo can be selected with the same _weaponcount as the _weapon array) But it does not work :/ edit: Now it is saying Error: Undefined variable in expressions _team... this is getting weird and out of hand lol.
  21. @Tajin & Stevos You dont need to write that code now. When you place a unit down in the editor, you see "elevation" at the bottom left of the unit window? I simply write 0.1 for the height. It works for me.
  22. Thanks man, I did try it similar that way, except having "" i added nil and isNil. I should have the brains to know that "" works. The updated code you posted works even better. Many thanks man. ---------- Post added at 15:24 ---------- Previous post was at 14:21 ---------- I thought it works, it usually does so these errors are pretty random. I dont even understand what its telling me, this is what I get on random occasions, not every play through, but quite often. Error: Undefined variable in expressions (either _mags or _backpack) This is my code now _unitArray = [Marksman,Rifleman,Grenadier,Engineer]; _uniformArray = ["U_B_CombatUniform_mcam","U_B_CombatUniform_mcam_tshirt","U_B_CombatUniform_mcam_vest"]; _wpncfg = configFile >> "CfgWeapons"; //Loop from 1 to 3 to be used with selecting individual group members. Changing it from 1 to 0 would select the leader too. For "_i" from 1 to 3 do { _wpncount = (random (count _wpncfg)); _wpnselect = _wpncfg select _wpncount; _wpnname = configName _wpnselect; //Select a group member in sequence from unit 1 to unit 3 NOT unit 0 to unit 3 as unit 0 is the group leader (player) _team = units group player select _i; //Get the current clothing that _unitGuy is wearing _vest = vest (_unitArray select (random (count _unitArray))); _head = headgear (_unitArray select (random (count _unitArray))); _backpack = backpack (_unitArray select (random (count _unitArray))); _team doMove (getMarkerPos "Crate"); waitUntil {_team distance (getMarkerPos "Crate") <= 4}; sleep 2; //Remove the teammates uniform and weapons removeAllWeapons _team; removeUniform _team; sleep (random 0.3); removeAllContainers _team; sleep (random 0.3); removeAllAssignedItems _team; sleep (random 0.3); _team addUniform (_uniformArray select (random(count _uniformArray))); sleep 0.5; if ((typeName _vest) == "STRING" && _vest != "") then {_team addVest _vest}; sleep 0.5; if ((typeName _backpack) == "STRING" && _backpack != "") then {_team addBackpack _backpack}; sleep 0.5; if ((typeName _head) == "STRING" && _head != "") then {_team addHeadGear _head}; sleep 0.5; _team addWeapon _wpnname; sleep 0.5; _curweap = currentWeapon _team; _ammocfg = getArray (configFile >> "CfgWeapons" >> _curweap >> "magazines"); _mags = _ammocfg select 0; for "_i" from 0 to 5 do {_team addMagazine _mags}; }; Does anyone have any idea what is going on?
  23. Woodpeckersam

    Moving newly created ai units

    no probs mate =) this is how i would have done it with regards to moving each individual units. How about you? {_x doMove (getMarkerPos "CenterOfTown")} foreach units _NewGroup;
  24. Woodpeckersam

    Rifle Collision Addon

    Is going up the stairs fixed in the new version? Otherwise great mod!
×