Prancer 10 Posted April 13, 2011 Hi there this is my first post on this forum but I have searched for an answer before posting but have only found partial bits of the information required. I am currently making an omaha beach style mission (i44 mod) with three groups of infantry within cargo of landing craft. the landing craft takes them to the beach waypoint and in the init codes that, lowers ramp and ejects cargo via eject script, and then moves to nxt waypoint out to sea where ramp is raised whilst the infantry moves up beach. The use of three groups within cargo is because one large group takes too long forming up before moving up beach (even when not in a set formation). My aim is for the three groups to respawn in the cargo of the old, or a new landing craft when every member of all three groups is dead. The respawned infantry will then again be carried to beach and waypoints will be repeated. I have seen some ai respawn scripts which repeat waypoints but have been unable to work out how I can modify them so a number of groups will respawn together in cargo when all dead. I had two ideas of possibly how to do it but lack the scripting now how. 1. Have landing craft in waypoint loop, make it handle damage and have 3 groups respawn in boat 2. Have final waypoint of landing craft delete vehicle and then when and 3 infantry groups and landing craft dead/destroyed respawn landing craft and groups inside it. These are just ideas and don't know whether they would work. Any suggestions/help would be much appreciated prancer. Share this post Link to post Share on other sites
demonized 20 Posted April 14, 2011 save this as repeater.sqf and place in your mission folder. place this in init of 1 member of the group, after you have moved them into the landing craft, make sure to set their waypoints as well. _null = [(group this)] execVM "repeater.sqf" Also note that this asumes that the landingcraft is handledamage (invulnarable) and is on cycle waypoints, 1wp: drive in, deliver. (move or transport unload) 2wp: go back out again, cycle (cycle) wit condition in wp: ({!(_x in (group (driver (vehicle _x))))} count crew (vehicle this)) != 0 this will make boat wait at cycle wp until there are someone in the boat that is not in his group, meaning the new respawned units. // place this in init of 1 member of the group, after you have moved them into the landing craft, make sure to set their waypoints as well. // _null = [(group this)] execVM "repeater.sqf" _grp = _this select 0; _leader = leader _grp; _vehicle = (vehicle _leader); _side = (side _leader); waitUntil {{alive _x} count units _grp) == 0}; // waiting until all units in group is dead. _newGrp = createGroup _side // creating a new usable group. { _typofUnit = typeOf _x; _unit = _newGrp createUnit [_typofUnit, [0,0,500], [], 0, "NONE"]; // creating a unit same as other unit. _unit assignAsCargo _vehicle; _unit moveInCargo _vehicle; // here we move the new unit into same vehicle used. } foreach units _grp; // create a unit, same as the dead unit for each of the dead units and move it into the landingcraft.. _newGrp copyWaypoints _grp; // here we will collect all the waypoints and add them to the new group. _newGrp setCurrentWaypoint [_newGrp, 1]; _null = [_newGrp] execVM "repeater.sqf"; // here we run the script again on next squad and it will repeat same way. deleteGroup _grp; // here we delete the old group prefix so its not cluttering up or creating issues with max amount 144 groups total limitations, note dead units will not be deleted, only the group prefix. everything is untested, but should work, only new command i used is the copyWaypoints wich ive never noticed before. And if it doesnt work, you atleast have some idea of how to get it done. You can also create a new vehicle as well after the waituntil line and get the waypoints from the previous vehicle same way group gets. Share this post Link to post Share on other sites
Prancer 10 Posted April 15, 2011 Thanks, I will give it a go and report back. Share this post Link to post Share on other sites