Jump to content

Frement

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Frement

  1. Same goes for Vessel, only instances of Vessel have the ActionGroups property. If you're trying to modify the currently active vessel, you can use FlightGlobals.ActiveVessel.ActionGroups.SetGroup.
  2. You have described none of your problems, we can't help you until you provide better information.
  3. This is because // is considered a comment. Anything after // will be read as a comment, not a value.
  4. I already gave him a full code example, my master server. He didn't really bother to read it.
  5. He doesn't have any vessel spawning currently working as far as I know, since he asked how to load a vessel on the modding channel (IRC).
  6. You can implement OnApplicationQuit to your MonoBehaviour, then you'll get a chance to do stuff when KSP is closing.
  7. You need to add UnityEngine.dll and Assembly-CSharp.dll to your references. Visual Studio: http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx MonoDevelop: http://stackoverflow.com/questions/6438122/how-can-i-add-a-reference-in-monodevelop And then you can use: using KSP; using UnityEngine; Or other namespaces contained in those assemblies. Assemblies are found in (use the correct path in your system): C:\Program Files (x86)\Steam\steamapps\common\KSP Development\KSP_Data\Managed
  8. Find the ModuleWheel module in the part(s) you want to apply brakes to, then do: module.BrakesAction(new KSPActionParam(KSPActionGroup.Brakes, KSPActionType.Activate));
  9. You can use a static class. When sound is playing, don't allow for another one to start.
  10. To emulate the function of TerminateCurrentFlight(), you could do this: public static void TerminateCurrentFlight() { foreach (ProtoCrewMember crewMember in FlightGlobals.ActiveVessel.GetVesselCrew()) { crewMember.rosterStatus = ProtoCrewMember.RosterStatus.AVAILABLE; } FlightState state = new FlightState(); if (state.activeVesselIdx != -1) { state.protoVessels.RemoveAt(state.activeVesselIdx); } GamePersistence.SaveFlightState(state, "persistent", HighLogic.SaveFolder, SaveMode.OVERWRITE); }
  11. I'm not sure I fully get what you want to do, but there are two methods available, which you should be able to use: RevertToLaunch() RevertToPrelaunch(GameScenes sceneToLoad)
  12. This thread was just posted a while ago, should cover a lot of the resources available to get started: http://forum.kerbalspaceprogram.com/showthread.php/41718-Can-someone-point-me-in-the-right-direction As for a complete beginner tutorial, haven't seen one.
  13. Here is a list of useful links: http://forum.kerbalspaceprogram.com/showthread.php/34013-0-20-PartTools-GameDatabase-and-new-features http://forum.kerbalspaceprogram.com/showthread.php/7529-Plugin-Posting-Rules-And-Official-Documentation?p=156430&viewfull=1#post156430 http://forum.kerbalspaceprogram.com/showthread.php/7544-The-official-unoffical-help-a-fellow-plugin-developer-thread?p=533405&viewfull=1#post533405 http://docs.unity3d.com/Documentation/ScriptReference/Transform.html http://docs.unity3d.com/Documentation/ScriptReference/GUI.Window.html https://github.com/Anatid/XML-Documentation-for-the-KSP-API
  14. In Visual Studio you can view the classes and their methods with Object Browser. Simply searching "Log" outputs the desired methods:
  15. Two screenshots with few GUI elements. That guy also posted threads asking for code to spawn vessels.
  16. Well, both #KSPOfficial and #kspmodders are on Esper, thats why I asked.
  17. Why is the development channel on freenode and not esper for example?
  18. Steps on adding a reference: Solution Explorer > References (right click) > Add reference > Browse > Ok Then you have to have: using UnityEngine; Here is a good list of usable methods (and in some, explanation): https://github.com/Anatid/XML-Documentation-for-the-KSP-API
  19. Ok, the basics: View the server list Join a server Create a vessel and/or control your previous vessels Fly around, get into orbit, whatever Chat with other players on server Quit All of your vessels will appear on other players screens if they are in 2.5km range in flight scene, always on tracking station. Your player name will be visible on other players above the vessel. Obviously there needs to be some sort of authentication. Username + password, registration to master server, authentication through master server, you receive a session id which is sent to the server you're going to play on, and the server is going to query master server if you are allowed to connect or not. The password needs to be different from the one on KSP forums and store for obvious reasons, even thought the password is never stored as plain text. You can set your vessel as public, which means anyone can control it. You can set your vessel to be accessible by a group you create, then only certain people will be able to control it. Or set it only usable by yourself. Vessels that are not public can't be destroyed by crashing into them, it will only destroy the vessel which is colliding with it. You can mute players from your chat, you can send a private message to anyone, basically the chat is following IRC protocol with limitations. All these limitations are configurable on server-side. The master server(s) handles: Authentication Server list Global ban list (from trusted servers) The server handles: Local ban list Chat Player vessels Feel free enlighten me on whats missing.
  20. Or simply send a packet to server informing of clients timewarp, removing clients vessels from everyone and after it has finished, adding them again. I mean, this is seriously the smallest problem.
  21. Lets take an example of 2 players, with 5 vessels each. It takes 129 bits to update the position of a vessel and 161 bits to update the rotation so 290 bits total. For one vessel the updates per second is: 5800 bits. Now lets multiply that by 5 and we get 29000 bits. And now we know we need to send 3,625 kB/s to the server. So, from client to server: 3,625 kB/s Server is now receiving positions from 2 players at the speed of 7,25 kB/s Clients will receive each others vessel position updates at the speed of 3,625 kB/s [Client 1] Up: 3,625 kB/s Down: 3,625 kB/s [Client 2] Up: 3,625 kB/s Down: 3,625 kB/s [server] Up: 7,25 kB/s Down: 7,25 kB/s So as we can see, that is basically nothing. And code can be written which doesn't update the positions of vessels that are out of the 2.5 km range, unless viewing from tracking station.
  22. Splitting the universe into different servers is a bad idea. As the data that is required to be passed between client-server is really small. We are talking about 5-15 kB/s. Of course when you connect to a server, the initial transfer needs to be bigger to receive all the vessels and everything, but after that the constant flow of data is small. EDIT: And when I say 5-15 kB/s, it's when the server has 10+ players online with 10 vessels each.
×
×
  • Create New...