Jump to content

How to Manipulate Time Warping


Ulico

Recommended Posts

I'm new to the forums, so I'm not sure exactly how I'm supposed to ask questions like these.

I'm working on my first ever mod and I want to be able to click a button to set time warp to 1x. I know how to sense the key clicking but how do I tell the game to set the time warp to 1x?

I'm using C# (I'm not sure if I need to say that, I think all mods use C#) and I'm using Microsoft Visual Studio.

PLEASE HELP!

Link to comment
Share on other sites

Pretty simple actually:


TimeWarp.SetRate(0, true);

0 is the index of the TimeWarp array (0 being 1x, 1 being 5x, etc). The true/false changes how quickly it switches back. True means ASAP, while false means that it smoothly transitions back.

Just to let you know, pressing the X key will both cut your engines and reset timewarp to 1x.

Link to comment
Share on other sites

Pretty simple actually:


TimeWarp.SetRate(0, true);

0 is the index of the TimeWarp array (0 being 1x, 1 being 5x, etc). The true/false changes how quickly it switches back. True means ASAP, while false means that it smoothly transitions back.

Just to let you know, pressing the X key will both cut your engines and reset timewarp to 1x.

Thanks! That was exactly what I needed! I guess I should start using the forums more often! I guess I won't be making the mod though, I didn't realize it was already stock by pressing X.

One more question. You said the 0 in the parenthesis is 1x and a 1 would be 5x. Is it the same code for physics warp? Would 1 be 2x instead of 5x?

Edited by Ulico
Link to comment
Share on other sites

One more question. You said the 0 in the parenthesis is 1x and a 1 would be 5x. Is it the same code for physics warp? Would 1 be 2x instead of 5x?

Correct. I think you have to change the TimeWarp.WarpMode as well. I haven't had to do that before, so I'm not totally positive.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...