Home   Help Search Login Register  

Author Topic: Crew Change Script  (Read 1256 times)

0 Members and 1 Guest are viewing this topic.

UNN

  • Guest
Crew Change Script
« on: 02 Jun 2005, 16:13:47 »
Hi,

I extracted a couple of scripts I used elsewhere for swapping a vehicles crew from editor placed vehicles, as I thought it might come in handy. The new crew will reflect all the characteristics of the units you originaly placed in the editor, including Rank, Skill, Waypoints and Behaviour. But this way you get to override the Crew type in the original addon.

Usage:

To replace the entire crew of a tank (Commander,Gunner,Driver):

Quote
[<Vehicle>,<Commander Crew Type>,<Gunner Crew Type>,<Driver Crew Type>] Exec "UNNCrewChange.sqs"

Example:

Code: [Select]
[This,"OfficerW","SoldierWB","SoldierWB"] Exec "UNNCrewChange.sqs"
To replace the entire Crew of a Helicopter (Gunner,Driver):

Quote
[<Vehicle>,<Gunner Crew Type>,<Driver Crew Type>] Exec "UNNCrewChange.sqs"

Example:

Code: [Select]
[This,"SoldierWB","SoldierWB"] Exec "UNNCrewChange.sqs"
To replace a single truck driver:

Quote
[<Vehicle>,<Driver Crew Type>] Exec "UNNCrewChange.sqs"

Example:

Code: [Select]
[This,"OfficerW"] Exec "UNNCrewChange.sqs"
Ok, so you probably won't want to put regular OFP soldiers in as a helicopter crew. But you can for example get a mission to start with any Soldier addon as driver and gunner of an MG Jeep, or helicopters with Pilot addons...and so on. with the Invasion 1944 Mod, you can place the proper Tank Commanders,Gunners and Drivers into any other WW2 tank:

Code: [Select]
[This,"pzwh_1","pzwh_2",pzwh_3] Exec "UNNCrewChange.sqs"
Thanks to HateR_Kint for the Rank function, and BN880 for the Init function.

There is a very basic example mission included.

P.S Remeber to get the unit type just add the following in it's Init field in the editor:

Code: [Select]
Hint TypeOf This
Cheers