Forum Jump : FORUMS Editing / Addon editing Editing / Mission editing Editing / Scripting Editing / Addon editing / Armed Assault Editing / Addon editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Addon editing / Arma 3 Editing / Mission editing / Armed Assault Editing / Mission editing / Arma 2 / Arma 2: Operation Arrowhead Editing / Mission editing / Arma 3 Editing / Scripting / Armed Assault Editing / Scripting / Arma 2 / Arma 2: Operation Arrowhead Editing / Scripting / Arma 3 Arma 3 / General Discussion Arma 3 / Troubleshooting Arma 3 / Addons and Mods: Complete Arma 3 / Addons and Mods Arma 3 / Missions: Complete Arma 3 / Missions WIP Arma 3 / Addons and Mods: Complete / Islands Arma 3 / Addons and Mods: Complete / Modules Arma 3 / Addons and Mods: Complete / Sounds Arma 3 / Addons and Mods: Complete / Units Arma 3 / Addons and Mods: Complete / Vehicles Arma 3 / Addons and Mods: Complete / Weapons Arma 3 / Addons and Mods: Complete / Other Arma 3 / Addons and Mods: Complete / Gear Arma 3 / Addons and Mods / Addons and Mods: WIP Arma 3 / Addons and Mods / Addon requests Arma 3 / Missions: Complete / Multiplayer missions Arma 3 / Missions: Complete / Singleplayer missions Operation Arrowhead / General Discussion Operation Arrowhead / Troubleshooting Operation Arrowhead / Addons and Mods: Complete Operation Arrowhead / Addons and Mods Operation Arrowhead / Missions: Complete Operation Arrowhead / Missions WIP Operation Arrowhead / Addons and Mods: Complete / Islands Operation Arrowhead / Addons and Mods: Complete / Modules Operation Arrowhead / Addons and Mods: Complete / Sounds Operation Arrowhead / Addons and Mods: Complete / Units Operation Arrowhead / Addons and Mods: Complete / Vehicles Operation Arrowhead / Addons and Mods: Complete / Weapons Operation Arrowhead / Addons and Mods: Complete / Other Operation Arrowhead / Addons and Mods / Addons and Mods: WIP Operation Arrowhead / Addons and Mods / Addon requests Operation Arrowhead / Missions: Complete / Multiplayer missions Operation Arrowhead / Missions: Complete / Singleplayer missions Arma 2 / General Discussion Arma 2 / Troubleshooting Arma 2 / Addons and Mods: Complete Arma 2 / Addons and Mods Arma 2 / Missions: Complete Arma 2 / Missions WIP Arma 2 / Addons and Mods: Complete / Islands Arma 2 / Addons and Mods: Complete / Modules Arma 2 / Addons and Mods: Complete / Sounds Arma 2 / Addons and Mods: Complete / Units Arma 2 / Addons and Mods: Complete / Vehicles Arma 2 / Addons and Mods: Complete / Weapons Arma 2 / Addons and Mods: Complete / Other Arma 2 / Missions: Complete / Multiplayer missions Arma 2 / Missions: Complete / Singleplayer missions Arma 2 / Addons and Mods / Addon requests Arma 2 / Addons and Mods / Addons and Mods: WIP Armed Assault / General Discussion Armed Assault / Troubleshooting Armed Assault / Addons and Mods: Complete Armed Assault / Addons and Mods: Discussion Armed Assault / Missions: Complete Armed Assault / Missions WIP Armed Assault / Missions: Complete / Multiplayer missions Armed Assault / Missions: Complete / Singleplayer missions Armed Assault / Addons and Mods: Complete / Islands Armed Assault / Addons and Mods: Complete / Modules Armed Assault / Addons and Mods: Complete / Sounds Armed Assault / Addons and Mods: Complete / Units Armed Assault / Addons and Mods: Complete / Vehicles Armed Assault / Addons and Mods: Complete / Weapons Armed Assault / Addons and Mods: Complete / Other Armed Assault / Addons and Mods: Discussion / Addons and Mods: WIP Armed Assault / Addons and Mods: Discussion / Addon requests Advertising / Advertisement Site Related / Armaholic in general Site Related / Armaholic Subscription System Site Related / Armaholic in general / Announcements Offtopic / Chit chat Offtopic / Hardware and software Offtopic / Other Games Offtopic / Other Games / Arma: Cold War Assault / Operation Flashpoint Offtopic / Other Games / Take On Helicopters Offtopic / Other Games / Carrier Command: Gaea Mission Internation Forum / Français Internation Forum / Español Internation Forum / Dutch
Author
Message
Posts: 3
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#1 Posted at 2013-12-02 08:28
I am creating a dynamic survival mission in which I need a random amount of AI infantry and vehicles (around 60-70 units). I want these units to spawn during the game, off a trigger or a script. I want these AI too patrol around a marker or area. I would be grateful in you could recommend any scripts or script packs for me to use.
I've been using the militarize.sqf from the "AI spawn pack" by spunFIN located
here
I've been able to get this script running like a charm in singleplayer and locally hosted servers, but on my clan's dedicated server the AI doesn't spawn. I'm not sure if I'm just not running the script correctly or weather it just doesn't work on a dedicated server.
thanks for any help
Author
Message
Posts: 58
Rank:
Country:
Location: Fairbanks, Alaska
Occupation: Machinest
Age: 37
In-game name: Iceman77
#2 Posted at 2013-12-03 18:06
Try this out.
init.sqf
call compile preProcessFile "grpSpawn.sqf";
grpSpawn.sqf
/* -------------------------------------------------------------------
File: grpSpawn.sqf
Author: Iceman77
Description:
Spawn a random group that patrols an area.
The possible group types are infantry, motorized & mechanized.
Parameters:
_this select 0: <side> >> (EAST,WEST,RESISTANCE)
_this select 1: <string> >> Marker Name (spawn position)
_this select 2: <number> >> Patrol Radius
Usage:
[WEST,"myMarker", 100] call TAG_Grp_Spawn;
[EAST,"mymarker", 150] call TAG_Grp_Spawn;
[RESISTANCE,"mymarker", random 200] call TAG_Grp_Spawn;
------------------------------------------------------------------- */
TAG_Grp_Spawn = {
if (!isServer) exitWith {};
Private ["_grp","_grpType","_sideArray","_grpRandom","_infGrp","_motGrp","_mechGrp"];
_side = _this select 0;
_spawnPos = _this select 1;
_radius = _this select 2;
switch (_side) do {
case WEST : {
_sideArray = ["West", "BLU_F"];
_grpType = ["Infantry", "Motorized", "Mechanized"];
_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;
_grpRandom = [_infGrp, _motGrp, _mechGrp] call BIS_fnc_selectRandom;
};
case EAST : {
_sideArray = ["East", "OPF_F"];
_grpType = ["Infantry", "Motorized_MTP", "Mechanized"];
_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;
_grpRandom = [_infGrp, _motGrp, _mechGrp] call BIS_fnc_selectRandom;
};
case RESISTANCE : {
_sideArray = ["Indep", "IND_F"];
_grpType = ["Infantry", "Motorized", "Mechanized"];
_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;
_grpRandom = [_infGrp, _motGrp, _mechGrp] call BIS_fnc_selectRandom;
};
};
switch (_grpRandom) do {
case _infGrp:{_grp = [getMarkerPos _spawnPos, _side, (configFile >> "CfgGroups" >> (_sideArray select 0) >> (_sideArray select 1) >> (_grpType select 0) >> _grpRandom)] call BIS_fnc_spawnGroup;};
case _motGrp:{_grp = [getMarkerPos _spawnPos, _side, (configFile >> "CfgGroups" >> (_sideArray select 0) >> (_sideArray select 1) >> (_grpType select 1) >> _grpRandom)] call BIS_fnc_spawnGroup;};
case _mechGrp:{_grp = [getMarkerPos _spawnPos, _side, (configFile >> "CfgGroups" >> (_sideArray select 0) >> (_sideArray select 1) >> (_grpType select 2) >> _grpRandom)] call BIS_fnc_spawnGroup;};
};
[_grp, getMarkerPos _spawnPos, _radius] call BIS_fnc_taskPatrol;
};
Added 1 minute later:
Updated it a bit. Simpler to use.
This post was edited by Iceman77 (2013-12-03 23:02, ago)
Author
Message
Posts: 3
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#3 Posted at 2013-12-12 22:26
thanks iceman77 I will test it out on the dedi tonight.
Author
Message
Posts: 3
Rank:
Country:
Location:
Occupation:
Age:
In-game name:
#4 Posted at 2013-12-26 03:34
worked like a charm, wrote this to have it randomly spawn the groups at a marker (aispawn) that teleports around another marker (wp)
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"aispawn", 500] call TAG_Grp_Spawn;
"aispawn" setMarkerPos [(getMarkerPos "wp" select 0)-(random -1000)*sin(random 359),(getMarkerPos "wp" select 1)-(random -1000)*cos(random 359)];
sleep 1;
[EAST,"wp", 100] call TAG_Grp_Spawn;
it spawns 18 groups within a 1000 radius of marker wp. I also edited the grpspawn scripts so that a only 3 mech groups could spawn and only 5 motorised groups.