Author Topic: Trouble with the tank turret and flyingVehicle datablock.  (Read 1287 times)

Cap

For a while now I've been working on and off on a ship. this is the third time I've remade the thing and I'd like to release this version some time. Currently I added the tank turret onto it and I'm trying to get rid of the recoil it gives to the vehicle before I make the model I'll use in place of the turret. I've messed around with the function that I believe adds the impulse but it either add to the recoil or stops it from working flat out. I don't want the recoil because it knocks the vehicle around.

I think this is the section.
Code: [Select]
            %theVector = %mount.getEyeVector();
            %theVector = vectorAdd(%theVector,"0 0 1");
            %theVector = vectorScale(%theVector,%mount.getObjectMount().dataBlock.mass*5);
            %theVector = vectorSub(%theVector,vectorScale(%thevector,2));
            %mount.getObjectMount().applyImpulse(getWords(%mount.getEyeTransform(),0,2),%theVector);
            MissionCleanup.add(%p);
            %obj.playThread(0,activate);

My second problem is more of a gripe I have with the vehicle type. I'm making a larger then usual ship "...to go where no man has gone before..." (hint) and then it gets knocked around by a hammer, so I'd like to know how I can make it resistant to getting pushed around when the code is based off of the magic carpet.
« Last Edit: September 02, 2008, 04:21:34 PM by Cap »

You'll probably need to make your own "tank turret" datablock and use edited code from the Tank packages to make your one treated differently to the Tank's turret - otherwise you'll eliminate recoil for both vehicles.

Cap

You'll probably need to make your own "tank turret" datablock and use edited code from the Tank packages to make your one treated differently to the Tank's turret - otherwise you'll eliminate recoil for both vehicles.

The .cs for my vehicle has it's own turret package separate from the tank, I just want to know how to get rid of the recoil when it fires without disabling the firing all together, or adding to it.

Comment out the "applyImpulse" line.

Cap

Thanks, that worked. Now the only thing left to fix is stability.