OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Serial Killer 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.
-
1: I have no idea
2: something like this:
?(getpos player select 2) <= 300: goto "WhereEver"
Syntax not guarenteed
-Student Pilot
-
@SRK
My mate how about searching before?
Hehe!
http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=25136
NBR Out!
-
If you just want to fix direction then try:
_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 (http://www.ofpec.com/editors/funcref.php) and see if that helps you out. Some of it can get quite involved if you really wanna go to town.
-
If you just want to fix direction then try:
_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 (http://www.ofpec.com/editors/funcref.php) 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
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.
-
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.
-
Thanks.