OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: rom on 15 Mar 2003, 12:34:35
-
Is it possible to spawn/create soldiers so that they are allready sitting as cargo inside a chopper?
What I want to do is the following:
I made a special soldier by exchanging the model of a soldier with the model of a jeep.
Now I drive a real jeep into the chopper, hide/delete the real jeep and spawn/create my special soldier (model of a jeep) and make him go into the chopper as cargo so that it looks like the jeep is inside the chopper and I can transport it.
Now the soldier (with th emodel of the jeep) unfortunately runs to the entry point to get into the chopper as cargo. This is what I want to avoid.
I just need the soldier spawned allready sitting as cargo inside the chopper or make him go inside the chopper as cargo without moving.
Any ideas / suggestions?
-
Put in
unitname moveInCargo vehiclename
In unitname and vehicle name put in the names of the unit and the vehicle to go in
-
"_x moveincargo helo1" forEach units grp1
helo1 - name of chopper
grp1 - name of grp leader
Either or works for what you are asking but this works well to place a whole group into a chopper. Just place this in the feild for the leader and make sure you name your leader.
IW
-
Should I take creteVehicle or createUnit to create/spawn the soldier?
I don't need the soldier to do anything but sitting in the chopper until he gets deleted again.
Can the moveInCargo command be combined with the createVehicle or createUnit command in one line?
How would this look like then?
(I'm new to scripting, I just had this idea to transport vehicles with a chopper and now I'm trying to get the parts together. The modeling parts works fine: http://www.uni-ulm.de/~s_mbuss/OFP/jeepinchopper.JPG (http://www.uni-ulm.de/~s_mbuss/OFP/jeepinchopper.JPG))
-
unit01 "SoldierWB" createUnit [getMarkerPos "marker", groupAlpha]; unit01 moveInCargo helo01
-
Ah ha! Touche!
"SoldierWB" createUnit [getMarkerPos "marker", groupAlpha,"unit01 = this; unit01 moveInCargo helo01"]
It really doesn't matter... it'll all do exactly the same thing ;) (apart from the fact that you can't name a creatunit'ed unit at the start of the statement)
There is a part of the createunit array for specifying an init string. This is where you'll need to put the name if you want to name the unit.
You can also put an orders you would ordinarily place in the init string of an editor make unit. It works exactly the same way