Jump to content

dewin

Members
  • Posts

    166
  • Joined

  • Last visited

Posts posted by dewin

  1. On 9/6/2016 at 10:44 AM, worir4 said:

    Not sure if this counts as a PC building question but does any one have any recommendations for a HOTAS under £50? (first time getting one)

    Didn't see it mentioned here, but I have one of these for Elite:

    https://www.amazon.com/Thrustmaster-T-Flight-Hotas-Flight-Stick-Pc/dp/B001CXYMFS

     

    Seems like a good introductory HOTAS. It could stand to have another hat switch and/or a couple more buttons, but for something not much more than a Xbox controller in price it's totally worth trying out if you're not sold on the idea entirely.

    Plus, it's not made by MadCatz, who have some pretty severe QC issues.  (See: Saitek before and after MadCatz bought them.)

  2. 4 hours ago, PeteWasEre said:

    Firstly, streams are AWESOME. After rewriting a lot of my output indicator code to use streams the performance is much better, and with about 65 active streams I see no performance impact in the game. 3k stream RPC/s and it seems happy. Also, the streams don't break if a part is lost. I blew away parts with whack-a-kerbal and the temperature streams for those parts just stopped updating which is very nice. I just reset all my streams on a stage event (and have to think about un-docking too!).  [..]

    I'm actually toying with an extension to streams that allows them to trigger callbacks.  This would eliminate needing to examine their values in a loop and instead have a function called whenever their value changes, so it would improve performance clientside as well.  More about this is in this issue here and the PR that references it.  (Python-only for now).

    2 hours ago, djungelorm said:

    [...] Currently krpc-clientgen has no support for this, but would be easy to add. We would then need a way to tell the python client to use either the hard coded stubs or dynamically created ones. We could do this by adding an extra argument to krpc.connect() so that the user can specify which ones they want to use? I think it might be best to set the default to be to use the hard coded ones - as I don't think people often futz with the RPCs that are available, and it would actually improve the time taken to connect a fair bit (the client can take up to half a second to connect over the network with dynamically created stubs)

    I'd almost say take the dynamic one by default since the main reason for wanting generated Python code (and probably Lua/etc as well) is for documentation/inspection/code completion purposes.  In fact, it may be sufficient to generate _just_ the documentation -- i.e. a series of dummy classes and methods with docstrings but no actual code.

  3. 8 minutes ago, Leroki said:

    C# function vessel.Flight().Speed/VerticalSpeed/HorizintalSpeed return 0.

    Take a look at the docs regarding Reference Frames.

    Namely, the default reference frame for Flight is the vessel's surface reference frame.  The origin of this reference frame is located at the origin of the vessel.  In otherwords: from the vessel's perspective, the vessel will always have 0 velocity.

    From Kerbin's perspective, that might be different.  And from Kerbol's perspective, that will be very, very different.

     

     

  4. Version 0.2.0 beta is now available; links in the OP.

    • Added client libraries for C#, C++ and Java.
    • Added preliminary support for CKAN and KSP-AVC. This release does not include MiniAVC and does not use the internet to check for version updates, but other providers of MiniAVC/KSP-AVC might

    Barring any major issues, this is the same version that I'll have in the Release thread -- I'm just delaying that until kOS's final release.

  5. 5 hours ago, hvacengi said:

    I would ask that a recompile is not posted unless the version is modified to be lower than our existing version.  There are... complications that come with an unofficial release.  [...]

    This is precisely why I didn't post the recompile.  Well, that and I'd have to actually grab 0.20.1 to do it.  The reason I compiled kOS from source in the first place is for my own addon.

  6. 1 hour ago, BeafSalad said:

    I am aware of the release candidate and have tried it only to find a bug that cripples some of my scripts. I was asking if anyone has done a unofficial build of v0.20.1 for ksp 1.1.3. I know you guys are too busy with the v1.0.0 release. As far as I am aware the only thing broken in 1.1.3 is the time warp and I am sure I read somewhere that a recompile works.

    I have just been atempting it myself with msbuild as I do not want to mess around with Visual Studio but I am getting many errors and have been unsuccessful as yet.

    I had no trouble building kOS in VS2015, you'll just need to update the assembly references to point at the relevant files in KSP\KSP_x64_Data\Managed.

    And yes, the simple recompile should fix timewarp while you wait for 1.0.0.  I opted to not post my build here to avoid complicating things for the developers in the middle of the 1.0.0 release, but I did consider it.  (Timewarp broke because Squad added a new "optional" parameter to the function, but optional parameters in MSIL aren't actually optional at runtime -- they merely instruct the compiler what value it should put there instead.)

  7. 9 hours ago, djungelorm said:

    I've added the following biome related RPCs which will be released in the next version. Does this cover everything you need?

    If not already present, it might be good to add the boundary altitudes for flying low/flying high/space low/space high as well.  I have an open PR to KER that does this here, feel free to steal from it.

  8. 1 hour ago, Amedee said:

     

    
    FUNCTION do_science_module {
      PARAMETER mod.
    
      IF (mod.HASDATA = FALSE) {
        mod:DEPLOY.
        WAIT UNTIL mod:HASDATA.
        PRINT "New data, transmitting now.".
        mod.TRANSMIT.
      }
    }
    [...]

    Oh yeah, I don't like IF (mod.HASDATA = FALSE) but I don't know how to express a negative boolean in kerboscript.

    You're using . (dot) instead of : (colon).  Common mistake, I do the same thing all the time.

    You can also just do IF NOT mod:HASDATA {

  9. 10 hours ago, dewin said:

    Will give that a go tonight.  If all goes well, I'll have a proper release ready.

    And still no-go, same "an attempt was made to load an assembly from a network location error as before:

    (venv) D:\git\KIPC\dlls>krpc-clientgen cpp KIPC --output-defs defs.json --ksp D:\git\KIPC\KSP  KRPC.SpaceCenter.dll kOS.dll kOS.Safe.dll JsonFx.dll ICSharpCode.SharpZipLib.dll KIPCPlugin.dll
    Error: b"Failed to load assembly 'D:\\git\\KIPC\\dlls\\kOS.dll'.\r\nCould not load file or assembly 'kOS, Version=0.20.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)\r\nAn attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.\r\n"

    ... oh.  But it seems to be giving correct output if I completely ignore all of the dependent assemblies, using.  So problem solved!  (still no idea why it can't load kOS though)

    krpc-clientgen cpp KIPC --output-defs defs.json --ksp D:\git\KIPC\KSP  KIPCPlugin.dll

     

     

  10. 10 hours ago, djungelorm said:

    Sorry yes, I meant clientgen.

    The following works fine for me in Linux (with all the DLLs in the current working directory):

    
    krpc-clientgen cpp KIPC --ksp /home/alex/workspaces/ksp/ksp-1.1.3.1289 KRPC.SpaceCenter.dll kOS.dll kOS.Safe.dll JsonFx.dll ICSharpCode.SharpZipLib.dll KIPCPlugin.dll

    But the equivalent command on Windows gives me an error saying the KIPC service could not be found:

    
    C:\Python27\Scripts\krpc-clientgen.exe cpp KIPC --ksp C:\KSP\1.1.3.1289 KRPC.SpaceCenter.dll kOS.dll kOS.Safe.dll JsonFx.dll ICSharpCode.SharpZipLib.dll KIPCPlugin.dll

    I've tracked it down to KRPC.dll failing to dynamically load the types (due to a workaround in the code for an old Mono bug that's no longer necessary...) I've put together a patched version of krpctools for you to try. Install it using:

    
    pip install --upgrade https://krpc.s3.amazonaws.com/deploy/bug/servicedefs-type-loading/571.1/krpctools-0.3.5-3-gb9d0f6d.zip

     

    Will give that a go tonight.  If all goes well, I'll have a proper release ready.

  11. 1 minute ago, djungelorm said:

    Just noticed in your previous post that you're calling ServiceDefinitions directly. The intended way to do it is to call the "krpc-servicedefs" python script. For example:

    
    pip install krpctools
    krpc-servicedefs C:\path\to\ksp KIPC .\kOS.dll .\kOS.Safe.dll .\ICSharpCode.SharpZipLib.dll .\KIPCPlugin.dll

    The script copies various DLLs to a temporary directory then runs ServiceDefinitions.exe. Simplifies the arguments slightly. You can run krpc-servicedefs --help for more info

    Do you mean krpc-clientgen?

    I tried that originally and went to calling servicedefs directly to to eliminate possible causes, but I've had no luck either way.

    Discovered that there's also a krpc-servicedefs (hmm), and same result:

    (venv) D:\git\KIPC>krpc-servicedefs KSP\ KSP\GameData\kOS\Plugins\kOS.dll KSP\gamedata\kos\Plugins\kOS.Safe.dll KSP\gamedata\kos\Plugins\ICSharpCode.SharpZipLib.dll KSP\GameData\KIPC\Plugins\KIPCPlugin.dll
    
    Error: b"Failed to load assembly 'KSP\\gamedata\\kos\\Plugins\\kOS.Safe.dll'.\r\nCould not load file or assembly 'kOS.Safe, Version=0.20.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)\r\nAn attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.\r\n"

     

  12. 10 minutes ago, djungelorm said:

    Yep, you need to be in the flight scene. Currently the APIs are only available in this scene. Making the APIs available from others scenes, like the space center view, is on the todo list for the next version!

    Are you still having issues with this?

    The tool works by loading each of the DLLs passed via the command line using Assembly.Load(...) and then scanning them for the named service. So you will need to pass the path to your service DLL, and the paths of all it's dependencies (which I guess is just KOS.dll?). The script assumes KRPC.dll is referenced (and has a copy of it) so you don't need to specify a path to that.

    I have.  Either it doesn't find the service (if I fail to reference KOS), or it complains about the KOS DLL: 

    An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

    My passing KRPC.dll along was in efforts to try to get things to work.  (But I also use KRPC.SpaceCenter); at one point I passed it every single DLL I had in gamedata.

  13. 7 minutes ago, Steven Mading said:

    As far as we can tell, it's because kOS is on .NET 3.5 while the mods it's having trouble with are on .NET 4.x.  The methods you're supposed to use to do reflection changed their underlying implementation a bit between those .NET versions.  If you use the .NET 3.5 version of those methods to read through something made with .NET 4.x, it throws an exception.  Supposedly KSP mods aren't supposed to be using .NET 4.x yet, but something magic we don't understand is happening in the stock game that allows some mods to be getting away with it.

    The fix is to not attempt to use reflection on the mods who's .NET version is > 4.0 and have the rule that if you want to use kOS"s ADDON system your mod must be using a version of .NET older than 4.0.  Everything else @hvacengi was talking about was about finding a good way to accomplish this.

    Except I could have swore that I had built my own mod a couple times using the .NET 4.5 profile and it registered with kOS just fine.  I ultimately dropped it down because I kept trying to use functionality that doesn't exist, but had no problems otherwise.

    Is kOS built using the .NET 3.5 profile or the unity one?  I wonder if that's the difference.  (I also wonder if it's because you are checking parent classes for attributes).

  14. 6 hours ago, LtMtz said:

    Im pretty sure im doing something dumb but it would be kind if you could tell me what i'm doing wrong.

    Thanks in advance!

    Best wishes,
    LtMtz

    Your Python code is looking for the value of a variable named 'test' rather than using "test" as a string.  Similar for VAB.

    I'm guessing that you're new to Python.  You may want to familiarize yourself with the language itself before using kRPC -- there's a tutorial in the Python docs, or you might try one of these: (Disclaimer: I can't vouch for any of these, but I've heard the first one come up fairly often)

    http://learnpythonthehardway.org

    https://hourofpython.com

    https://www.codecademy.com/learn/python

    Or asking for good resources on the Python IRC channel: https://www.python.org/community/irc/

  15. 8 hours ago, Waz said:

    A mod loading the dll of every other mod seems to violate the Golden Rule - it would be O(n²). You could argue that kOS is "special ", but couldn't you use config entries to determine what mod DLLs you need to load? That would be faster, more stable, and would allow ModuleManager magic.

    To clarify, having looked over what kOS does, it's not technically loading anything.  It's looking over a list of all DLLs that have been loaded and scanning them for classes that have a given attribute using something called Reflection.  This is a fairly common practice in the C# world, and KSP itself uses it extensively to do things like load addons/scenarios/part modules. Other addons use it too: kRPC uses it for pretty much the same reason kOS does, and my own mod also does it for its own startup.  It's pretty much the best way to track a list of implementations of something without having to hard-code that list.

    What I don't understand is why kOS encounters the errors in the first place when none of the other implementations do, again this is with me having looked at the code involved.  But this is moot anyways, since as @hvacengi said it will be restricted to only scanning DLLs that declare KOS as a dependency or match the naming scheme.

  16. 8 hours ago, djungelorm said:

    String[] is not a valid parameter type. You need to use an IList<String> for the KIPC.ResolveVessels function.

    @PeteWasEre

    Long since fixed, and I'm back to the problem of either it can't load kOS's assemblies or it can't find the service.  The latter occurs if I don't include the kOS DLLs in the command or I try my workaround of using a tool that strips all of the code from an assembly and just leaves behind the declarations.

    I have my plugin working otherwise (pushed 0.1.1 last night) but the usage is currently limited to clients that don't need the service definitions.

  17. Version 0.1.1-dev2 is now available; links in the first post.

    0.1.1-dev2 (2016-07-12)

    • Added KIPC.GetMessages and KIPC.CountMessages for better control and information about the message queue.
    • Added KIPC.ResolveBodies and KIPC.ResolveVessels to handle multiple bodies/vessels at once.
    • Added KIPC.GetProcessor to retrieve the kOSProcessor of a single part (compare to KIPC.GetProcessors which receives all processors on a given vesse)
    • Added KIPC.GetPartsTagged to find parts with a given kOSNameTag.
  18. 4 hours ago, Rocket In My Pocket said:

    Free to play is dying, it doesn't work from a monetary stand point unless you are League of Legends.

    It was nothing but a trend, and a short sighted one at that. At this point, it's typically only employed as a last ditch effort by failing MMO's.

    Good riddance to bad rubbish.

    I don't think F2P is going anywhere anytime soon.  Even though a given F2P game may be at best a mediocre success that fizzles out after several months, it still likely turned a profit for the developer... profits that are possibly funding the next F2P title they release that builds on tech the current product already paid for.  As a bonus, their fans have to buy all the perks for the new game again.

    In the era of subscription based MMOs, everyone tended to debate over whether a particular title would be the WoW-killer, or laugh at titles that managed only a few hundred thousand subscribers vs WoW's millions -- forgetting that a mere hundred thousand subscribers are $15/month is quite a respectable amount of revenue.  Those MMOs were not always the wild success that WoW was, but still successes.

     

     

  19. 2 hours ago, E-Rikkie said:

    I will use my (old) radeon hd3870 in the beginning but will buy a rx-480 in a few months. And it will run linux on a ssd i already have.

    It may have changed in the last couple years, but I remember people having very little luck getting KSP, Linux and ATI cards to play nicely.  When I dual booted Mint during 0.90/1.0 so I could run 64-bit KSP, I was glad to have the nvidia card

×
×
  • Create New...