不离不弃这闪点 不离不弃这闪点
关注数: 29 粉丝数: 84 发帖数: 2,422 关注贴吧数: 106
一个随机点产生随机类型运输机与随机类型小队的空降脚本 openMap false; // _randomPosMap = ["biaoji", "jihao", "weizhi"] call BIS_fnc_randomPos; _spawnpos= getPos t; _spawnair=[ "B_Heli_Transport_03_F", "B_T_VtoL_01_infantry_F"]call BIS_fnc_selectRandom; // _side=[west, east, resistance ]call BIS_fnc_selectRandom; _sideArray = [west, "west", "BLU_F"]; _grptype = ["infantry", "Motorized", "Mechanized", "Support", "Armored"]; _infGrp = [ "BUS_DiverTeam", "BUS_infSquad", "BUS_infTeam_AA", "BUS_infTeam_AT", "BUS_Support_EOD"] call BIS_fnc_selectRandom; _motgrp = ["BUS_Motinf_AA", "BUS_Motinf_AT", "BUS_Motinf_GMGTeam", "BUS_Motinf_MGTeam", "BUS_Motinf_MortTeam", "BUS_Motinf_Team"] call BIS_fnc_selectRandom; _mechGrp = ["BUS_Mechinf_AA", "BUS_Mechinf_AT", "BUS_Mechinf_Support", "BUS_MechinfSquad"] call BIS_fnc_selectRandom; _specGrp = ["BUS_Recon_EOD", "BUS_Support_CLS", "BUS_Support_ENG", "BUS_Support_EOD", "BUS_Support_GMG", "BUS_Support_MG", "BUS_Support_Mort"] call BIS_fnc_selectRandom; _armGrp =["BUS_tankPlatoon", "BUS_tankPlatoon_AA", "BUS_tankSection", "BUS_SPGPlatoon_Scorcher", "BUS_SPGSection_Scorcher", "BUS_SPGSection_MLRS", "B_tankDestrSection_Rhino", "B_tankDestrSection_RhinoUP"]call BIS_fnc_selectRandom; // _grprandom = [_infGrp, _motgrp, _mechGrp, _specGrp, _armGrp ] call BIS_fnc_selectRandom; _units = [ _spawnpos, (_sideArray select 0), (configFile >> "Cfggroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grptype select 0) >> _infGrp)] call BIS_fnc_spawngroup; _units_1 = [ _spawnpos, (_sideArray select 0), (configFile >> "Cfggroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grptype select 0) >> _infGrp)] call BIS_fnc_spawngroup; _units_2 = [ _spawnpos, (_sideArray select 0), (configFile >> "Cfggroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grptype select 0) >> _infGrp)] call BIS_fnc_spawngroup; _units_3 = [ _spawnpos, (_sideArray select 0), (configFile >> "Cfggroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grptype select 0) >> _infGrp)] call BIS_fnc_spawngroup; sleep 5; _veh = createvehicle [_spawnair, _spawnpos, [], 0, "none"]; sleep 8; { { _x assignAsCargo _veh; }forEach (units _x); (units _x) orderGetIn true; }forEach [_units, _units_1, _units_2, _units_3]; _driver = createvehiclecrew _veh; _grp= group _veh; waitUntil { { _x in _veh }count((units _units)+(units _units_1)+(units _units_2)+(units _units_3))==count((units _units)+(units _units_1)+(units _units_2)+(units _units_3)) }; _wp1=_grp addWaypoint[position player, 0, 1]; _wp1 setwaypointType"move"; _wp1 setwaypointSpeed"full"; _veh flyinHeight 300; waitUntil{ _veh distance2D player < 200 }; { if ((assignedvehicleRole _x)select 0 == "cargo") then { removeBackpack _x; _x addbackpack "B_Parachute"; [_x]orderGetIn false; [_x]allowGetin false; moveOut _x; sleep 0.2; }; sleep 0.2; }forEach (crew _veh);
自己写了一个随机阵营与随机小队类别的刷兵脚本没效果 脚本如下【if (!isServer) exitWith {};randomspawngrp = {_spawnPos = this select 0; _len = round (random 1800) ;_dir = round (random 360) ; _tarpos=[(_spawnpos select 0)-(_len*sin(_dir)), (_spawnpos select 1)-(_len*cos(_dir))]; Private ["_grp","_grpType","_sideArray","_grpRandom","_infGrp","_motGrp","_mechGrp","_specGrp","_color"]; _side=[WEST, EAST,RESISTANCE ]call BIS_fnc_selectRandom; switch (_side) do { case WEST : { _sideArray = [WEST, "West", "BLU_F"]; _grpType = ["Infantry", "Motorized", "Mechanized", "Support", "Armored"]; _infGrp = ["BUS_InfSentry","BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AA","BUS_InfTeam_AT","BUS_ReconPatrol","BUS_ReconSentry","BUS_ReconTeam","BUS_SniperTeam"] call BIS_fnc_selectRandom; _motGrp = ["BUS_MotInf_AA","BUS_MotInf_AT","BUS_MotInf_GMGTeam","BUS_MotInf_MGTeam","BUS_MotInf_MortTeam","BUS_MotInf_Team"] call BIS_fnc_selectRandom; _mechGrp = ["BUS_MechInf_AA","BUS_MechInf_AT","BUS_MechInf_Support","BUS_MechInfSquad"] call BIS_fnc_selectRandom; _specGrp = ["BUS_Recon_EOD","BUS_Support_CLS","BUS_Support_ENG","BUS_Support_EOD","BUS_Support_GMG","BUS_Support_MG","BUS_Support_Mort"] call BIS_fnc_selectRandom; _grpRandom = [_infGrp, _motGrp, _mechGrp, _specGrp] call BIS_fnc_selectRandom; }; case EAST : { _sideArray = [EAST, "East", "OPF_F"]; _grpType = ["Infantry", "Motorized_MTP", "Mechanized", "Support", "Armored"]; _infGrp = ["OI_reconPatrol","OI_reconSentry","OI_reconTeam","OIA_InfSentry","OIA_InfSquad","OIA_InfSquad_Weapons","OIA_InfTeam","OIA_InfTeam_AA","OIA_InfTeam_AT","OI_SniperTeam"] call BIS_fnc_selectRandom; _motGrp = ["OIA_MotInf_AA","OIA_MotInf_AT","OIA_MotInf_GMGTeam","OIA_MotInf_MGTeam","OIA_MotInf_MortTeam","OIA_MotInf_Team"] call BIS_fnc_selectRandom; _mechGrp = ["OIA_MechInf_AA","OIA_MechInf_AT","OIA_MechInf_Support","OIA_MechInfSquad"] call BIS_fnc_selectRandom; _specGrp = ["OI_recon_EOD","OI_support_CLS","OI_support_ENG","OI_support_EOD","OI_support_GMG","OI_support_MG","OI_support_Mort"] call BIS_fnc_selectRandom; _grpRandom = [_infGrp, _motGrp, _mechGrp, _specGrp] call BIS_fnc_selectRandom; }; case RESISTANCE : { _sideArray = [RESISTANCE, "Indep", "IND_F"]; _grpType = ["Infantry", "Motorized", "Mechanized", "Support"]; _infGrp = ["HAF_InfSentry","HAF_InfSquad","HAF_InfSquad_Weapons","HAF_InfTeam","HAF_InfTeam_AA","HAF_InfTeam_AT","HAF_SniperTeam"] call BIS_fnc_selectRandom; _motGrp = ["HAF_MotInf_AA","HAF_MotInf_AT","HAF_MotInf_GMGTeam","HAF_MotInf_MGTeam","HAF_MotInf_MortTeam","HAF_MotInf_Team"] call BIS_fnc_selectRandom; _mechGrp = ["HAF_MechInf_AA","HAF_MechInf_AT","HAF_MechInf_Support","HAF_MechInfSquad"] call BIS_fnc_selectRandom; _specGrp = ["HAF_support_CLS","HAF_support_ENG","HAF_support_EOD","HAF_support_GMG","HAF_support_MG","HAF_support_Mort"] call BIS_fnc_selectRandom; _grpRandom = [_infGrp, _motGrp, _mechGrp, _specGrp] call BIS_fnc_selectRandom; }; }; switch (_grpRandom) do { case _infGrp:{_grp = [getMarkerPos _tarpos, (_sideArray select 0), (configFile >> "CfgGroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grpType select 0) >> _grpRandom)] call BIS_fnc_spawnGroup;}; case _motGrp:{_grp = [getMarkerPos _tarpos, (_sideArray select 0), (configFile >> "CfgGroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grpType select 1) >> _grpRandom)] call BIS_fnc_spawnGroup;}; case _mechGrp:{_grp = [getMarkerPos _tarpos, (_sideArray select 0), (configFile >> "CfgGroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grpType select 2) >> _grpRandom)] call BIS_fnc_spawnGroup;}; case _specGrp:{_grp = [getMarkerPos _tarpos, (_sideArray select 0), (configFile >> "CfgGroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grpType select 3) >> _grpRandom)] call BIS_fnc_spawnGroup;}; case _armGrp:{_grp = [getMarkerPos _tarpos, (_sideArray select 0), (configFile >> "CfgGroups" >> (_sideArray select 1) >> (_sideArray select 2) >> (_grpType select 4) >> _grpRandom)] call BIS_fnc_spawnGroup;}; }; //_infWp = _grp addWaypoint [getMarkerPos _movePos, 0]; _infWp = _grp addWaypoint [position player, 0]; _infWp setWaypointType "SAD"; _infWp setWaypointBehaviour "AWARE"; _infWp setWaypointCombatMode "RED"; _infWp setWaypointSpeed "FULL"; };if (alive player) then { call randomspawngrp; };】请问吧里的脚本大神指点一下到底哪里的逻辑出错了?
整了几个自定义脚本,大伙有兴趣的看看 AIRSUPPORT.SQF【 openmap true; click =0; ["airappui","onmapsingleclick",{ helipad = "Land_HelipadEmpty_F"createvehicle _pos; click =1; ["airappui","onmapsingleclick"] call BIS_fnc_removestackedeventhandler; }] call BIS_fnc_addstackedeventhandler; waituntil {click ==1}; openmap false; _angle = random 360; _bombepos = getpos helipad; _spawnpos = [(_bombepos select 0)-(2000*sin(_angle)),(_bombepos select 1)-(2000*cos(_angle))]; _plane = [_spawnpos, _spawnpos getdir _bombepos, "pook_tu95_OPFOR", Independent] call bis_fnc_spawnvehicle; _planebody = _plane select 0; [_planebody, ["CamoGrey",1],true] call BIS_fnc_initVehicle; _planegrp = _plane select 2; _planebody flyinheight 150; _planebody setcaptive true; {_x disableAI "autocombat"} foreach units _planegrp; _plane domove _bombepos; sleep 3; _spawnpos = [(_bombepos select 0)-(2000*sin(_angle)),(_bombepos select 1)-(2000*cos(_angle))]; _plane = [_spawnpos, _spawnpos getdir _bombepos, "pook_tu95_OPFOR", Independent] call bis_fnc_spawnvehicle; _planebody = _plane select 0; [_planebody, ["CamoGrey",1],true] call BIS_fnc_initVehicle; _planegrp = _plane select 2; _planebody flyinheight 150; _planebody setcaptive true; {_x disableAI "autocombat"} foreach units _planegrp; _plane domove _bombepos; sleep 3; _spawnpos = [(_bombepos select 0)-(2000*sin(_angle)),(_bombepos select 1)-(2000*cos(_angle))]; _plane = [_spawnpos, _spawnpos getdir _bombepos, "I_Plane_Fighter_04_F", Independent] call bis_fnc_spawnvehicle; _planebody = _plane select 0; [_planebody, ["CamoGrey",1],true] call BIS_fnc_initVehicle; _planegrp = _plane select 2; _planebody flyinheight 150; _planebody setcaptive true; {_x disableAI "autocombat"} foreach units _planegrp; _plane domove _bombepos; sleep 3; _spawnpos = [(_bombepos select 0)-(2000*sin(_angle)),(_bombepos select 1)-(2000*cos(_angle))]; _plane = [_spawnpos, _spawnpos getdir _bombepos, "I_Plane_Fighter_04_F", Independent] call bis_fnc_spawnvehicle; _planebody = _plane select 0; [_planebody, ["CamoGrey",1],true] call BIS_fnc_initVehicle; _planegrp = _plane select 2; _planebody flyinheight 150; _planebody setcaptive true; {_x disableAI "autocombat"} foreach units _planegrp; _plane domove _bombepos; sleep 6; _area = 150; _height = 100; _ord =["Bo_GBU12_LGB", "Bo_Mk82","Bo_FAB_250"]call BIS_fnc_selectRandom; //_ord ="Sh_105_HE"; _need = 10; _countb = 0; if ((_bombepos select 0) + (_bombepos select 1) + (_bombepos select 2) > 0) then { titletext [Format["%1", _bombepos],"PLAIN down"]; hint "接收到座标"; sleep 3+random 5; while {_countb<_need} do{ _bomb = _ord createVehicle [(_bombepos select 0) - random _area + random _area, (_bombepos select 1) - random _area + random _area, (_bombepos select 2) + random _height]; sleep random 5; _bomb = _ord createVehicle [(_bombepos select 0) - random _area + random _area, (_bombepos select 1) - random _area + random _area, (_bombepos select 2) + random _height]; _countb = _countb +2; sleep random 7; }; }; //"Bo_GBU12_LGB" createvehicle _bombepos; sleep 26; {deletevehicle _x} foreach units _planegrp; deletevehicle _planebody; deletevehicle helipad; 】 jieshong.sqf【 openmap true; titletext["请发送你所在的位置", "PLAIN"]; click =0; ["helisupport","onmapsingleclick",{ helipos = "Land_HelipadEmpty_F"createvehicle _pos; click =1; ["helisupport","onmapsingleclick"] call BIS_fnc_removestackedeventhandler; }] call BIS_fnc_addstackedeventhandler; waituntil {click ==1}; openmap false; _jiaodu = player getdir helipos; _helispawnpos = [(getpos helipos select 0)-(2000*sin(_jiaodu)),(getpos helipos select 1)-(2000*cos(_jiaodu))]; _heli2 = [_helispawnpos, _jiaodu, "B_Heli_Transport_01_F", west] call bis_fnc_spawnvehicle; _helibody = _heli2 select 0; _heliunits = _heli2 select 1; _heligrp = _heli2 select 2; {_x disableAI "AUTOCOMBAT"} foreach units _heligrp; _heligrp addwaypoint [ getpos helipos,0]; waituntil {_helibody distance2d helipos <= 100}; _heligrp addwaypoint [getpos helipos,0,0]; _helibody land "get in"; waituntil {{_x in _helibody} count (units group player) == count (units group player)}; deletevehicle helipos; sleep 3; openmap true; cuttext["请在地图上标注你即将要去的位置","PLAIN"]; click =0; ["nextwp","onmapsingleclick",{ nextpos="Land_HelipadEmpty_F"createvehicle _pos; click =1; ["nextwp","onmapsingleclick"] call BIS_fnc_removestackedeventhandler; }] call BIS_fnc_addstackedeventhandler; waituntil {click ==1}; openmap false; _pos_1 = position nextpos; _heligrp addwaypoint [getpos nextpos,0]; waituntil {_helibody distance2d nextpos <= 100}; _heligrp addwaypoint [getpos nextpos,0,0]; _helibody land "land"; hintsilent str format["%1", nextpos]; sleep 100; {deletevehicle _x} foreach crew _helibody; deletevehicle _helibody; //sleep 90; //_helibody animatedoor["door_1_source", 0]; //_helibody animatedoor["door_1_source", 1]; //waituntil{ // _helibody distance2d player < 2 //}; //sleep 2; //{ //{ //_x assignAsCargo _helibody ; // }forEach ( units _x); // (units _x) orderGetIn true; //}forEach [q1,q2]; //waituntil {{_x in _h2body} count ((units q1) + (units q2)+ [player])== count((units q1) +(units q2) +[player])}; 】 init.sqf【 enableSaving [false, false]; waitUntil {!isNull player}; onMapSingleClick "if (_alt) then {player setPosATL _pos}"; createCenter east; createCenter west; player addaction [("<t color=""#995599"">" + "spawnAI" + "</t>"), "spawn.sqf", ["O_Soldier_F", false, true, true], 0, false, false]; player addaction [("<t color=""#CCAA44"">" + "showGPS" + "</t>"), "showGPS.sqf"]; player addaction [("<t color=""#CCAA44"">" + "jiguangzisi" + "</t>"), "jiguangzisi.sqf"]; player addaction [("<t color=""#BBBBBB"">" + "Clickmapfire" + "</t>"), "Clickmapfire.sqf"]; player addaction [("<t color=""#BBBBBB"">" + "clickmap" + "</t>"), "clickmapspawn.sqf"]; player addaction [("<t color=""#559999"">" + "RTB" + "</t>"), "jieshong.sqf", "B_Heli_Transport_01_F", 1.5, true, true, "", "true", 3 ]; player addaction [("<t color=""#559999"">" + "CSAT" + "</t>"), "airsupport.sqf", [], 1.5, true, true, "", "true", 3 ]; //player addaction [("<t color=""#559999"">" + "RTB" + "</t>"), "jieshong.sqf", "B_Heli_Transport_01_F", 1.5, true, true, "", "true", 3 ]; 】
玩家光标处或激光点生成敌方或己方班组脚本 init.sqf【{ enableSaving [false, false]; waitUntil {!isNull player}; onMapSingleClick "if (_alt) then {player setPosATL _pos}"; createCenter east; createCenter west; player addaction [("<t color=""#995599"">" + "spawnAI" + "</t>"), "spawn.sqf", ["O_Soldier_F", false, true, true], 0, false, false]; player addaction [("<t color=""#CCAA44"">" + "showGPS" + "</t>"), "showGPS.sqf"]; player addaction [("<t color=""#BBBBBB"">" + "clickmap" + "</t>"), "clickmapspawn.sqf"]; //player addaction [("<t color=""#559999"">" + "addmenu" + "</t>"), "open.sqf"]; }】,,,,,,spawn.sqf【 private ["_arguments", "_targetClass", "_targetRandomDir", "_targetPatrolling"]; _arguments = _this select 3; _targetClass = _arguments select 0; _targetAnimated = _arguments select 1; _targetRandomDir = _arguments select 2; _targetPatrolling = _arguments select 3; //_unit = _this #4; private ["_group", "_position", "_vecToTarget", "_direction"]; _position = screenToWorld [0.5,0.5]; //_position = getpos lasertarget player; if (_targetRandomDir) then { _direction = random 360; } else { _vecToTarget = [getPosATL player, _position] call BIS_fnc_vectorDiff; _direction = (_vecToTarget call CBA_fnc_vectDir) + 90; }; _group = createGroup east; [_position, east, configfile >> 'CfgGroups' >> 'East' >> 'OPF_F' >> 'Mechanized' >> 'OIA_MechInfSquad'] call BIS_fnc_spawnGroup; //[_position, east, ["TK_INS_Bonesetter_EP1", "TK_INS_Bonesetter_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; //"cup_b_us_sniper_m107_ucp" createunit [[_position select 0, _position select 1, 0.0], _group]; //[_position, east, 12] call BIS_fnc_spawnGroup; if (_targetPatrolling) then { _group addWaypoint [[(_position select 0) + sin(_direction) * 60, (_position select 1) + cos(_direction) * 60, 0.0], 0]; [_group, 1] setWaypointType "MOVE"; _group addWaypoint [[(_position select 0) - sin(_direction) * 60, (_position select 1) - cos(_direction) * 60, 0.0], 0]; [_group, 2] setWaypointType "MOVE"; _group addWaypoint [[(_position select 0) + sin(_direction) * 60, (_position select 1) + cos(_direction) * 60, 0.0], 0]; [_group, 3] setWaypointType "CYCLE"; {[_group, _x] setWaypointSpeed "LIMITED";} forEach [1, 2, 3]; }; //_veh = "B_Truck_01_transport_F" createVehicle position "_position"; //_grp = createVehicleCrew _veh; //_unit = _grp createUnit [typeOf driver _veh, _grp, [], 0, "CARGO"]; //_veh setVelocity [0,0,0]; //[_unit,_veh] domove getpos player; //waituntil{_unit distance player<10}; //[_grp,_unit,_veh]join player; //_group move position player; // _wp1 = _group addWaypoint [player, 0]; 】,,,,showgps.sqf【 //右上角显示玩家坐标,或者当玩家装备镭射指示器时候共同显示镭射坐标和玩家坐标; _u1 = _this select 0; while{true}do { _designatedPos = mapGridPosition getPosATL (laserTarget _u1 ); _gridPos = mapGridPosition getPos _u1; _mystr1 = ["当前激光照射点的座标是", _designatedPos]; _mystr2 = ["你当前的座标是", _gridPos]; _mystr3 = getpos laserTarget _u1 ; if((mapGridPosition getPosATL (laserTarget _u1)) == "000000")then { hintsilent format ["%1",_mystr2]; }else { hintsilent str format ["%1\n%2\n目标点到你身边的距离为%3",_mystr1,_mystr2, _mystr3 distance2d _u1 ]; }; }; //_q1 = getpos (_this select 0); //_x = (_designatedPos select 0) - (_u1 select 0); //_y = (_designatedPos select 1) - (_u1 select 1); //_lens = (_x*2)+(_y*2); //_len = sqrt(_lens); // //cutText [format["%1" , player distance _mystr3],"PLAIN down",0.008]; 】
1 下一页