Greets,
I have done a very similar surrender script for NCPD. The player selects an action in his action menu, and shouts out one of several random phrases (like "Freeze! Armed Police! Put your hands above your head and throw you're weapons on the ground! Do it now!"). Then the enemy puts his weapon on the ground, and performs the surrender anim seen in the OFP credits (where the pilot stands up slowly with his hands above his head, and then puts them behind his head - "FXStandSur...something..."). Each enemy is given a 'courage factor' which determines their resistance to surrender. (E.G. some enemies will always surrender as soon as you yell at them, some will never surrender). As soon as they have dropped their weapon, they are placed into captive status (setCaptive true). If you kill them, the "FX StandSurDead" anim is played.
When the player calls for Radio Alpha, a truck turns up. The hostiles move to the truck and get in.
This is accomplished thus: Truck has two waypoints. One MOVE directly in front of his starting position. One MOVE near where the captives will be. The first wp is synchronised to the Radio Alpha Trigger, so that the truck moves off when Radio Alpha is activated. The script containing the captive boarding control has the following line:
@unitReady truck1
When the truck stops, all captives recieve the commands
_unit switchMove ""
_unit assignAsCargo truck1
_unit orderGetIn true
An alternative way to do it would be this:
_unit doMove getPos truck1
@unitReady _unit
_unit moveInCargo truck1.
You need to put 2 police officers in cargo to start with, or the captives will go in the cab with the driver (hardly realistic). You may also want to place a 'guard' in the back to prevent the prisoners 'escaping'
How can i fix it so player can only approach courtyard one way? Put things there to stop him or something?
Use an editorUpgrade (Kegeties or Gen. Barron's), and place down fences and structures. Find the editorUpgrades in the Ed Depot.
Is it cause some of the druggies are in the way?
Maybe. You could UnSwitchMove the druggies, and tell them to setUnitPos "DOWN" to make them hit the deck. Or you could move them somewhere better... ;D
If you like, I'll post the whole script up when I get home (And I actually have it this time).
-Supreme Commander PsyWarrior
-Psychic Productions Studios