Jump to content

Wait? Also, find the current save game name?


Guest

Recommended Posts

How would you tell the script to wait for X seconds?  Also, how would you find the name of the current save game?  I think it's in HighLogic...

Edited by Guest
Link to comment
Share on other sites

For your second question: HighLogic.SaveFolder

For your first, I'm not positive what the best method would be, but I'd probably have some code in Update or FixedUpdate that would set a variable to DateTime.Now, then check the time passed since then and when it's X seconds execute your code. There's probably a better method, but that's worked for me in the past.

Link to comment
Share on other sites

7 hours ago, DMagic said:

Also note that coroutines require that you be using a Unity MonoBehaviour, or something that inherits from it.

That's not quite true. You can use any external class that inherits Monobehaviour (which any class interfacing with KSP must do) like this to get access to Coroutines (note: the function is just a shortcut so I don't need to change the syntax)

Edited by Crzyrndm
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...