Home   Help Search Login Register  

Author Topic: Altitude  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

Offline Insanoblan

  • Members
  • *
  • Look! Im a chicken Marge!
Altitude
« on: 08 Feb 2003, 23:59:43 »
How do i set the altitude on a car or person or anything. Please specify if i have to put it in a script, trigger, or in the init field
Hey kid, wanna see a dead body!?

PiNs_Da_Smoka

  • Guest
Re:Altitude
« Reply #1 on: 09 Feb 2003, 00:14:30 »
Put this in the units init field:

Code: [Select]
this setpos [getpos this select 0, getpos this select 1,(getpos this select 2) +10]
That will put the unit 10 meters in the air.



P.S.

the last part of that in the parenthesis is obsolete, but its jsut a habit of mine.

Code: [Select]
this setpos [getpos this select 0, getpos this select 1, +10]
should work also. ;)
« Last Edit: 09 Feb 2003, 00:16:44 by PiNs_Da_Smoka »

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Altitude
« Reply #2 on: 09 Feb 2003, 23:11:32 »

How do i set the altitude on a car ...



 ??? a CAR?  ;D LMAO - lemme try yer mission one day!  :o ;D




Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Altitude
« Reply #3 on: 10 Feb 2003, 09:41:33 »
You can't set an altitude for a person me thinks. but if that person is on a bike then you can set the altitude on the bike and thus for the person riding it as well.

btw the car will drop like a stone. If you need to keep it up you have to make a script with a loop.

For example:
create a car and name it car1
create a carfly.sqs and put in the cars init field
[timetohover,velocity] exec "carfly.sqs"
put this in the carfly.sqs

_count = 0
_timeline = this select 0
_vel =  this select 1

#start

_count = _count +1

car1 setpos [getpos car1 select 0, getpos car1 select 1,(getpos car1 select 2) +10]
_height = getpos car1 select 2
car1 setvelocity [0,0,_vel]

~0.01

?_count == _timeline: _vel = 5
?_height < 1: exit
goto "start"


timetohover is the amount of times the script will loop itself. thus timeline 10 would keep the car in the air for 0.1 seconds. timeline 100 for 1 second and so on.
velocity is the velocity the car is pulled from ground. if you increase the velocity then the car will go upwards - decrease it and the car will lower. Try first velocity of 50 and see what it does.

I just wrote this at school so I have no idea if it has bugs or anything, but give it a go and fiddle with the values. It should work.  ;)
Not all is lost.

Daneel

  • Guest
Re:Altitude
« Reply #4 on: 11 Feb 2003, 14:17:42 »
The best way to stop it dropping like a stone  is to setpos it when it is moving.
get the car driving along a nice flat road which goes in the direction you want and stick in a trigger which transports it when it reaches a certain spot or speed.
 

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Altitude
« Reply #5 on: 11 Feb 2003, 19:20:33 »
You can move a normal unit up in the air using setpos too, but it'll just fall right down ;) (splat, think of HALO scripts without the parachute ;D) However, empty cars (at least in ol' retro 1.46) who are lifted into the skies tend to hover on their own accord  :P ::)

But to try it. You're in a script writing mood aren't you Artak? ;) Hyvin kävelee...


Wolfrug out.
« Last Edit: 11 Feb 2003, 19:21:22 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"

Fiendish

  • Guest
Re:Altitude
« Reply #6 on: 12 Feb 2003, 16:35:45 »
It would be cool with a flying trabant, so you can make a Harry Potter mission  ;D ;D

Josef

  • Guest
Re:Altitude
« Reply #7 on: 12 Feb 2003, 17:00:56 »
Harry Potter is in my opinion, ONE OF THE LAMEST THINGS EVER!

Otherwise, get the Airbant ;D

Fiendish

  • Guest
Re:Altitude
« Reply #8 on: 12 Feb 2003, 17:06:53 »
That was meant to be a joke, but I would like the "airbant"!

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Altitude
« Reply #9 on: 12 Feb 2003, 18:50:21 »
It would be cool with a flying trabant, so you can make a Harry Potter mission  ;D ;D


 :) there IS a flying trabi out, it was made back in 2001 as far as I remember.


Fiendish

  • Guest
Re:Altitude
« Reply #10 on: 12 Feb 2003, 20:57:44 »
Then I guess that I'm the only one that did'nt know that. ::)