View Full Version : An idea!
Has anyone thought about adding a Trailer? Imagine a column of vehicles passing by with guns on trailers! I have no idea how this can be done http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/sad.gif becouse i'm very new o2 editor. Anyway, i hope that someone think it over.
Mar 3 2003, 16:54
I would think you would have to make it as one vehicle, that is, trailer and towing vehicle together. Which kind of defeats the object.
Mar 6 2003, 20:54
It may well be possible, but I would imagine only with the use of a script. For example, you could make a script that constantly receives updates about the trailers position in x,y and z co-ordinates using the time delay command (the "~" symbol) along with its direction. Also you would need some way to get its elevation. Then you could instruct the game to mimic this exactly in the vehicle being carried on the trailer. Only one problem, you would have to find a very clever way to model the fact that the trailer is articulated. The only way I can think of doing that is import a suitable pulling vehicle into oxygen and attach the newly modelled trailer to the back. Then you would have to put in the turning animations as if it were one object. This still would not properly simulate a real trailer. For example it would screw up when you turned the wheels at slow speeds, as the trailer would suddenly start drifting to the left or right of the truck as if floating. You could only realistically model it if you found some way to maybe make the animations speed sensitive. Personally I wouldn't bother!!! A far easier way is just make a script like the one I mentioned earlier for a new or previously existing flatbacked truck, and just have the vehicle to be moved put on the back of it rather than being pulled by an (impossible to simulate) trailer!!!!
Mar 8 2003, 10:20
I wrote a trailer script some time ago. Problem: if you setdir a vehicle, it's yaw angle is set to the desired angle, but pitch and roll are set to zero -> vehicle is not aligned with ground...
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
;Anhängerskript für OFP
_zugmaschine = _this select 0
_anhaenger = _this select 1
_abstand1 = _this select 2
_abstand2 = _this select 3
SKRIPTENDE = false
?((speed _zugmaschine) <= 1) goto "anh_schleife"
_zugmpos = GetPos _zugmaschine
_zugmdir = GetDir _zugmaschine
_anhpos = GetPos _anhaenger
_anhkupx = (_zugmpos select 0) - _abstand1 * Sin(_zugmdir)
_anhkupy = (_zugmpos select 1) - _abstand1 * Cos(_zugmdir)
_difanhx = _anhkupx - (_anhpos select 0)
_difanhy = _anhkupy - (_anhpos select 1)
?(_difanhy == 0) && (_difanhx >= 0): _anhdir = 0
?(_difanhy == 0) && (_difanhx < 0): _anhdir = 180
?(_difanhy > 0): _anhdir = atan(_difanhx / _difanhy)
?(_difanhy < 0): _anhdir = atan(_difanhx / _difanhy) + 180
_anhkupx = _anhkupx - _abstand2 * Sin(_anhdir)
_anhkupy = _anhkupy - _abstand2 * Cos(_anhdir)
_anhaenger SetPos [_anhkupx,_anhkupy]
_anhaenger SetDir _anhdir
?(SKRIPTENDE): goto "ende"
Usage: [tractor_object, trailer_object, distance_tractor_to_coupling_point, distance_coupling_point_to_trailer] exec "anhaenger.sqs"
You can exit this script by setting variable "SKRIPTENDE"="true".
If you avoid hills and mountains, this script is quite useful -e.g trailing airplanes.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.