Home   Help Search Login Register  

Author Topic: "Tail" behind a vehicle?  (Read 807 times)

0 Members and 1 Guest are viewing this topic.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
"Tail" behind a vehicle?
« on: 03 Oct 2005, 08:34:52 »
I would like an object to act as a "tail" on a vehicle.

Unfortunately, this is the best I've come up with:

Code: [Select]
#loop

tail setdir getdir vehicle

tail setPos [(getPos vehicle select 0) - 1.2, (getPos vehicle select 1) + 1.2, 0]

~0.05

goto "loop"

The only problem with this little script is that the "tail" does not stay behind the vehicle. I know why: the "setPos [(getpos..." line only puts the "tail" like north, south, west or east of the vehicle.

Now, how can I make the "tail" stay behind the vehicle regardless of what direction the vehicle is facing?

Thanks
Weeee...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:"Tail" behind a vehicle?
« Reply #1 on: 03 Oct 2005, 12:20:56 »
IIRC there is a trailer script in the Editors Depot.  That might be adaptable to suit your purposes, or even solve the problem directly.
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:"Tail" behind a vehicle?
« Reply #2 on: 03 Oct 2005, 12:23:39 »
Somtin like this?


Code: [Select]
_unit = _this select 0
_tail = _this select 1
;distance in rear of vehicle
_dist = -5

#loop
_Xpos = (getpos _unit select 0)+(sin (getdir _unit)*_dist)
_Ypos = (getpos _unit select 1)+(cos (getdir _unit)*_dist)
_tail setpos [_Xpos,_Ypos,(getpos _unit select 2)]
_tail setdir getdir _unit
?! alive _unit : Exit
~.01
goto "loop"

« Last Edit: 03 Oct 2005, 12:33:11 by Blanco »
Search or search or search before you ask.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Re:"Tail" behind a vehicle?
« Reply #3 on: 03 Oct 2005, 12:45:49 »
I tried the attach script in the editors depot and it worked very well. I just had to change + into - to place the object behind the vehicle.

Code: [Select]

_xa = 0
_ya = - 2
_za = 0

_unit setpos [(getpos _kidnapper select 0) -((((_xa^2)+(_ya^2))^0.5) * sin (getdir _kidnapper)), (getpos _kidnapper select 1) -((((_xa^2)+(_ya^2))^0.5) * cos  (getdir _kidnapper)), (getpos _kidnapper select 2) +_z]

Thanks guys, topic solved
« Last Edit: 03 Oct 2005, 12:46:19 by Wildebeest »
Weeee...

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:"Tail" behind a vehicle?
« Reply #4 on: 03 Oct 2005, 17:54:01 »
if so then you may wish to press the button...  ;)

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:"Tail" behind a vehicle?
« Reply #5 on: 03 Oct 2005, 18:01:47 »
Wait a minute before solving this. Totally off topic but what does IIRC mean?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Re:"Tail" behind a vehicle?
« Reply #6 on: 03 Oct 2005, 19:26:23 »
LOL I forgot to press it.. hehehe... IIRC means Interactive Illinois Report Card or Image and Identity Research Collective... I dunno..
Weeee...

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:"Tail" behind a vehicle?
« Reply #7 on: 03 Oct 2005, 19:59:17 »
if i remember correctly, it means If I Remember Correctly.

 8)