Home   Help Search Login Register  

Author Topic: Avoid unit rotation when in air?  (Read 839 times)

0 Members and 1 Guest are viewing this topic.

Serial Killer

  • Guest
Avoid unit rotation when in air?
« on: 17 Aug 2005, 21:36:14 »
I'm making a halo script for my mission and I just thought that when the unit is in air, he will rotate everywhere. Is it possible to avoid this rotating somehow?

Also, one more question. How to check player's altitude with a script? I want the player to get in a parachute when altitude is 300.
« Last Edit: 17 Aug 2005, 21:41:36 by Serial Killer »

Offline Pilot

  • Contributing Member
  • **
Re:Avoid unit rotation when in air?
« Reply #1 on: 17 Aug 2005, 21:45:32 »
1: I have no idea

2: something like this:
?(getpos player select 2) <= 300: goto "WhereEver"

Syntax not guarenteed

-Student Pilot

Offline wcrvieira

  • Former Staff
  • ****
Re:Avoid unit rotation when in air?
« Reply #2 on: 17 Aug 2005, 21:47:33 »
@SRK

My mate how about searching before?
Hehe!

http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25136

NBR Out!

bored_onion

  • Guest
Re:Avoid unit rotation when in air?
« Reply #3 on: 17 Aug 2005, 21:49:38 »
If you just want to fix direction then try:

Code: [Select]
_dir=getdir _unit
#loop
_unit setdir _dir
~0.01
goto "loop"

There are a whole bunch of functions in the function library which control direction, pitch, yaw etc. Take a look and see if that helps you out. Some of it can get quite involved if you really wanna go to town.
« Last Edit: 17 Aug 2005, 21:53:29 by bored_onion »

Serial Killer

  • Guest
Re:Avoid unit rotation when in air?
« Reply #4 on: 17 Aug 2005, 21:59:05 »
If you just want to fix direction then try:

Code: [Select]
_dir=getdir _unit
#loop
_unit setdir _dir
~0.01
goto "loop"

There are a whole bunch of functions in the function library which control direction, pitch, yaw etc. Take a look and see if that helps you out. Some of it can get quite involved if you really wanna go to town.

Good, it's working. Cheers. Now I just need to rotate the unit somehow. :P
Here's the current script if it helps:

Halo.sqs
Code: [Select]
ap setpos [(getpos this select 0), (getpos this select 1),(getpos this select 2) +1000]
ap switchMove "Para"
_dir=getdir ap
#loop
ap setdir _dir
~0.00001
goto "loop"

The unit's face must 'face' the ground but It doesn't need to rotate anywhere else.
« Last Edit: 17 Aug 2005, 22:14:27 by Serial Killer »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Avoid unit rotation when in air?
« Reply #5 on: 17 Aug 2005, 22:40:48 »
You don't need:
~0.00001

bored_union's suggesiton of:
~0.01 is enough.

I bet:
~0.1
is fine also.

To get the unit to face the ground try giving them a 'dead' switchmove.  Something that would have them lying down if they were on the ground.

Serial Killer

  • Guest
Re:Avoid unit rotation when in air?
« Reply #6 on: 18 Aug 2005, 13:31:03 »
Thanks.