Jump to content

Casio91Fin

Member
  • Content Count

    165
  • Joined

  • Last visited

  • Medals

Community Reputation

29 Excellent

2 Followers

About Casio91Fin

  • Rank
    Sergeant

Profile Information

  • Gender
    Male
  • Location
    Finland

Recent Profile Visitors

1564 profile views
  1. Casio91Fin

    AI group

    thank you, I didn't think it would be so easy to find an answer. doesn't work as I imagined but a good start, can this also work as a loop?
  2. Casio91Fin

    AI group

    How to get this idea to work? AI group join another AI group if group size less 3. this is a good start from what I have found on the forum. if (count (units AI_GROUP) < 3) then { hint "HI" }; I think that the AI should be found at x distance from a team then the AI could join the team, but if not found then "FALSE"
  3. If you want here is a simple script iniServer.sqf I'm not sure about the functionality, but somehow it could be like this Enemy_fighter = { _alt = 1000; //height _SpawnPlanePos = flagpole_1 getpos [3000, random 360]; //3km and from each direction from this flagpole _dir = [_SpawnPlanePos, flagpole_1] call BIS_fnc_dirTo; //when the plane spawns, it already has the right direction. _Plane = [_SpawnPlanePos, _dir, "class name your plane", eneny side "East,west,Independent"] call BIS_fnc_spawnVehicle; _Aircraft = _Plane select 0; _Aircraft setPosATL [getPosATL _AirPlane select 0, getPosATL _AirPlane select 1, _alt]; //the aircraft now spawns at the correct altitude _Aircraft setVehicleLock "LOCKEDPLAYER"; _AirPlaneCrew = _Plane select 1; _AirPLaneGroup = _Plane select 2; { _x allowFleeing 0; _x setSkill 1; } forEach units _AirPLaneGroup; _wp1 = _AirPLaneGroup addWaypoint [flagpole_1, 0]; _wp1 setWaypointType "SAD"; _wp1 setWaypointCombatMode "RED"; _wp1 setWaypointBehaviour "AWARE"; _wp1 setWaypointSpeed "NORMAL"; _wp2 = _AirPLaneGroup addWaypoint [flagpole_1, 1]; _wp2 setWaypointType "CYCLE"; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointBehaviour "AWARE"; _wp2 setWaypointSpeed "NORMAL"; }; waitUntil {!alive _Aircraft}; _New = [this] spawn Enemy_fighter;
  4. Casio91Fin

    Delay to unit when drop plane

    thank you, that was useful information
  5. how do I get troops out evenly with little delay? when "sleep" and "uisleep" not work in this command. _wp1 setWaypointStatements ["true", "{ _tmpPos = _Plane getpos [-((_PlaneLength / 2) + 20), getDir _Plane]; _tmpPos set [2, ((getpos _Plane) select 2) - 3.5]; unassignVehicle _Plane; _x setpos _tmpPos; _x action ['OpenParachute', _x]; } forEach units New_AI_Team;"];
  6. Casio91Fin

    Need marker a vehicles.

    @pierremgi thanks again. you saved a few brain cells again.
  7. Hey I needed a little help and advice. How to get a marker on vehicles? I have tried everything I have found on the forum and nothing seems to work. the script i use is this vehicles can be spawned continuously in a row _VehicleSpawnPos = [Flag_0, 1300, 1500, 10, 0, 1] call BIS_fnc_findSafePos; _VehicleFindRoad = _VehicleSpawnPos nearRoads 300; _HV = _VehicleFindRoad select 0; _dir = [_VehicleSpawnPos,Flag_0] call BIS_fnc_dirTo; _HVTruePos = [_HV, 10, 15, 10, 0, 1, 0] call BIS_fnc_findSafePos; _Tank = [_HVTruePos, _dir, TankVehicleClass select floor (random count TankVehicleClass), west] call BIS_fnc_spawnVehicle; _TankV = _Tank select 0; _TankSpeed = selectRandom [18,26,30]; _TankV limitSpeed _TankSpeed; _TankV setVehicleLock "LOCKEDPLAYER"; _TankGroup = _Tank select 1; _Tankcrew = _Tank select 2; _TankV setUnloadInCombat [false, false]; nul = [_TankV] execVM "MissionFile\VehicleMarkerV2.sqf"; and the last tested script, which even works a little bit correctly VehicleMarkerV2.sqf _marker = _this select 0; _vehicle = _this select 1; if (alive _vehicle) then { _marker = createMarker ["Vehicle_x", getPos _vehicle]; "Vehicle_x" setMarkerType "mil_triangle"; "Vehicle_x" setMarkerColor "ColorYellow"; "Vehicle_x" setMarkerPos getpos _vehicle; "Vehicle_x" setMarkerDir (direction _vehicle); "Vehicle_x" setMarkerSize [0.57, 0.57]; _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); "Vehicle_x" setMarkerText format ['%1', _vehicleName]; //sleep 0.5; } else {deleteMarker _marker;};
  8. Casio91Fin

    Heli Troops out

    ok i will try
  9. Casio91Fin

    Heli Troops out

    I found out what was wrong. That's good news. And some bad news How to make this work the plane does not drop bombs why? This could also be developed a little better
  10. Casio91Fin

    Heli Troops out

    thanks for that. Other possible fixes you see in this script? But I have done this commands like this is it correct. params ["_MaxActiveAI","_MaxAiTeams","_MissionStartTime","_PossibilityAPC","_PossibilityHeliTroops","_TotalSpawned"]; _MaxActiveAI = "MaxActiveAI" call BIS_fnc_getParamValue; publicVariable "MaxActiveAI"; _MaxAiTeams = "MaxAiTeams" call BIS_fnc_getParamValue; publicVariable "MaxAiTeams"; _MissionStartTime = "MissionStartTime" call BIS_fnc_getParamValue; publicVariable "MissionStartTime"; _PossibilityAPC = "PossibilityAPC" call BIS_fnc_getParamValue; publicVariable "PossibilityAPC"; _PossibilityHeliTroops = "_PossibilityHeliTroops" call BIS_fnc_getParamValue; publicVariable "_PossibilityHeliTroops"; _TotalSpawned = 0; do you have any solution why helicopter not fly after transport unload? @Harzach I have waypoint a ready where helicopter have to go, but that not fly there why?
  11. Hey all I have a problem or two. How to get all the troops off the helicopter and the loop to work so that it doesn't interfere with other commands. I know where the problem might be, but I need opinions and a solution to the problem. This script will stop as long as the helicopter is completely gone. Here's the whole thing I've done initServer.sqf TeamLeadersClass = [ "CUP_O_RU_Soldier_TL_Ratnik_Autumn", "CUP_O_RU_Soldier_SL_Ratnik_Autumn", "CUP_O_RU_Soldier_TL_VDV", "CUP_O_RU_Soldier_SL_VDV", "CUP_O_RU_Officer_VDV", "CUP_O_RU_Commander_VDV" ]; InfantryClass = [ "CUP_O_RU_Soldier_Lite_Ratnik_Autumn", "CUP_O_RU_Soldier_HAT_Ratnik_Autumn", "CUP_O_RU_Soldier_AT_Ratnik_Autumn", "CUP_O_RU_Soldier_Ratnik_Autumn", "CUP_O_RU_Soldier_Repair_Ratnik_Autumn", "CUP_O_RU_Soldier_LAT_Ratnik_Autumn", "CUP_O_RU_Soldier_Marksman_Ratnik_Autumn", "CUP_O_RU_Soldier_MG_Ratnik_Autumn", "CUP_O_RU_Soldier_GL_Ratnik_Autumn", "CUP_O_RU_Soldier_Exp_Ratnik_Autumn", "CUP_O_RU_Soldier_Engineer_Ratnik_Autumn", "CUP_O_RU_Soldier_Medic_Ratnik_Autumn", "CUP_O_RU_Soldier_AR_Ratnik_Autumn", "CUP_O_RU_Soldier_AHAT_Ratnik_Autumn", "CUP_O_RU_Soldier_AAR_Ratnik_Autumn", "CUP_O_RU_Soldier_A_Ratnik_Autumn", "CUP_O_RU_Soldier_Saiga_VDV", "CUP_O_RU_Soldier_AT_VDV", "CUP_O_RU_Soldier_LAT_VDV", "CUP_O_RU_Soldier_VDV", "CUP_O_RU_Medic_VDV", "CUP_O_RU_Soldier_Marksman_VDV", "CUP_O_RU_Soldier_MG_VDV", "CUP_O_RU_Soldier_GL_VDV", "CUP_O_RU_Explosive_Specialist_VDV", "CUP_O_RU_Engineer_VDV", "CUP_O_RU_Soldier_AR_VDV" ]; LightVehicleClass = [ "CUP_O_UAZ_AGS30_RU", "CUP_O_UAZ_MG_RU", "CUP_O_BMP2_RU", "CUP_O_BMP_HQ_RU", "CUP_O_BMP3_RU", "CUP_O_BRDM2_RUS", "CUP_O_BTR60_RU", "CUP_O_BTR80_CAMO_RU", "CUP_O_BTR80_GREEN_RU", "CUP_O_BTR80A_CAMO_RU", "CUP_O_BTR80A_GREEN_RU", "CUP_O_BTR90_RU", "CUP_O_GAZ_Vodnik_BPPU_RU", "CUP_O_GAZ_Vodnik_KPVT_RU" ]; TransportHeliClass = [ "CUP_O_Mi8_RU", "CUP_O_Mi8_medevac_RU", "CUP_O_Mi8AMT_RU" ]; sleep 10; hintSilent format ["The mission will start after %1 second...... BE READY TO FIGHT!!", _MissionStartTime]; waitUntil {time > _MissionStartTime}; playMusic "CUP_A2PMC_NoMansLand"; sleep 0.9; hint "Mission is started! Good luck soldiers"; sleep 3.5; while {_TotalSpawned < _MaxAiTeams} do { while {count units east <= _MaxActiveAI - 1 && _TotalSpawned < _MaxAiTeams} do { if (_MaxActiveAI - count units east >= 20) then { for "_x" from 0 to 1 do { New_AI_Team = createGroup [east, true]; AI_Team_Spawn_Pos = [Flag_0, 425, 475, 3.5, 0, 1] call BIS_fnc_findSafePos; _Team_Leader = New_AI_Team createUnit [TeamLeadersClass select floor (random count TeamLeadersClass), AI_Team_Spawn_Pos, [], 0, "NONE"]; _Team_Leader setRank "SERGEANT"; _Team_Leader allowFleeing 0; _Team_Leader setSkill (0.65 + random 0.25); _Team_Leader enableAI "AIMINGERROR"; _Team_Leader enableAI "SUPPRESSION"; _Team_Leader disableAI "AUTOTARGET"; _Team_Leader disableAI "MINEDETECTION"; _Team_Leader addEventHandler ["handledamage", { params ["_unit","_part","_dam","_shooter"]; if (_part == "head" && _dam > 0.4 && headgear _unit != "" && local _unit) exitWith { _unit removeEventHandler ["handleDamage", _thisEventHandler]; private _holder = createVehicle ["WeaponHolderSimulated",ASLtoATL eyePos _unit, [], 0, "CAN_COLLIDE"]; { _unit unlinkItem _x; _holder addItemCargoGlobal [_x,1] } forEach [headgear _unit, goggles _unit, hmd _unit]; _holder setVelocity [5 * sin (_shooter getdir _unit), 5 * cos (_shooter getDir _unit), 0.3]; _holder addTorque [random 0.02, random .02, random .02];}}]; _Team_Leader addEventHandler ["Explosion", { params ["_unit", "_damage"]; if (_damage < 0.01) exitWith {}; _unit awake true; _unit awake false; }]; sleep .5; for "_x" from 0 to (2 + (floor random 1 + 1)) do { _New_Soldier = New_AI_Team createUnit [InfantryClass select floor (random count InfantryClass), AI_Team_Spawn_Pos, [], 0 ,"NONE"]; _AI_Random_Rank = selectRandom ["PRIVATE","PRIVATE","PRIVATE","CORPORAL"]; _New_Soldier setRank _AI_Random_Rank; _New_Soldier allowFleeing 0; _New_Soldier setSkill (0.45 + random 0.35); _New_Soldier enableAI "AIMINGERROR"; _New_Soldier enableAI "SUPPRESSION"; _New_Soldier disableAI "AUTOTARGET"; _New_Soldier disableAI "MINEDETECTION"; _New_Soldier addEventHandler ["handledamage", { params ["_unit","_part","_dam","_shooter"]; if (_part == "head" && _dam > 0.4 && headgear _unit != "" && local _unit) exitWith { _unit removeEventHandler ["handleDamage", _thisEventHandler]; private _holder = createVehicle ["WeaponHolderSimulated",ASLtoATL eyePos _unit, [], 0, "CAN_COLLIDE"]; { _unit unlinkItem _x; _holder addItemCargoGlobal [_x,1] } forEach [headgear _unit, goggles _unit, hmd _unit]; _holder setVelocity [5 * sin (_shooter getdir _unit), 5 * cos (_shooter getDir _unit), 0.3]; _holder addTorque [random 0.02, random .02, random .02];}}]; _New_Soldier addEventHandler ["Explosion", { params ["_unit", "_damage"]; if (_damage < 0.01) exitWith {}; _unit awake true; _unit awake false; }]; }; sleep .5; New_AI_Team setBehaviour "AWARE"; // "CARELESS" / "SAFE" / "AWARE" / "COMBAT" / "STEALTH" New_AI_Team setCombatMode "RED"; // "YELLOW" / "RED" New_AI_Team setSpeedMode "NORMAL"; // "UNCHANGED" / "LIMITED" / "NORMAL" / "FULL" _task = round (random 4); switch (_task) do { case 0: {[New_AI_Team, getposATL Flag_0] call BIS_fnc_taskAttack;}; case 1: {[New_AI_Team, getPos Flag_0, 20] call CBA_fnc_taskAttack;}; case 2: {[New_AI_Team, getPos Flag_0] spawn lambs_wp_fnc_taskAssault;}; case 3: {createGuardedPoint [east, Flag_0, -1, objNull]; _wp1 = New_AI_Team addWaypoint [position Flag_0, 10]; _wp2 = New_AI_Team addWaypoint [position Flag_0, 10]; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointBehaviour "AWARE"; _wp2 setWaypointSpeed "NORMAL"; _wp2 setWaypointFormation "NO CHANGE"; _wp2 setWaypointCompletionRadius 10; _wp2 setWaypointType "GUARD";}; default {[New_AI_Team, getposATL Flag_0] call BIS_fnc_taskAttack;}; }; _TotalSpawned = _TotalSpawned + 1; }; sleep 0.5; hintSilent format ["Enemy Team Spawned: %1 / %2", _TotalSpawned, _MaxAiTeams]; }; if (floor random (100) < _PossibilityAPC) then { if (_MaxActiveAI - count units east >= 20) then { _VehicleSpawnPos = [Flag_0, 1050, 1250, 10, 0, 1] call BIS_fnc_findSafePos; _VehicleFindRoad = _VehicleSpawnPos nearRoads 1000; _LV = _VehicleFindRoad select 0; _LVTruePos = [_LV, 10, 15, 5, 0, 1, 0] call BIS_fnc_findSafePos; _APC = [_LVTruePos, random (360), LightVehicleClass select floor (random count LightVehicleClass), east] call BIS_fnc_spawnVehicle; _APCcrew = _APC select 2; _SafeWaypoint = [Flag_0, 15, 100, 3, 0, 1, 0] call BIS_fnc_findSafePos; _WP = _APCcrew addWaypoint [_SafeWaypoint, 450]; _WP1 = _APCcrew addWaypoint [_SafeWaypoint, 20 + random 80]; _WP1 setWaypointType "SAD"; _WP1 setWaypointCombatMode "RED"; _WP1 setWaypointBehaviour "AWARE"; _WP1 setWaypointSpeed "LIMITED"; _WP1 setWaypointFormation "NO CHANGE"; _WP1 setWaypointCompletionRadius 15; _TotalSpawned = _TotalSpawned + 1; }; sleep 0.5; hintSilent format ["Enemy Team Spawned: %1 / %2", _TotalSpawned, _MaxAiTeams]; }; if (floor random (100) < _PossibilityHeliTroops) then { if (_MaxActiveAI - count units east >= 20) then { _DropZone = [Flag_0, 150 + random 450, 500, 20, 0, 1] call BIS_fnc_findSafePos; _Helipad = createVehicle ["Land_HelipadEmpty_F", _DropZone, [], 0, "NONE"]; _Helicopter_Spawn = Flag_0 getPos [4000, random 360]; _Helicopter_Spawn_Altitude = 200; _HelicopterType = selectRandom TransportHeliClass; Heli_Z = createVehicle [_HelicopterType, _Helicopter_Spawn, [], 0, "FLY"]; Heli_Z setPosATL [getPosATL Heli_Z select 0, getPosATL Heli_Z select 1, _Helicopter_Spawn_Altitude]; Heli_Z engineOn true; Heli_Z flyInHeightASL [70, 40, 200]; Heli_Z limitSpeed 150; for "_x" from 1 to 1 do { private "H_Pilot"; H_Pilot_Team = createGroup east; H_Pilot = H_Pilot_Team createUnit ["CUP_O_RU_Pilot", _Helicopter_Spawn, [], 0, "CAN_COLLIDE"]; [H_Pilot] joinSilent H_Pilot_Team; H_Pilot moveInAny Heli_Z; H_Pilot disableAI "TARGET"; H_Pilot disableAI "AUTOCOMBAT"; }; _Transport_WP = H_Pilot_Team addWaypoint [_DropZone, 0]; _Transport_WP setWaypointType "TR UNLOAD"; _Transport_WP setWaypointTimeout [15,20,20]; for "_x" from 1 to 1 do { New_AI_Team = createGroup [east, true]; AI_Team_Spawn_Pos = [Flag_0, 425, 475, 3.5, 0, 1] call BIS_fnc_findSafePos; _Team_Leader = New_AI_Team createUnit [TeamLeadersClass select floor (random count TeamLeadersClass), AI_Team_Spawn_Pos, [], 0, "NONE"]; _Team_Leader setRank "SERGEANT"; _Team_Leader allowFleeing 0; _Team_Leader setSkill (0.65 + random 0.25); _Team_Leader enableAI "AIMINGERROR"; _Team_Leader enableAI "SUPPRESSION"; _Team_Leader disableAI "AUTOTARGET"; _Team_Leader disableAI "MINEDETECTION"; _Team_Leader addEventHandler ["handledamage", { params ["_unit","_part","_dam","_shooter"]; if (_part == "head" && _dam > 0.4 && headgear _unit != "" && local _unit) exitWith { _unit removeEventHandler ["handleDamage", _thisEventHandler]; private _holder = createVehicle ["WeaponHolderSimulated",ASLtoATL eyePos _unit, [], 0, "CAN_COLLIDE"]; { _unit unlinkItem _x; _holder addItemCargoGlobal [_x,1] } forEach [headgear _unit, goggles _unit, hmd _unit]; _holder setVelocity [5 * sin (_shooter getdir _unit), 5 * cos (_shooter getDir _unit), 0.3]; _holder addTorque [random 0.02, random .02, random .02];}}]; _Team_Leader addEventHandler ["Explosion", { params ["_unit", "_damage"]; if (_damage < 0.01) exitWith {}; _unit awake true; _unit awake false; }]; _Team_Leader moveInAny Heli_Z; sleep .5; for "_x" from 0 to (2 + (floor random 3 + 5)) do { _New_Soldier = New_AI_Team createUnit [InfantryClass select floor (random count InfantryClass), AI_Team_Spawn_Pos, [], 0 ,"NONE"]; _AI_Random_Rank = selectRandom ["PRIVATE","PRIVATE","PRIVATE","CORPORAL"]; _New_Soldier setRank _AI_Random_Rank; _New_Soldier allowFleeing 0; _New_Soldier setSkill (0.45 + random 0.35); _New_Soldier enableAI "AIMINGERROR"; _New_Soldier enableAI "SUPPRESSION"; _New_Soldier disableAI "AUTOTARGET"; _New_Soldier disableAI "MINEDETECTION"; _New_Soldier addEventHandler ["handledamage", { params ["_unit","_part","_dam","_shooter"]; if (_part == "head" && _dam > 0.4 && headgear _unit != "" && local _unit) exitWith { _unit removeEventHandler ["handleDamage", _thisEventHandler]; private _holder = createVehicle ["WeaponHolderSimulated",ASLtoATL eyePos _unit, [], 0, "CAN_COLLIDE"]; { _unit unlinkItem _x; _holder addItemCargoGlobal [_x,1] } forEach [headgear _unit, goggles _unit, hmd _unit]; _holder setVelocity [5 * sin (_shooter getdir _unit), 5 * cos (_shooter getDir _unit), 0.3]; _holder addTorque [random 0.02, random .02, random .02];}}]; _New_Soldier addEventHandler ["Explosion", { params ["_unit", "_damage"]; if (_damage < 0.01) exitWith {}; _unit awake true; _unit awake false; }]; _New_Soldier moveInAny Heli_Z; }; sleep .5; New_AI_Team setBehaviour "AWARE"; // "CARELESS" / "SAFE" / "AWARE" / "COMBAT" / "STEALTH" New_AI_Team setCombatMode "RED"; // "YELLOW" / "RED" New_AI_Team setSpeedMode "NORMAL"; // "UNCHANGED" / "LIMITED" / "NORMAL" / "FULL" _task = round (random 4); switch (_task) do { case 0: {[New_AI_Team, getposATL Flag_0] call BIS_fnc_taskAttack;}; case 1: {[New_AI_Team, getPos Flag_0, 20] call CBA_fnc_taskAttack;}; case 2: {[New_AI_Team, getPos Flag_0] spawn lambs_wp_fnc_taskAssault;}; case 3: {createGuardedPoint [east, Flag_0, -1, objNull]; _wp1 = New_AI_Team addWaypoint [position Flag_0, 10]; _wp2 = New_AI_Team addWaypoint [position Flag_0, 10]; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointBehaviour "AWARE"; _wp2 setWaypointSpeed "NORMAL"; _wp2 setWaypointFormation "NO CHANGE"; _wp2 setWaypointCompletionRadius 10; _wp2 setWaypointType "GUARD";}; default {[New_AI_Team, getposATL Flag_0] call BIS_fnc_taskAttack;}; }; sleep .5; _TotalSpawned = _TotalSpawned + 1; }; hintSilent format ["Enemy Team Spawned: %1 / %2", _TotalSpawned, _MaxAiTeams]; waitUntil {{_x in Heli_Z} count units New_AI_Team == 0;}; _randomPos_WP = Heli_Z getpos [4000, random 360]; _Transport_WP_1 = H_Pilot_Team addWaypoint [_randomPos_WP, 0]; _Transport_WP_1 setWaypointType "MOVE"; sleep 40; deleteVehicle Heli_Z; {deleteVehicle _x} forEach units H_Pilot_Team; }; if (_TotalSpawned >= _MaxAiTeams) then { hint "The last enemy team was born. Find and destroy them. No survivors!"; playmusic "CUP_A2PMC_Termination"; waitUntil {{alive _x && (side _x) == east} count allUnits == 0}; sleep 1.8; playSound "Beep"; sleep 1.8; playSound "Beep"; sleep 1.8; playSound "Beep"; sleep 1.8; "END1" call BIS_fnc_endMission; }; }; sleep 5; }; };
  12. Casio91Fin

    Attack direction

    Blacklist area? possible?
  13. Casio91Fin

    Attack direction

    I want the AI to attack from randomly 120-240 directions, but not from 0-119 and 241-359 directions (compass) sometime long ago, someone made a similar script, but it's been a long time and I don't remember where it was, it might have been on Armaholic's website
  14. Hey. How to get attack direction between 120-240 degree angles and get AI attack from those directions and possibly in between I have mostly used the 360 degree method.
  15. Casio91Fin

    Need vehicle group AI for

    true i want to choose random vehicles to AI
×