Home   Help Search Login Register  

Author Topic: Domove Near Driver  (Read 1630 times)

0 Members and 1 Guest are viewing this topic.

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Domove Near Driver
« on: 16 Mar 2007, 21:36:47 »
I can't think of a totally appropriate title :/

Well I have a man who I want to domove near the [dead] driver of a vehicle.

So far I've had the driver die and swerve off the road, now I want man1 to walk over to the driver's side of the car and look at the dead driver, civ1. I've tried man1 domove getpos civ1 but man1 just goes near the centre of the car rather than actually to the driver.

I've also tried using setpos H (invisible)  to the driver's position after he's dead and stationary but again the game thinks that civ1 is in the centre of the car. 

How can I get the coordinates of the car and create a script so that I can find the driver's side of the car? Sorry if it's not clear what I mean- I'm finding it difficult to articulate it. See the pic below for what I mean:



So what I want is whatever direction the car's facing, man1 always moves to the outside of the driver's side of the car.

Thanks in advance,

Sabre
Can you HELP?

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
Re: Domove Near Driver
« Reply #1 on: 17 Mar 2007, 04:00:01 »
Dunno if this is what you were going for, it will send man1 to the driver's side door, however he might run thru the car on his way to the driver... so you need to position  man1 so that he doesn't have to run around the car.  In other words he needs to approach the vehicle from the driver's side.

Code: [Select]
man1 domove [(getpos civ1 select 0) + 0, (getpos civ1 select 1) - 1, (getpos civ1 select 2) + 0];
You'll proberly need to add setdir and dowatch after he arrives.
Hope this helps, i'm no expert. 

Nice diagram btw!!! :good:
 
just setpos & forgetpos!

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Re: Domove Near Driver
« Reply #2 on: 17 Mar 2007, 13:35:40 »
Hehe ;) Thanks a lot for the help, I'll try it out.
Can you HELP?

Offline Cheetah

  • Former Staff
  • ****
Re: Domove Near Driver
« Reply #3 on: 17 Mar 2007, 13:42:16 »
If that doesn't work (because for every angle, the x and y corrections have to be different as far as I know), you might want to start using the sinus and cosinus to calculate the position to move the soldier to.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Re: Domove Near Driver
« Reply #4 on: 17 Mar 2007, 14:02:39 »
What like:

Code: [Select]
man1 domove [(getpos civ1 select 0) + (2*sin(getdir civ1 - 45)), (getpos civ1 select 1) + (2*cos(getdir civ1 - 45))];
(Modified from Hoz's excellent DoFollowUnit script.)

I fiddled about with the numbers a bit and I think this works adequately enough :) I'll try yours, too D_P_ to see if it gives better results :)
Can you HELP?