Home   Help Search Login Register  

Author Topic: Controling pitch angle  (Read 1610 times)

0 Members and 1 Guest are viewing this topic.

Offline ZapBrannigan

  • Members
  • *
Controling pitch angle
« on: 18 Oct 2010, 09:22:57 »
Hey guys
Im making a bike mission, and i need to make a script that lets the player use the directional keys (right left front back) to control the bikes side to side and forward and back tilt while the bike is airborne. so that when he goes off jumps and tilts sideways he can get the bike straight again.  or if he wants to do a backflip he can just push the back arrow key when he hits the jump.

I guess it must have something to do with the pitch control commands, does anybody know how i could get this working?

thanks

Edit:

I worked on it and found out how to get it to return the back key, so basicly i have this script running when the back key is pressed

Quote
_vec = vectorUP m1
m1 setvectorUP[(_vec select 0)+.1,(_vec select 1),(_vec select 2)]
exit

this is supposed to make the player tilt back .1 each time it is pressed,  but for some reason, if i hold it down he will turn forward only to a certain point, until he is facing down to the ground, and he wont turn anymore .     Can somebody please give me the proper way to make him tilt back a tiny bit each time the key is pressed?

thanks
« Last Edit: 18 Oct 2010, 14:11:58 by ZapBrannigan »

Offline F2kSel

  • Members
  • *
Re: Controling pitch angle
« Reply #1 on: 20 Oct 2010, 15:32:46 »
There is actually a function called  BIS_fnc_setPitchBank, I've used it in the past to force an aircraft to dive or perform a roll, I've also used it to get the motorbike to do a wheelie.

Code: [Select]
// nul=[vehiclename] execvm "pitchup.sqf"
_obj = _this select 0;
for [{_p = 0},{_p < 30},{_p = _p + .1}] do
{
sleep 0.009;
[_obj, _p, 0] call BIS_fnc_setPitchBank;
};


To use it Place a function module on the map, and then in a trigger set to the radio and with this in on act  nul=[vehiclename] execvm "pitchup.sqf"

The bike should pull a wheelie on command, to use it in your script though you will probably on need the function combined with the Key inputs, I have no idea how that would work.

Offline ZapBrannigan

  • Members
  • *
Re: Controling pitch angle
« Reply #2 on: 23 Oct 2010, 10:31:23 »
It doesn't work   :dunno: