OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: TheOakster on 04 Jul 2006, 13:59:11
-
Hi,
I know this has been answered over and over again but I have spent the last two days searching posts and not really seeing what I am after so here goes:
A group of 4 people (grp1), made up of the player (player), and the other three. (t1, t2, t3)
There is a car (car1)
I want them to get in the vehicle, with out the player being the driver and then when everyone is in, to drive to a gamelogic (loc1)
If I ungroup t1 and exec the following script it works:
t1 assignasdriver car1
[t1] ordergetin true
t1 move getpos loc1
However I cant work out how to get the player in, I have tried the following:
t1 assignasdriver car1
[t1] ordergetin true
if {vehicle player != player} then (t1 move getpos loc1)
and
t1 assignasdriver car1
[t1] ordergetin true
if {vehicle player == player} then (t1 move getpos loc1)
and a few others that I have come across, but the driver just sits there.
What am I doing wrong?
Ben
-
your command
[t1] ordergetin true
will only force unit named t1 to board the car.
try this:
In the group leader units init line, insert
grp1 = group this
then, in the script you should firstly assign every unit a place in the car.
; assigning the driver
_driver = grp1 select 1
_driver assignasdriver car1
; assigning the rest of group as cargo
_cargoarray = grp1 - (grp1 select 1)
"_x assignascargo car1" foreach _cargoarray
; making the whole group board the car
"_x ordergetin true" foreach grp1
now to wait until everyone is in the car i'm unsure how it will work and i can't test it right now, but take a look at this:
@ "_x in car1" foreach grp1
or
@ ([grp1 select 0] in car1) AND ([grp1 select 1] in car1) AND ([grp1 select 2] in car1) AND ([grp1 select 2] in car1)
This is all untested but it might you show the general direction to work on.
Good luck
-
so you want the player in the car as well, before the group moves off?
i assume the player is not the leader of the group? if that's the case, when the leader is ordered to get in, he should then order the rest of the group to get in too, without any further scripting required.
with script, you could try
{_x assignascargo car1} foreach units group t1
t1 assignasdriver car1
[t1] ordergetin true
t1 move getpos loc1
just tested, and works.
any reason why you're not just using waypoints? see attached...
-
any reason why you're not just using waypoints?
What I wanted was for the group (grp1), of which the player is the leader, to get in a vehicle (car1) and for the car to drive to (loc1). But instead of the player driving I wanted one of his team to drive.
I couldnt work out how to do it with waypoints or a script so I decided to ungroup one of his team (who I named t1) and then get him to board himself, and then the player would order the other team members to board the vehicle. And then when they reached (loc1) I would group t1 with the player.
@ bedges
i assume the player is not the leader of the group?
He is, so would that change the script?
I will try the attached file and see if I can get that to fit my mission.
@myke13021
That doesnt work, but I will keep fiddling with it just in case I can get it to work how I want.
Ben
**EDIT**
Would it be easier as a cutscene because I could then force the player to get in as a passenger as well?
I'm happy with all the camera angle stuff, its just actually scripting the getting in bit that I cant seem to do.
Ben
-
hmmm. i think the problem here might be that, being the leader of the group, the player is expected to tell his loons what to do, which transport to board, and where to go.
cutscene would definitely remove the problem, but you'd have to fake it, using an ungrouped unit with the same face and weapons as the loon meant to be driving...
EDIT - i have done what you described above, removing the driver from the squad and rejoining after the trip. works fine, see attached missionette.
EDIT 2 - it's not all that noobish a problem ;)
-
Woo hoo,
That works fine bedges and I see no reason why I cant get that in my mission. I might still put it as a cutscene though as it was nearly finished..!
Anyway, thanks for all your help.
Ben
-
when making a cutscene, remember player controlled units will not follow an move commands.
to get around this you...
might start cutscene after player is in car
or...
replace players unit with an AI controlled unit after cutscene has started.
-
Posted by: myke13021
replace players unit with an AI controlled unit after cutscene has started
Thats what I was thinking of doing.
Ben