falconx1 13 Posted July 15, 2013 (edited) I'm trying to make a AI group get in this vehicle "O_MRAP_02_hmg_F" (full vehicle crewmen) commander gunner driver etc. and additionally i want a group of 4 AI infantry to be assigned into the vehicles group and have them move in formation with the vehicle these are the 4 guys i wanted to use these four would be on fooot the rest would be crewman in the vehicle to operate it: O_Soldier_F O_Soldier_GL_F O_Soldier_AR_F O_soldier_M_F. heres what i have left after a ton of fails _grp1 = "O_MRAP_02_hmg_F" createVehicle getMarkerPos RandomDirection; _grp2 = "O_crew_F" createVehicle getMarkerPos RandomDirection; _grp2 assignasdriver O_MRAP_02_hmg_F ; [_grp2] orderGetIn true ; _grp1 allowFleeing 0; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; Edited July 15, 2013 by falconx1 Share this post Link to post Share on other sites
Jezuro 452 Posted July 15, 2013 _grp = [markerPos "yourMarker", EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F", "O_soldier_M_F"]] call BIS_fnc_spawnGroup; _veh = [markerPos "yourMarker", 0, "O_MRAP_02_hmg_F", _grp] call BIS_fnc_spawnVehicle; _grp selectLeader effectiveCommander (_veh select 0); { _x allowFleeing 0} forEach units _grp; _wp0 = _grp addWaypoint [markerPos "yourMarker2", 0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; Share this post Link to post Share on other sites
falconx1 13 Posted July 15, 2013 (edited) how can i set the whole groups skill seems like multiplayer the skill dont take effect is this right?? _grp = [markerPos "yourMarker", EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F", "O_soldier_M_F"]] call BIS_fnc_spawnGroup; _veh = [markerPos "yourMarker", 0, "O_MRAP_02_hmg_F", _grp] call BIS_fnc_spawnVehicle; _grp selectLeader effectiveCommander (_veh select 0); [color="#FF0000"]grpname = _this select 0; _grpleader = leader _grpname; _grpleader setskill 0.25;[/color]??? { _x allowFleeing 0} forEach units _grp; _wp0 = _grp addWaypoint [markerPos "yourMarker2", 0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; Edited July 15, 2013 by falconx1 Share this post Link to post Share on other sites
Jezuro 452 Posted July 15, 2013 how can i set the whole groups skill Just replace the first line with this: _grp = [markerPos "yourMarker", EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F", "O_soldier_M_F"], [], [], [0.25, 0.75]] call BIS_fnc_spawnGroup; The last two numbers is the group's skill range, so in this case 0.25 to 0.75. Share this post Link to post Share on other sites
falconx1 13 Posted July 15, 2013 thanks very helpful , gonna try this now:xd Share this post Link to post Share on other sites
HatchetJesus 1 Posted July 15, 2013 (edited) I placed a trigger which spawned a group with taskAttack. When the trigger activated the frames dropped to below 5 for all 30 guys that was on the server. Is there a function that's more optimized for big multiplayer sessions? Since the trigger didnt drop a single frame when I tried it in the editor... grp = [getMarkerPos ""spawnpoint4"", opfor, [""O_Soldier_F"",""O_Soldier_F"",""O_Soldier_F""""O_Soldier_F"",""O_Soldier_F"",""O_Soldier_F"",""O_Soldier_F""]] call BIS_fnc_spawnGroup; null = [grp, (getmarkerpos ""Mike4"")] call BIS_fnc_taskAttack; That's what was used Edited July 15, 2013 by HatchetJesus Added code Share this post Link to post Share on other sites
kylania 568 Posted July 15, 2013 I placed a trigger which spawned a group with taskAttack. When the trigger activated the frames dropped to below 5 for all 30 guys that was on the server. ... Since the trigger didnt drop a single frame when I tried it in the editor.. The problem is you used a trigger on the map, which means that when it tripped it tripped for all 30 guys on the server and the server itself. So instead of spawning 7 AI as a group it spawned 31 groups of 7 AI at the same time. The way around this is to either add a && isServer to the trigger condition or have the trigger run a function or script that spawns the AI and has an isServer check that only executes the code once. Share this post Link to post Share on other sites
Jezuro 452 Posted July 15, 2013 Triggers are activated for all players on the server separately, which means that you probably spawned 7 * 30 = 210 units at once. That usually hurts the framerate quite a bit. *edit: What?! Ninja'd again!!! Share this post Link to post Share on other sites
HatchetJesus 1 Posted July 15, 2013 Oh haha! damn, didn't know that. so you're saying all I have to do is to have the condition of the trigger be "this && isServer" and I should be good? Share this post Link to post Share on other sites
kylania 568 Posted July 15, 2013 That way the trigger will only trip for the server and run once. Share this post Link to post Share on other sites
HatchetJesus 1 Posted July 15, 2013 Cheers, very helpful Share this post Link to post Share on other sites