Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
D.murphy man

GetBankPitch Reverse Engineer Tutorial

Recommended Posts

Thought id spread the word of joy in the forums about yet another major engine barrier hacked down by a talented addon maker. Quoted from OFP.info site:

Click it!

Quote[/b] ]This news will only concern advanced addonmakers and scripters; Chris Hampson has sent us a 20 pages tutorial which is a very detailed breakdown of the GetBankPitch utility made by Dschulle, in order to share it with the addonmaking community.

To make it simple GetBankPitch returns pitch and bank data of a vehicle in the game. It basically is there because Bohemia never provided a command which could do that for us.

Example:

I have a helicopter I am using GetBankPitch utility with. I write a script to record its pitch. It has the following code:

_pitch = mychopper call GetPitch

This will return the pitch in radians of the helicopter called "mychopper". It works also for bank.

Enjoy!

Share this post


Link to post
Share on other sites

It's more a tutorial about functions, but nice anyway. Thanks. thumbs-up.gif

Quote[/b] ]... by a guy called snYpir
Never heard about that guy biggrin_o.gif
Quote[/b] ]Denoir – Haven’t seen him for ages but he used to be a big moderator at the BI Forums. One of my favourite characters in the OFP community even though I hardly ever spoke to him and don’t know why he disappeared. Thought I’d mention him anyway.
Looks like someone doesn't check the politics threads wink_o.gif

Share this post


Link to post
Share on other sites

OK the hours I've spent addon making can be counted on the fingers of one hand, but what's this for? huh.gifgoodnight.gif

Share this post


Link to post
Share on other sites
OK the hours I've spent addon making can be counted on the fingers of one hand, but what's this for? huh.gifgoodnight.gif

As ofp.info says, it adds the "command" getPitch.

Share this post


Link to post
Share on other sites

lol, i´d expected a lil bit more euphoria in a thread like this...

Doesn´t this finally make Crew mounted MG´s on tanks possible ? biggrin_o.gif

Share this post


Link to post
Share on other sites
lol, i´d expected a lil bit more euphoria in a thread like this...

Doesn´t this finally make Crew mounted MG´s on tanks possible ? biggrin_o.gif

Hm, not really. We also need setPitch. Well, maybe it does, but only with some very very very strange workarounds.

And btw, it seems like this function is quite old (made by Dschulle). I didn't know that, but it's standing there.

Share this post


Link to post
Share on other sites
And btw, it seems like this function is quite old (made by Dschulle). I didn't know that, but it's standing there.

Thanks for the thread, I am very grateful. I just like to point out before this thread goes any further that I did not make the utility that acquires bank and pitch information. It is entirely the work and brainchild of scripting genius Dschulle.

However the utility came with almost no documentation at all and I decided that maybe it was time a lid was lifted on how these things are done so I could show other members of the community how to understand and potentially modify stuff like this.

I have made two addons in the past but to be honest I get alot more pleasure breaking down barriers which stand in the way of people's understanding of things, which is why i wrote this tutorial.

Again, I thank you greatly for starting this thread and I hope the tutorial I have made is of use for a long time to come thumbs-up.gif

Share this post


Link to post
Share on other sites
OK the hours I've spent addon making can be counted on the fingers of one hand, but what's this for? huh.gifgoodnight.gif

As ofp.info says, it adds the "command" getPitch.

That doesn't answer my question... whistle.gif

I wouldn't know what "getPitch" meant if a book about it was thrown at my face huh.gif

Share this post


Link to post
Share on other sites
Hm, not really. We also need setPitch.

Assuming of course, somebody hasn't already got there first, then perhaps this is something I will look at in the future wink_o.gif

Share this post


Link to post
Share on other sites
OK the hours I've spent addon making can be counted on the fingers of one hand, but what's this for? huh.gifgoodnight.gif

As ofp.info says, it adds the "command" getPitch.

That doesn't answer my question... whistle.gif

I wouldn't know what "getPitch" meant if a book about it was thrown at my face huh.gif

We already have setDir, to get the direction of an object. But as this is a 3D video game, we also need a command to get the pitch/inclination/downtilt/whatever.

Share this post


Link to post
Share on other sites
OK the hours I've spent addon making can be counted on the fingers of one hand, but what's this for?  huh.gif  goodnight.gif

As ofp.info says, it adds the "command" getPitch.

That doesn't answer my question...  whistle.gif

I wouldn't know what "getPitch" meant if a book about it was thrown at my face  huh.gif

We already have setDir, to get the direction of an object. But as this is a 3D video game, we also need a command to get the pitch/inclination/downtilt/whatever.

YES, but why would you want to get this information? That's what I'm getting at icon_rolleyes.gif

Share this post


Link to post
Share on other sites

For the purpose of making scripts that require bank and pitch data to work. Such as the pitching camera script I made. It would never work without being able to acquire the pitch data of the aircraft it was attached to.

Trust us it's necessary smile_o.gif

Share this post


Link to post
Share on other sites

Once you've GOT the pitch of a vehicle, you could SET the pitch of another vehicle to that same pitch. This could be used to have two or more turrets on a tank or helicopter, by getpos, setpos and getpitch setpitch ing another vehicle (the turret) to the required spot.

Something similar has been done by Col CLink with his boat addons, but boats dont need pitch in ofp, as they dont tilt like tanks or aircraft do.

Of course I could be completely wrong nener.gif

Share this post


Link to post
Share on other sites
Guest RKSL-Rock

Ok for those doubting thomas types... this sort of script could make a V22 viable or any other tilt rotor system...and a multitude of other possible applications.

Thanks Chris

Share this post


Link to post
Share on other sites
Ok for those doubting thomas types... this sort of script could make a V22 viable or any other tilt rotor system...and a multitude of other possible applications.

Thanks Chris

Your welcome biggrin_o.gif Hope you saw yours and UNN's mention at the end of the document.

I intend to release a fixed version of this utility which has the height above sea level bug removed. I used the original utility by Dschulle to get the pitch data for my pitching camera script. I noticed however that there were very slight fluctuations in the camera angle which I think were too much to be down to the loop time being too long. I suspect they were caused by the sea level bug.

One question I do have, is does the distance command lose accuracy when called over large distances?

Share this post


Link to post
Share on other sites
Of course I could be completely wrong nener.gif

I don't think you are wink_o.gif But the setpitch function is a way off yet I think. Have a look at the thread I've started in one of the scripting forums (mission or config, can't remember which).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

Ă—