Jump to content
FireWalker

Question related to getPOS

Recommended Posts

Is there a getPos command that will retrieve the rotation of an object?  It looks to me that all the getPOS arrays only get horizontal coords and vertical heights without regard to the rotation that the object is sitting on.

 

I'm thinking that if I snap (an ammo crate) to an angled surface that I should be able to retrieve those rotations while the mission is running (and set them back).  getDir will give me the compass.  Will one of the getEden commands retrieve angles (rotations)?  Guess I need a getRot command...

 

Thanks,

Fire

Share this post


Link to post
Share on other sites

@pierremgi

 

Ok, thats why didn't see it. Totally stuck on the "g" command list. I'll mess around with it. I want it for use with inidbi2, so hopefully I'll just shuffle some commands around. I've just keep running into an issue where after ini writes the position back the objects look silly. I've been ignoring it for awhile, but feel like correcting it now...

 

Thank you

Share this post


Link to post
Share on other sites
2 hours ago, scheintot2 said:

Is this what you guys mean?

 

Not exactly. Those commands only get and set the position of objects/units relative to a flat plane and the relative elevation.

 

If you look in the attributes of an object in the eden editor you will see there are three additional position boxes that are labeled "rotation". These allow you to also set the object to the surface. Think: "side of a hill".

 

You can snap to that surface in the editor, but if you place the same item in the same spot with setPos, the item will be in the correct spot, but be sitting perfectly level.

 

Pierremgi's commands do the job, I'm just not sure how easy it's gonna be to get the rotations to begin with. Haven't dove into it yet.

 

Fire

Share this post


Link to post
Share on other sites

You can place the object you want to rotate on a seperate scenario and then get the vectorDirAndUp with this:

_myVectorDirAndUp = [vectorDir cursorObject, vectorUp cursorObject];

And use this array on your desired object:

_obj setVectorDirAndUp _myVectorDirAndUp;

 

The BIS_fnc_getPitchBank and BIS_fnc_setPitchBank commands are easier to understand since you dont have to work with vectors.

  • Like 1
  • Thanks 1

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

×