Home   Help Search Login Register  

Author Topic: Noob: Confused with getpos and ordergetin!!  (Read 1211 times)

0 Members and 1 Guest are viewing this topic.

TheOakster

  • Guest
Noob: Confused with getpos and ordergetin!!
« 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


Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Noob: Confused with getpos and ordergetin!!
« Reply #1 on: 04 Jul 2006, 14:58:17 »
your command

Code: [Select]
[t1] ordergetin true

will only force unit named t1 to board the car.

try this:

In the group leader units init line, insert
Code: [Select]
grp1 = group this

then, in the script you should firstly assign every unit a place in the car.

Code: [Select]
; 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:

Code: [Select]
@ "_x in car1" foreach grp1

or

Code: [Select]
@ ([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

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Noob: Confused with getpos and ordergetin!!
« Reply #2 on: 04 Jul 2006, 14:59:21 »
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

Code: [Select]
{_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...
« Last Edit: 04 Jul 2006, 15:04:29 by bedges »

TheOakster

  • Guest
Re: Noob: Confused with getpos and ordergetin!!
« Reply #3 on: 04 Jul 2006, 15:57:57 »
Quote
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
Quote
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
« Last Edit: 04 Jul 2006, 16:11:08 by Ben »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Confused with getpos and ordergetin!!
« Reply #4 on: 04 Jul 2006, 16:33:37 »
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 ;)
« Last Edit: 04 Jul 2006, 16:48:14 by bedges »

TheOakster

  • Guest
Re: Noob: Confused with getpos and ordergetin!!
« Reply #5 on: 04 Jul 2006, 16:57:58 »
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

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Noob: Confused with getpos and ordergetin!!
« Reply #6 on: 04 Jul 2006, 22:56:31 »
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.

TheOakster

  • Guest
Re: Noob: Confused with getpos and ordergetin!!
« Reply #7 on: 05 Jul 2006, 10:10:42 »
Posted by: myke13021
Quote
replace players unit with an AI controlled unit after cutscene has started

Thats what I was thinking of doing.

Ben