Jump to content
Sign in to follow this  
Junker

attachto idea

Recommended Posts

Im thinking of using the attachto to make it possible to walk around inside a C130 while in flight.

The idea whould be:

Attachto enabled

player press W and the script updates the pos and dir giving the effect of movement inside the aircraft..

possible ?

Share this post


Link to post
Share on other sites

Not really... i already tried this but the attachto sets the dir of the soldier always to the dir of the c130... so aiming and moving in the c130 is not possible. It seems that setdir dont work with attached objects.

But you can load cargo like jeeps with this in a c130... this is no problem.... attached when crew==0 and detached when crew>0

Share this post


Link to post
Share on other sites
Not really... i already tried this but the attachto sets the dir of the soldier always to the dir of the c130... so aiming and moving in the c130 is not possible. It seems that setdir dont work with attached objects.

Not in my experience or according to the biki. Setdir sets the direction relative to the direction of the object it is attached to. "unit Setdir 0" would make it face the same direction at the object it is attached to. 180 the opposite direction, 90 to the right ect.

Share this post


Link to post
Share on other sites
Not in my experience or according to the biki. Setdir sets the direction relative to the direction of the object it is attached to. "unit Setdir 0" would make it face the same direction at the object it is attached to. 180 the opposite direction, 90 to the right ect.

yes but he is right, once your are attached there is no way of setting a direction to your unit.

Shame really would be fun to run out the back of a C130 to HALO :P

Share this post


Link to post
Share on other sites
yes but he is right, once your are attached there is no way of setting a direction to your unit.

Rubbish. Works just like I described when I test it.

Share this post


Link to post
Share on other sites

Worked well for me so far. If not theres still the setVectorDir command.

What you're planning may work but thrust me it'll easily grow more complex than you want it to be. Also it'll be tricky to make it look right.

Just one example: if you have more than one person on your plane, you'll have to avoid them from walking through eachother.

I think it would be easier to code several different attachTo-positions from which you can choose. You get the same benefit, but with much less hassle.

Share this post


Link to post
Share on other sites

What you're planning may work but thrust me it'll easily grow more complex than you want it to be. Also it'll be tricky to make it look right.

True. No really worth worrying about being able to move around in my opinion.

Although an animation for running and jumping out the back would be cool.

Share this post


Link to post
Share on other sites
Rubbish. Works just like I described when I test it.

Try it with the C130... setdir don't work. I just tested it in MP, dont know about SP, but i think MP is the more important part for somethink like walking in a plane (CTI etc).

Share this post


Link to post
Share on other sites
Try it with the C130... setdir don't work. I just tested it in MP, dont know about SP, but i think MP is the more important part for somethink like walking in a plane (CTI etc).

I only tried it in SP, attaching myself on top of a tank. Worked fine there, even as it was driving around.

Maybe for it to work in MP the setdir command has to be run local to the attached object or the object it's attached to.

Share this post


Link to post
Share on other sites

Hmm wait, let me look that up.

Ah yes. If you want to use SetDir correctly, you'll have to execute it on all clients.

The c130 has nothing to do with this, I'm using setdir in my cargoscript for the c130 and it works fine.

Share this post


Link to post
Share on other sites
If you want to use SetDir correctly, you'll have to execute it on all clients.

One way to do this is

player setVehicleInit "this setDir 180"; 
processInitCommands;

Share this post


Link to post
Share on other sites

here is a little nipit im workign with for my football mod update it might help ya out

player setDir ( [ getpos player, {newlocation}, player ] call _fattachTODirToObj );

_fattachTODirToObj =
{
       private [ "_pos", "_obj", "_player", "_dir"];
       _pos = _this select 0;
       _obj = _this select 1;
       _player = _this select 2;
       _calcdir = ( ( position _obj select 0 ) - ( _pos select 0 ) ) atan2 ( ( position _obj select 1 ) - ( _pos select 1 ) );
       _dir = _calcdir - (getdir _player);
       _dir
};

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  

×