GDICommand
Dec 19 2010, 00:27
So I'm trying to create a flashy ending to my mission, so this isn't entirely necessary, but regardless, for missions that I've done in the past where it was necessary, I ran into this same problem.
So the idea is to create a vehicle at some point after the mission was started. So I create the vehicle, create the crew and put them in the vehicle, then I start adding waypoints to it based on certain markers positions. The vehicle is some sort of troop transport (i.e. hmmwv, aav, 7ton, etc). I set up a waypoint for the transport that is of type "TR UNLOAD", and the waypoint for the passengers are "GETOUT". The problem with this is that the passengers never "reach" the waypoint. If I don't sync the waypoints together, the vehicle goes through the waypoint and onto the next in it's list. If I do sync them together, the transport sits there indefinitely waiting for the passengers to get out. The problem seems to lie with the passengers not knowing that they're at the waypoint.
I seemed to hack my way around this one, but I'm kind of looking for a more effective solution. This is what I have though (note I didn't sync the waypoints):
aav1 = createVehicle ["AAV", getMarkerPos "reinforcementSpawn2", [], 10, "FORM"];
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements, "aavDriver1 = this;", 0.6, "corporal"];
aavDriver1 moveInDriver aav1;
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements,"aavCommander1 = this;", 0.6, "corporal"];
aavCommander1 moveInCommander aav1;
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements,"aavGunner1 = this;", 0.6, "corporal"];
aavGunner1 moveInGunner aav1;
aavReinforcements setFormation "COLUMN";
aavWaypoint1 = aavReinforcements addWaypoint [getMarkerPos "townCenter", 0];
aavWaypoint1 setWaypointSpeed "FULL";
aavWaypoint1 setWaypointType "TR UNLOAD";
aavWaypoint1 setWaypointStatements ["true", "doGetOut units reinforcementSquad1; reinforcementSquad1 setCurrentWaypoint [reinforcementSquad1, 1];{unassignVehicle _x} forEach units reinforcementSquad1;"];
aavWaypoint2 = aavReinforcements addWaypoint [getMarkerPos "waypoint2", 0];
"USMC_Soldier" createUnit [position player, reinforcementSquad1, "squad1_1 = this;", 0.6, "corporal"];
squad1_1 moveInCargo aav1;
"USMC_Soldier" createUnit [position player, reinforcementSquad1, "squad1_2 = this;", 0.6, "corporal"];
squad1_2 moveInCargo aav1;
squad1wp1 = reinforcementSquad1 addWaypoint [getMarkerPos "townCenter", 0];
squad1wp1 setWaypointType "GETOUT";
squad1wp1 setWaypointCompletionRadius 30;
squad1wp1 synchronizeWaypoint [aavWaypoint1];
squad1wp2 = reinforcementSquad1 addWaypoint [getMarkerPos "waypoint2", 10];
//just here so I can view it first hand, wouldn't be there in production code
selectPlayer squad1_2;
So basically the code that's important is:
aavWaypoint1 setWaypointStatements ["true", "doGetOut units
reinforcementSquad1; reinforcementSquad1 setCurrentWaypoint
[reinforcementSquad1, 1];{unassignVehicle _x} forEach units
reinforcementSquad1;"];
the rest of it is just esthetics, just to make it look nice as far as waypoints on the map if you were personally in the squad that you were creating after the mission start, so that way it still shows on the map "Get Out"
I'm looking for a way that I won't have to hack this together next time...anybody know something I don't? I tried searching, but came up with a bunch of stuff that's unrelated.
So the idea is to create a vehicle at some point after the mission was started. So I create the vehicle, create the crew and put them in the vehicle, then I start adding waypoints to it based on certain markers positions. The vehicle is some sort of troop transport (i.e. hmmwv, aav, 7ton, etc). I set up a waypoint for the transport that is of type "TR UNLOAD", and the waypoint for the passengers are "GETOUT". The problem with this is that the passengers never "reach" the waypoint. If I don't sync the waypoints together, the vehicle goes through the waypoint and onto the next in it's list. If I do sync them together, the transport sits there indefinitely waiting for the passengers to get out. The problem seems to lie with the passengers not knowing that they're at the waypoint.
I seemed to hack my way around this one, but I'm kind of looking for a more effective solution. This is what I have though (note I didn't sync the waypoints):
aav1 = createVehicle ["AAV", getMarkerPos "reinforcementSpawn2", [], 10, "FORM"];
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements, "aavDriver1 = this;", 0.6, "corporal"];
aavDriver1 moveInDriver aav1;
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements,"aavCommander1 = this;", 0.6, "corporal"];
aavCommander1 moveInCommander aav1;
"USMC_Soldier_Crew" createUnit [position player, aavReinforcements,"aavGunner1 = this;", 0.6, "corporal"];
aavGunner1 moveInGunner aav1;
aavReinforcements setFormation "COLUMN";
aavWaypoint1 = aavReinforcements addWaypoint [getMarkerPos "townCenter", 0];
aavWaypoint1 setWaypointSpeed "FULL";
aavWaypoint1 setWaypointType "TR UNLOAD";
aavWaypoint1 setWaypointStatements ["true", "doGetOut units reinforcementSquad1; reinforcementSquad1 setCurrentWaypoint [reinforcementSquad1, 1];{unassignVehicle _x} forEach units reinforcementSquad1;"];
aavWaypoint2 = aavReinforcements addWaypoint [getMarkerPos "waypoint2", 0];
"USMC_Soldier" createUnit [position player, reinforcementSquad1, "squad1_1 = this;", 0.6, "corporal"];
squad1_1 moveInCargo aav1;
"USMC_Soldier" createUnit [position player, reinforcementSquad1, "squad1_2 = this;", 0.6, "corporal"];
squad1_2 moveInCargo aav1;
squad1wp1 = reinforcementSquad1 addWaypoint [getMarkerPos "townCenter", 0];
squad1wp1 setWaypointType "GETOUT";
squad1wp1 setWaypointCompletionRadius 30;
squad1wp1 synchronizeWaypoint [aavWaypoint1];
squad1wp2 = reinforcementSquad1 addWaypoint [getMarkerPos "waypoint2", 10];
//just here so I can view it first hand, wouldn't be there in production code
selectPlayer squad1_2;
So basically the code that's important is:
aavWaypoint1 setWaypointStatements ["true", "doGetOut units
reinforcementSquad1; reinforcementSquad1 setCurrentWaypoint
[reinforcementSquad1, 1];{unassignVehicle _x} forEach units
reinforcementSquad1;"];
the rest of it is just esthetics, just to make it look nice as far as waypoints on the map if you were personally in the squad that you were creating after the mission start, so that way it still shows on the map "Get Out"
I'm looking for a way that I won't have to hack this together next time...anybody know something I don't? I tried searching, but came up with a bunch of stuff that's unrelated.