Author Topic: Kill rotational velocity?  (Read 1461 times)

0 Members and 2 Guests are viewing this topic.

Offline JSRNerdo

  • [`_`]/
  • 29
  • Gone!
Kill rotational velocity?
Hello, I have a problem. The problem is that I'm genuinely trying to implement something no sane FREDer should ever do, and that is to allow you to warp, in-mission. And select the exact point you want to warp to. And let you cancel the warp. And let you warp multiple times.

So what I've got is: http://hastebin.com/mudimuguwa.py
In human-readable terms: SEXP 1 sets time compression to 0.01x, saves the current position, orientation, and speed of the player to variables, changes the ship of the player to a dummy one that can actually move in 0.01x time compression, and locks all weapons on the player.
Sexp 2 cancels the warp by unlocking all weapons, and restoring the original position, orientation and speed of the player. Sexps 3, 4, and 5 combined should also do this.

However, when I do cancel the warp or complete the warp, the player ship spins. A lot. At a super-fast speed, flinging it 70k or so out of the playable area.

What am I doing wrong, apart from actually trying to make this work? I've set the rotdamp and damp of the dummy ship to 0 and made sure that I set the position, orientation and speed before changing the ship class on both cancelling and completing the warp. But it still flings all over the place.
Former Inferno lead, BTA fredder-ish and DE fredder. Driven out by ordinary fascists the_e, aesaar and general battuta. Will return if they're ever removed.

 
Re: Kill rotational velocity?
Have you tried not setting rotdamp to 0? If you want a ship to rotate slower you'd usually set rotdamp to something really high.
[19:31] <MatthTheGeek> you all high up on your mointain looking down at everyone who doesn't beam everything on insane blindfolded

 

Offline JSRNerdo

  • [`_`]/
  • 29
  • Gone!
Re: Kill rotational velocity?
Problem is, it also probably takes longer to decelerate your rotation. So you may rotate way slower, but you also stop rotating slower. If it's at zero, it should stop rotating instantly.

The problem is, why doesn't it stop moving and rotating and get flung across the place?
Former Inferno lead, BTA fredder-ish and DE fredder. Driven out by ordinary fascists the_e, aesaar and general battuta. Will return if they're ever removed.