OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Olphy on 12 Jan 2004, 17:44:05
-
How do I make a car look as if its turned on it side? Becuase I think it would look pretty mint in this mish im making...
Cheers.
-
You can't, unless you want to blow it up and hope it'll turn land on the side.
:beat: *Gets Shot* :beat:
-
I remember reading of a way.. but that's it. You could search the forums, but I doubt you'll find anything. In the meantime you can explore the setvelocity command and have some laughs.
car setvelocity [40,20,50]
;D
-
upside down you can I think...
try to experimenting with setPos command
create two cars (car01,car02)
car01 init field: this setpos[(getpos car02 select 0) + 0, (getpos car02 select 1) + 0, (getpos car02 select 2) + 3]
after every getPos there is an offset, I wrote now + 0 and + 3.
+ 3 is the offset for the height
you should experiment with the first and second offset.
Sure you can get such an effect when car01 wil be put to car02 in a way when it got upside down or even its side.
when you achieved that you can make a trigger with delay a few sec, on activation: car02 deleteVehicle this
-
It makes me wonder because BAS did it in their fist mission of OPFOR Insugency. Where an overturned ural blocks an entrance.
-
I think ill go for what gundernak says. ;)
Nice one lads. ;)
-
If you've seen it done somewhere unpbo the mission and figure out what they did.
Learning from other people's missions - good
Plagiarism - bad
-
Well it was part of Campaign so thats a bit more of an added headache.
-
I tryed, and this is working.
:D
this is the right setPos:
this setpos[(getpos car02 select 0) + 0.5, (getpos car02 select 1) + 0, (getpos car02 select 2) + 3]
car01 will be on its side in a few sec.
after you can delete the other car
-
Well it was part of Campaign so thats a bit more of an added headache.
Use Amalfi's pbo decryptor 1.5 from the Ed Depot, it unpbos the whole campaign in one go - couldn't be easier.
-
o yea btw i cant get the decryptor 2 work. it does 4 the original missions but the custom-made missions just come out as a readme file
-
They are probably in a different directory. Hunt around a little.
-
Nice one lads. :)
-
Okay, I just wrote a quick script to do this (I needed it for myself anyway):
flipcar.sqs:
_car = _this select 0
_offset = _this select 1
_dir = getdir _car
?(_this select 2) == 1 : _dir = 90 + getdir _car
_wedge = format["%1",typeof _car] camcreate [0,0,0]
_wedge setdir _dir
_wedge setpos [(getpos _car select 0) + _offset*cos (_dir), (getpos _car select 1) + _offset*sin (_dir) , 2]
_car setpos [getpos _car select 0, getpos _car select 1, 7]
_wedge setvelocity [0,0,10]
~5
deletevehicle _wedge
It is called like this: [vehicle, offset, 0 or 1]
vehicle is the car/bus/truck to be flipped
offset is a number that you have to fiddle with yourself until you find a number that will flip the car (usually around 0.8-1.5)
0 or 1 explained below
What this script does is it makes another vehicle of the same type as the one you pass it, then it moves your vehicle into the air, moves the new one beneath it, and launches the new vehicle upwards at your vehicle. If you get the offset right, this will flip the car so it lands either on its side or on its top. Normally the new vehicle is created parallel to the old one (facing the same direction, either to the left or right of the old one, depending on the sign of your offset). If you place a 1 in the last slot of the array, the new vehicle will be placed perpendicular to the old one, and either in front of or behind the old vehicle, depending on the sign of your offset (think the top of a T). With some vehicles it is easier to flip it on its top using this method. After 5 seconds the new vehicle (the one used to flip the other) will be deleted.
Here are some examples:
To flip a 5t truck or bus on its side: [this, 1, 0] exec "flipcar.sqs"
To flip a car on its back: [this, 1.7, 1] exec "flipcar.sqs"
To flip a car on its side: [this, 1.2, 0] exec "flipcar.sqs"
-
hehehehhe ;D
-
Okay, I just wrote a quick script to do this (I needed it for myself anyway):
flipcar.sqs:
_car = _this select 0
_offset = _this select 1
_dir = getdir _car
?(_this select 2) == 1 : _dir = 90 + getdir _car
_wedge = format["%1",typeof _car] camcreate [0,0,0]
_wedge setdir _dir
_wedge setpos [(getpos _car select 0) + _offset*cos (_dir), (getpos _car select 1) + _offset*sin (_dir) , 2]
_car setpos [getpos _car select 0, getpos _car select 1, 7]
_wedge setvelocity [0,0,10]
~5
deletevehicle _wedge
It is called like this: [vehicle, offset, 0 or 1]
vehicle is the car/bus/truck to be flipped
offset is a number that you have to fiddle with yourself until you find a number that will flip the car (usually around 0.8-1.5)
0 or 1 explained below
What this script does is it makes another vehicle of the same type as the one you pass it, then it moves your vehicle into the air, moves the new one beneath it, and launches the new vehicle upwards at your vehicle. If you get the offset right, this will flip the car so it lands either on its side or on its top. Normally the new vehicle is created parallel to the old one (facing the same direction, either to the left or right of the old one, depending on the sign of your offset). If you place a 1 in the last slot of the array, the new vehicle will be placed perpendicular to the old one, and either in front of or behind the old vehicle, depending on the sign of your offset (think the top of a T). With some vehicles it is easier to flip it on its top using this method. After 5 seconds the new vehicle (the one used to flip the other) will be deleted.
Here are some examples:
To flip a 5t truck or bus on its side: [this, 1, 0] exec "flipcar.sqs"
To flip a car on its back: [this, 1.7, 1] exec "flipcar.sqs"
To flip a car on its side: [this, 1.2, 0] exec "flipcar.sqs"
I must say that looks pretty impressive and I'm gonna give that one a try as soon as I can.
Thanx. Ill let u know if it works or not. Cheers mate! ;)
-
10/10 for General Barron, this is the first time I've seen a satisfactory answer to this one. :thumbsup:
-
:wave:
Thank you, thank you! You're too kind!
*takes a bow*
:moon:
:tomato:
-edit
Though after trying out the script a little more, it seems that it only works sometimes, but not always. The randomness should be nice for most uses, but if you want to have something very specific/precise like the truck blocking an enterence, you may have to try something else.