Jump to content

FederalRazer89

Member
  • Content Count

    84
  • Joined

  • Last visited

  • Medals

Everything posted by FederalRazer89

  1. Thanks dwringer Going to try it when i downloaded arma 3 on the laptop, hope it can run the game or else i will have to wait untill get home.
  2. Hmm didnt think about that, but wont that depend on the map creator having to create those locations? Because i dont know too much about mapmaking in arma i am not sure if i can depend on those locations. But i going to try it on some maps and see how it goes.
  3. As the title suggest i am trying to get some position from arrays of the command "nearestObjects". I want the "nearestObjects" to look for a certain amount of house, so i can identify a village or town with the script and then use the average of all the listed house in the array. That way the position i am after will not be heavily affected by one or two houses caught in the calclated radius. _Center = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _mapsize = (_Center select 0)*2; _RandomStartPos = [_Center, (_mapsize*0.77), (_mapsize*0.78), 3, 1, 20, 0] call BIS_fnc_findSafePos; sleep 1; player moveInCargo [_heli,5]; _enemySpawnPos = [_RandomStartPos, (_mapsize*0.7), _mapsize*0.71, 3, 0, 20, 0] call BIS_fnc_findSafePos; createMarker ["marker2",_enemySpawnPos]; "marker2" setMarkerShape "ELLIPSE"; "marker2" setMarkerSize [500,500]; "marker2" setMarkerText "Enemy resupply line"; "marker2" setMarkerAlpha 0.5; _findhouses = nearestObjects [[((_enemySpawnPos select 0)+(_mapsize*0.2)),((_enemySpawnPos select 1)+(_mapsize*0.2))], "house"", (_mapsize*0.2)]; _divide = count _findhouses; _fortifiedpos = _findhouses/_divide; createMarker ["marker3",_fortifiedpos]; "marker3" setMarkerShape "ELLIPSE"; "marker3" setMarkerSize [500,500]; "marker3" setMarkerText "Enemy resupply line"; "marker3" setMarkerAlpha 0.5;
  4. Really missed that detail, thanks should have gone to sleep early. But the spawned units dont join the player in the heli and "_unit2" dont spawn at all. Edit: Removed assignAsCargo and added "units group player select 1" and it worked.
  5. I am trying to create a mission that teleports the player and some newly created AI:s to a helicopter, but i encounter some problems with the "moveInCargo" commnad. I get generic error in expression, and the Ai units dont assume there new identity. Also looking a way to find the edge of the map so i can start by flying form the edge of the map and spawn in other AI:s from the edge. The script: _Center = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); _RandomStartPos = [_Center, 2000, 10000, 3, 0, 20, 0] call BIS_fnc_findSafePos; _spawnedVehicleArray = [_RandomStartPos,random (360),"B_Heli_Transport_01_F",west] call BIS_fnc_spawnVehicle; _heli = _spawnedVehicleArray select 0; _heliCrews = _spawnedVehicleArray select 2; sleep 1; player setFace "AfricanHead_01"; player setSpeaker "Male01ENGB"; player moveInCargo [_heli]; _unit1 = "B_medic_F" createUnit [position player, group player]; _unit1 setIdentity "Razer"; _unit1 moveInCargo [_heli]; _unit1 assignAsCargo [_heli]; _unit2 = "B_Recon_Sharpshooter_F" createUnit [position player, group player]; _unit2 setIdentity "Ghost"; _unit2 moveInCargo [_heli]; _unit2 assignAsCargo [_heli]; The script isnt done, going to add some waypoint and offloading of units and other stuff. Edit: My plan is to create a mission which have controlled amount of AI across the map on several semi random objectivs. Used DUWS before as a plattform for a mission with the mod Ravage, but i started to get annoyed at several things big and small, especially the amount of AI that spawned and just took unnecessery CPU power.
  6. FederalRazer89

    Ravage

    I am on version 1.64, but i going to play for a bit more to be sure. If it still happen then i am going to try 1.66. The units is not spawned with the editor its with a script because i want the mission to work on any map. In the furture going to try and change so the ai can spawn and fortify existing buildings, etc. the script: MinimumAIamount = 6; FR_fnc_MonitorAIBase = { private ["_grp"]; _grp = _this select 0; _campfire = _this select 1; _Wcar = _this select 2; _Wpickup = _this select 3; _Cargo = _this select 4; _Slumhouse = _this select 5; _Generator = _this select 6; _lamp = _this select 7; _Cloth = _this select 8; _grpsentry = _this select 9; _grpsentry2 = _this select 10; _randombanditcar = _this select 11; while {true} do { if ((player distance (leader _grp)) >= 2500) exitWith { {deleteVehicle _x} forEach units _grp; deleteVehicle _campfire; deleteVehicle _Wcar; deleteVehicle _Wpickup; deleteVehicle _Cargo; deleteVehicle _Slumhouse; deleteVehicle _Generator; deleteVehicle _lamp; deleteVehicle _Cloth; {deleteVehicle _x} forEach units _grpsentry; {deleteVehicle _x} forEach units _grpsentry2; {_randombanditcar deleteVehicleCrew _x} forEach crew _randombanditcar; deleteVehicle _randombanditcar; }; sleep 1000; }; }; 0 = [] spawn { while {true} do { sleep (random [1000,1800,2400]); _radius = random [1000,1800,2000]; _spawnPos = [player, _radius, (RANDOM 360)] call BIS_fnc_relPos; _spawnPos = [_spawnPos, 20, 500, 3, 0, 0.065, 0] call BIS_fnc_findSafePos; _grp = [_spawnPos, INDEPENDENT,["I_C_Soldier_Para_2_F","I_Soldier_LAT_F","I_Soldier_AA_F","I_G_Soldier_A_F","O_Soldier_A_F","O_HeavyGunner_F"]] call BIS_fnc_spawnGroup; {[_x] call rvg_fnc_equip} forEach units _grp; _grp setBehaviour "CARELESS"; _grp setFormation "COLUMN"; _wpguard = _grp addWaypoint [([(_spawnPos select 0)+(random [-2,0,2]),(_spawnPos select 1)+(random [-2,0,2])]), 20]; _wpguard setWaypointType "GUARD"; _campfire = "Campfire_burning_F" createVehicle _spawnPos; _Wcar = "Land_Wreck_CarDismantled_F" createVehicle ([(_spawnPos select 0)+(random [5,7,10]),(_spawnPos select 1)+(random [5,7,10])]); _Wcar setDir (RANDOM 360); _Wpickup = "Land_Wreck_Offroad2_F" createVehicle ([(_spawnPos select 0)+(random [2,3,4]),(_spawnPos select 1)+(random [-11,-12,-13])]); _Wpickup setDir (RANDOM 360); _Cargo = "Land_cargo_house_slum_F" createVehicle ([(_spawnPos select 0)+(random [20,21,25]),(_spawnPos select 1)+(random [20,21,25])]); _Cargo setDir (RANDOM 360); _Slumhouse = "Land_Slum_House03_F" createVehicle ([(_spawnPos select 0)+(random [-4,-1,0]),(_spawnPos select 1)+(random [-4,-1,0])]); _Slumhouse setDir (RANDOM 360); _Generator = "Land_Portable_generator_F" createVehicle ([(_spawnPos select 0)+(random [1,1,2]),(_spawnPos select 1)+(random [1,1,2])]); _Generator setDir (RANDOM 360); _lamp = "Land_Lamp_Small_EP1" createVehicle ([(_spawnPos select 0)+(random [2,2,3]),(_spawnPos select 1)+(random [-4,-1,0])]); _lamp setDir (RANDOM 360); _Cloth = "Land_ClothesLine_01_short_F"createVehicle ([(_spawnPos select 0)+(random [7,7,8]),(_spawnPos select 1)+(random [7,7,8])]); _Cloth setDir (RANDOM 360); _grpsentry = [([(_spawnPos select 0)+(random [30,30,40]),(_spawnPos select 1)+(random [30,30,40])]), INDEPENDENT,["I_C_Soldier_Para_8_F","I_C_Soldier_Para_6_F","I_G_Sharpshooter_F","I_C_Soldier_Para_4_F"]] call BIS_fnc_spawnGroup; {[_x] call rvg_fnc_equip} forEach units _grpsentry; _grpsentry setBehaviour "CARELESS"; _wp = _grpsentry addWaypoint [_spawnPos, 30]; _wp1 = _grpsentry addWaypoint [_spawnPos, 50]; _wp2 = _grpsentry addWaypoint [_spawnPos, 50]; _wp3 = _grpsentry addWaypoint [_spawnPos, 30]; _wp4 = _grpsentry addWaypoint [_spawnPos, 50]; _wp5 = _grpsentry addWaypoint [_spawnPos, 100]; _wp6 = _grpsentry addWaypoint [_spawnPos, 30]; _wp6 setWaypointType "CYCLE"; _grpsentry2 = [([(_spawnPos select 0)+(100),(_spawnPos select 1)+(100)]), INDEPENDENT,["I_G_Sharpshooter_F","I_Soldier_AA_F","I_Soldier_AA_F"]] call BIS_fnc_spawnGroup; _wp20 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp21 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp22 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp23 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp24 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp25 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp26 = _grpsentry2 addWaypoint [_spawnPos, 150]; _wp26 setWaypointType "CYCLE"; _randombanditcar = "I_G_Offroad_01_armed_F" createVehicle ([(_spawnPos select 0)+(random [3,5,10]),(_spawnPos select 1)+(random [15,17,20])]); createVehicleCrew _randombanditcar; _randombanditcar setDir (RANDOM 360); _randombanditcar setfuel 0; //This gap has lots of weapons and ammo that i removed to condense the script. [_grp,_campfire,_Wcar,_Wpickup,_Cargo,_Slumhouse,_Generator,_lamp,_Cloth,_grpsentry,_grpsentry2,_randombanditcar] spawn FR_fnc_MonitorAIBase; waitUntil {count units _grp < MinimumAIamount}; }; };
  7. FederalRazer89

    Ravage

    I think i found a bug with Ravage 0.1.40. After playing for about 6 hours straight, the player character started do some weird stuff, like starting to rotate after ironsighting or using a rangefinder. I only encounterd this problem after installing the latest verison. The mods i have active: Ravage Simple Single Player Cheat Menu(for troubleshooting or random fun stuff) Ares [steam] JSRS4:APEX CBA_A3 [steam] CUP Terrains - Core [steam] CUP Terrains - Maps [steam] Napf Island A3 Beketov [steam] And i also encounter a weird stuff with line "{[_x] call rvg_fnc_equip} forEach units _grp;" that you provided. It causes the waypoints that i have placed to be replaced, so sometimes i see guard to a base/camp wandering 1km from there intended location.
  8. I am trying to add some ambient items to a banditcamp, but my buring campfire wont get deleted when the script executes. The units that spawn with the camp gets deleted so i thought the same logic would apply to objects placed with the script. The game say something about a arma 3 undefined variable in expression and refers to the line "deletevehicle _campfire;" The script: MinimumAIamount = 6; FR_fnc_MonitorAI = { private ["_grp","_randombanditcar","_randombanditcar","_campfire"]; _grp = _this select 0; while {true} do { if ((player distance (leader _grp)) >= 2000) exitWith { {deleteVehicle _x} forEach units _grp; deleteVehicle _campfire; deleteVehicle _randombanditcar; }; _time = time; waitUntil {time > (_time + 60)}; }; }; 0 = [] spawn { while {true} do { _radius = random [1200,1500,1800]; _spawnPos = [player, _radius, (RANDOM 360)] call BIS_fnc_relPos; _spawnPos = [_spawnPos, 0.01, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos; _grp = [_spawnPos, INDEPENDENT,["I_C_Soldier_Para_2_F","I_Soldier_LAT_F","B_sniper_F","I_G_Soldier_A_F","O_Soldier_A_F","B_Soldier_A_F"]] call BIS_fnc_spawnGroup; _grp setBehaviour "STEALTH"; _grp setFormation "WEDGE"; _campfire = "Campfire_burning_F" createVehicle _spawnPos; _randombanditcar = "I_G_Offroad_01_armed_F" createVehicle ([(_spawnPos select 0)+(random [3,5,10]),(_spawnPos select 1)+(random [3,5,10])]); createVehicleCrew _randombanditcar; _randombanditcar setFuel 0,1 _randombanditcar setDamage 0,2 _randombanditcar addWeaponCargo ["srifle_DMR_02_DMS_F",1]; //weapons and ammo _randombanditcar addWeaponCargo ["srifle_DMR_03_MRCO_F",1]; _randombanditcar addWeaponCargo ["srifle_DMR_05_SOS_F",1]; _randombanditcar addWeaponCargo ["MMG_02_black_RCO_BI_F",1]; _randombanditcar addWeaponCargo ["MMG_01_hex_ARCO_LP_F",1]; _randombanditcar addMagazineCargo ["10Rnd_338_Mag",2]; _randombanditcar addMagazineCargo ["20Rnd_762x51_Mag",2]; _randombanditcar addMagazineCargo ["150Rnd_93x64_Mag",2]; _randombanditcar addMagazineCargo ["130Rnd_338_Mag",2]; _randombanditcar addItemCargo ["muzzle_snds_H",1]; _randombanditcar addItemCargo ["muzzle_snds_L",1]; _randombanditcar addItemCargo ["muzzle_snds_M",1]; _randombanditcar addItemCargo ["muzzle_snds_B",1]; _randombanditcar addItemCargo ["muzzle_snds_338_black",1]; _randombanditcar addItemCargo ["muzzle_snds_93mmg",1]; _randombanditcar addItemCargo ["bipod_01_F_blk",1]; _campradius = random [2,5,20]; _wp = _grp addWaypoint [position _campfire, _campradius]; _wp setWaypointType "GUARD"; [_grp] spawn FR_fnc_MonitorAI; sleep 600; waitUntil {count units _grpcamp < MinimumAIamount}; }; }; It feels like i am missing something simple. Tried to narrow down the problem to only the campfire with this little script: _radius = random [1200,1500,1800]; _spawnPos = [player, _radius, (RANDOM 360)] call BIS_fnc_relPos; _spawnPos = [_spawnPos, 0.01, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos; _campfire = "Campfire_burning_F" createVehicle _spawnPos; sleep 30; deleteVehicle _campfire; But it outputs error generic error in expression. I looked at the example that on the "deletevehicle" (https://community.bistudio.com/wiki/deleteVehicle) If anyone can point out whats wrong or how to fix/workaround, that would be nice.
  9. FederalRazer89

    Ravage

    Tried to spawn a unit with that line, and it didnt work "I_G_Soldier_F" createUnit [_spawnPos, _grpsentry,{call rvg_fnc_equip}];
  10. FederalRazer89

    Ravage

    Well i dont know how to define the init of unit that is spawned through a script, i dont place any units with the editor. this is one line that i use to spawn units: _grp = [_spawnPos, INDEPENDENT,["I_C_Soldier_Para_2_F","I_Soldier_LAT_F","B_sniper_F","I_G_Soldier_A_F","O_Soldier_A_F","O_HeavyGunner_F"]] call BIS_fnc_spawnGroup; but if i use the "createUnit" command it apparently have a init. will try that.
  11. FederalRazer89

    Cant delete campfire

    A "waituntil" command dosent it check each frame? Or do the "sleep 60" line controll it to every 60 second? Dont need high precision timing with the current scripts. while i am still asking about optimizing stuff which is the best way to call scripts like the one discussed above? Using execVM at the moment.
  12. FederalRazer89

    Ravage

    Anyone know how i would use this command "0 = [this] call rvg_fnc_equip;"? Trying to create a bandit base though a script, would add more atmosphere with more random loadouts.
  13. FederalRazer89

    Cant delete campfire

    Do you mean the "while {true}" line? At moment i dont know any better ways to spawn AI without using this loop, if you know a better way please share.
  14. FederalRazer89

    Cant delete campfire

    a spelling error.... Think i need to sleep more and script less. :)
  15. FederalRazer89

    Cant delete campfire

    Why wont they work?
  16. FederalRazer89

    Cant delete campfire

    After a lot of thinking about what you said Grumpy Old Man i tested some stuff and after i allmost gave up i tried to somehow link the FR_fnc_monitorAI and got the following code. This is the result after trying about 30 times with corrections, and it works MinimumAIamount = 6; FR_fnc_MonitorAI = { private ["_grp"]; _grp = _this select 0; _randombanditcar = _this select 1; _campfire = _this select 2; while {true} do { if ((player distance (leader _grp)) >= 2000) exitWith { {deleteVehicle _x} forEach units _grp; {_randombanditcar deleteVehicleCrew _x} forEach crew _randombanditcar; deleteVehicle _randombanditcar; deleteVehicle _campfire; }; _time = time; waitUntil {time > (_time + 60)}; }; }; 0 = [] spawn { while {true} do { _radius = random [1200,1500,1800]; _spawnPos = [player, _radius, (RANDOM 360)] call BIS_fnc_relPos; _spawnPos = [_spawnPos, 0.01, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos; _grp = [_spawnPos, INDEPENDENT,["I_C_Soldier_Para_2_F","I_Soldier_LAT_F","B_sniper_F","I_G_Soldier_A_F","O_Soldier_A_F","B_Soldier_A_F"]] call BIS_fnc_spawnGroup; _grp setBehaviour "STEALTH"; _grp setFormation "WEDGE"; _campfire = "Campfire_burning_F" createVehicle _spawnPos; _randombanditcar = "I_G_Offroad_01_armed_F" createVehicle ([(_spawnPos select 0)+(random [3,5,10]),(_spawnPos select 1)+(random [3,5,10])]); createVehicleCrew _randombanditcar; _randombanditcar setFuel 0,1; _randombanditcar setDir (RANDOM 360); _randombanditcar addWeaponCargo ["srifle_DMR_02_DMS_F",1]; _randombanditcar addWeaponCargo ["srifle_DMR_03_MRCO_F",1]; _randombanditcar addWeaponCargo ["srifle_DMR_05_SOS_F",1]; _randombanditcar addWeaponCargo ["MMG_02_black_RCO_BI_F",1]; _randombanditcar addWeaponCargo ["MMG_01_hex_ARCO_LP_F",1]; _randombanditcar addMagazineCargo ["10Rnd_338_Mag",2]; _randombanditcar addMagazineCargo ["20Rnd_762x51_Mag",2]; _randombanditcar addMagazineCargo ["150Rnd_93x64_Mag",2]; _randombanditcar addMagazineCargo ["130Rnd_338_Mag",2]; _randombanditcar addItemCargo ["muzzle_snds_H",1]; _randombanditcar addItemCargo ["muzzle_snds_L",1]; _randombanditcar addItemCargo ["muzzle_snds_M",1]; _randombanditcar addItemCargo ["muzzle_snds_B",1]; _randombanditcar addItemCargo ["muzzle_snds_338_black",1]; _randombanditcar addItemCargo ["muzzle_snds_93mmg",1]; _randombanditcar addItemCargo ["bipod_01_F_blk",1]; _campradius = random [2,5,20]; _wp = _grp addWaypoint [position _campfire, _campradius]; _wp setWaypointType "GUARD"; [_grp,_randombanditcar,_campfire] spawn FR_fnc_MonitorAI; sleep 600; waitUntil {count units _grp < MinimumAIamount}; }; }; Thanks Grumpy Old Man I forgot to update the website page so i didnt see the respons from davidoss and harmdhast, so i could have saved some time.
  17. FederalRazer89

    Cant delete campfire

    The time things i didnt know, but when you say that both my varibles are undefined in the "FR_fnc_monitorAI" what do you specifically mean? Is it that i need both _campfire and _randombanditcar to spawn FR_fnc_MonitorAI? I am kind of new to scripting.
  18. FederalRazer89

    Ravage

    That might be interesting to look at, but at the moment i need to change more stuff with the current scripts that i have. Need to optimize some of the things i have take unnecessary preformance, which i can use for more ai or something else that i have planned. But isnt it possible to just use a playmove or playActionNow to lock the movement when getting hit by a zombie or really close?
  19. FederalRazer89

    Ravage

    Haleks Have thought of adding more enemy type? Dont know how hard it is but mabye someone that can hold player/ai if caught. That could make things more challenging.
  20. Hello i adding some ambient units to a mission scenario, they spawn at random locations around the player. The problem is that the script dont delete the ai squads that have spawned when i use the "if" command to trigger the "deleteVehicle" code. The script is meant to delete the ai squad or squads when they get too far away from the player. I have used a simlar script to create zombies that spawn and get deleted when they get seperated from the player, but that used a agent to create so that might be diffrent. I dont know why but almost every time that i use a "if" command, it dosent work and have to look for other ways. If its easier to delete them with a waypoint script or just add a large explosion on there position. I dont have a programming background so i have some gap in my knowledge, any suggestions would be nice. The script: while {true} do { sleep 300; _radius = random [500,600,700]; _spawnPos = [player, _radius, (RANDOM 360)] call BIS_fnc_relPos; _spawnPos = [_spawnPos, 1, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos; _grp = [_spawnPos, EAST,["I_C_Soldier_Para_2_F","I_Soldier_LAT_F","B_sniper_F","I_G_Soldier_A_F","O_Soldier_A_F","B_Soldier_A_F"]] call BIS_fnc_spawnGroup; _grp setBehaviour "CARELESS"; _wp = _grp addWaypoint [position player, _radius]; _wp1 = _grp addWaypoint [position player, _radius]; _wp2 = _grp addWaypoint [position player, _radius]; _wp3 = _grp addWaypoint [position player, _radius]; _wp3 setWaypointType "CYCLE"; if ((player distance (leader _grp)) >= 1000)then{{deleteVehicle _x} forEach units _grp; };};
  21. FederalRazer89

    Cant get a ai squad to get deleted.

    So the "if" command only check the distance relative to the player once at the start? If its thats how it work then i am not supprised that i didnt get it to work. Thank you. Now i know how to work with it.
  22. FederalRazer89

    Ravage

    Was about to try new map when i remembered that the loot spawn is seperated, and the new map apperantly dont have any military buildings. So there will be no high caliber weapons on that map. The map is Beketov and is a huge map with lots of forest. Also when i was playing on Napf and i went to about 50 houses, including military buildings and didnt find a single jerry can, that made me walk about 15km on foot because i couldnt get any fuel. Mabye add some jerry cans to ordinary houses? Going to try and create some type of unit that carries a lot of weapons and ammo, to try and compensate for the lack of weapons spawns for that map, for my mission i need weapons and ammo to supplie my small army/squad. Especially since the ai isnt reliable with handguns.
  23. FederalRazer89

    Ravage

    the ambiant zombies, dont have any hordes, because i want the mission to work on any map. I kind of have a mission based on the DUWS scenario and tailored it with in mind Ravage, so i can chose were to spawn and so on. The building that the AI used is the "Land_Cargo_HQ_V1_F"
  24. FederalRazer89

    Ravage

    I am kind of new to scripting so i didnt think of creating the script like that. Thanks.
  25. FederalRazer89

    Ravage

    i got it at 70m but do it really prevent zombie spawning around ai? Had some ai with i hade spawn in and placed in a military building, and every time i got inside the spawn range zombies emerged for that building. I have tested it on mulitible occasions so i know that it happens for me. My version is 0.1.391 so that may cause some of the problem, but i am wating for the version with open backpack function. After tweaking some stuff with the mission i played about 8 hour nonstop, and didnt want to stop.
×