Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Ingame Programming missing API and functions and known issues

Discussion in 'Programming (In-game)' started by mexmer, Apr 23, 2015.

Thread Status:
Not open for further replies.
This last post in this thread was made more than 31 days old.
  1. Wicorel Senior Engineer

    Messages:
    1,262
  2. DS_Marine Apprentice Engineer

    Messages:
    494
    Thanks a bunch, that is exactly what I was looking for.
    There's no 'Being piloted' flag on a grid, but he loops thru all IMyShipController entities (which I didn't know about) and checks for IsUnderControl.
    Also I have applied some good improvements/fixes and suggested these to the author.
     
    Last edited: Dec 22, 2015
  3. mexmer Senior Engineer

    Messages:
    1,977
    you asking in wrong topic, but anyway, there is IMyShipController.IsUnderControl property.

    as for using sensors 2 things
    1) sensor doesn't detect person in cockpit (unless it was changed, have not checked it lately)
    2) sensor doesn't detect if grid is remotely controlled.

    check IsUnderControl value is probly best way atm.
     
  4. [LR]Neo007ca Trainee Engineer

    Messages:
    4
    I found one missing property on welder that could be useful:

    IMyShipWelder.IsWelding

    From this discussion, this state currently exist in the game so it shouldn't be too hard to add.

    Thank you!
     
  5. [LR]Neo007ca Trainee Engineer

    Messages:
    4
    We should have access to bp folder to LoadBlueprint for projector:
    Code:
    IMyProjector.LoadBlueprint("BpName", Folder.Workshop | Folder.Local);
    The only workaround is to enter the entire path (with current LoadBlueprint method):
    Code:
    IMyProjector.LoadBlueprint(@"C:\Users\SessionName\AppData\Roaming\SpaceEngineers\Blueprints\local\BpName\bp.sbc");
    Which is not really useful (didn't check how bp are managed on server too).
     
  6. DarkInferno Trainee Engineer

    Messages:
    13
    Hey I believe this is the right place to post. But I think a missing piece of functionality is to be able to obtain the altitude readout from the IMyRemoteControl and IMyCockpit block types. They have the option for the hud so the information should be available. I feel this falls under missing functionality as with planets altitude is a concern when writing any type of ship automation when it comes to flight or landing. (You want to ascend if you are getting close to the ground when flying straight!)
     
  7. mexmer Senior Engineer

    Messages:
    1,977
    that falls under cockpit data category, yep.
    we missing lot of hud/cockpit data, since when this was mentioned (in first post), new data were added (mostly related to planets). i have not planed to add specific edits, until at least some of them are implemented.
     
  8. DarkInferno Trainee Engineer

    Messages:
    13
    Gotcha, I went ahead and added it to the suggestion category as well. I have searched high and low for a way to do this.. Altitude I do feel is a pretty large one since there is no way (that I know of) to detect a planets surface, means all altitude based stuff has to be done manually or GPS related, which means it's very static...
     
  9. Krutchen Apprentice Engineer

    Messages:
    159
    So, I'm pretty sure that Jump drives still can't be triggered through anything outside of the toolbar. Which is a total drag for anyone wanting automated jump ships or NPCs that can actually travel large distances.
    Also, as joe pointed out ages ago, we STILL cannot fetch orientation. Hopefully KSWH will get one of their guys back onto updating what we can do with mods and scripting, I want to make my dream fleet of drone ships already :(
     
  10. plaYer2k Master Engineer

    Messages:
    3,160
    But that is not true.
    There is IMyEntity.WorldMatrix which is a MatrixD containing .Translation (position) aswell as all vector directions for their orientation like .Up, .Right and .Forward aswell as all respective opposing directions in world space each.
     
    • Agree Agree x 2
  11. Krutchen Apprentice Engineer

    Messages:
    159
    Does this work for fetching the orientation of other grids? If so, Thanks for correcting me, I must have been looking in all of the wrong places in the documentation last night. I'll read up on this function and see if I can make it work for a small radar mod i'm dicking around with.
     
  12. Digi Senior Engineer

    Messages:
    2,393
    But isn't IMyEntity not allowed in PB ? It's not in the Ingame or Interfaces namespace.

    EDIT: Well, this is weird.
    Sensor's LastDetectedEntity returns VRage.ModAPI.IMyEntity which is allowed but not included, you can use VRage.ModAPI.IMyEntity to store an entity reference.
     
    Last edited: Jan 11, 2016
  13. plaYer2k Master Engineer

    Messages:
    3,160
    Well it is "tricky". Even though the IMyEntity is not "deeply whitelisted" (in lack of proper terminology) like the whole ModAPI.Ingame namespace, it still is accessible as reference aswell as a very few methods and properties are like .GetPosition() and .WorldMatrix are accessible too.
     
  14. AlexDenton Trainee Engineer

    Messages:
    89
    the top speed on IMyMotorSuspension isnt avaliable yet? I want to set gears for my rover.
     
  15. AlexDenton Trainee Engineer

    Messages:
    89
    found the one,

    wheel.SetValue("Speed Limit", 10f);

    cheers
     
  16. Jaken Veina Apprentice Engineer

    Messages:
    134
    How is foreach being broken not included in this list?
     
  17. StanH Trainee Engineer

    Messages:
    73
    @Jaken Veina can you post an example of a broken foreach? Most of them work for me (only one exception containing a generic function parameter) and I am compiling a list of open PB bugs.
     
  18. Jaken Veina Apprentice Engineer

    Messages:
    134
    @StanH Apparently not, because it issue is gone. I kept getting a runtime exception along the lines of "Common Language detected an invalid script", even on the simplest of implementations. When I made a list, added several elements by hand, and tried to foreach it, and got the same error, is when I gave up. I just tried several things that I definitely couldn't do before, and they all work fine. I guess the latest update fixed the problem.

    ~ EDIT ~

    Correction. foreach() is still very much broken, as confirmed by another player trying to use a script I published, but ONLY IN SERVERS. In singleplayer, foreach() works just fine. The exception is "Common Language runtime detected an invalid program", caught at runtime, rather than compile.

    ~ EDIT ~

    So, for the sake of anyone else encountering this issue, .NET needed an update on the server. Was running 4.0 when the latest is 4.6.1.
     
    Last edited: Jan 19, 2016
  19. Wicorel Senior Engineer

    Messages:
    1,262
    Updates

    BUG: ElapsedTime doesn't work as intended, so this isn't 'done'.

    With Planets, we need to add 'Altitude' to this list (or maybe to remote control?

    - Need to be able to set rotation for wheels so that scripts can control movement of wheeled vehicles.
    - should be able to get current rotation for wheels.

    Also
    IMyThrust
    - should be able to get current thrust output (in kn or as percentage of max)
    - should be able to get maximum thrust output in KN

    We did get ability to add locations to the list and remove all.
    This is probably 'good enough'

    - Max range is so low as to severly limit the use of sensors.

    - Gravity information was added to remote control
    - Altitude should go here?
    - missing power information
    - not in UI yet, but Marek has said they'll add it to UI: Hydrogen level as fuel gauge
    - current simspeed would also help a lot since ElapsedTime is not correct.

    BUG: GetPrivateText always returns "" instead of the contents of the private text.


    Other: foreach problems.
    Instruction Injection causes problems.

    UI Issues:
    A PB in a command bar does not show the command argument that is being passed.
    - When right-clicking on the item in G menu, it should populate the 'argument' dialog box with the current argument parameter.
    - For ALL command bar items: it would be really nice to be able to set 'tool tips' like button panels for the command bar items so the ship designers can provide meaningful help to the pilots of the craft.
     
  20. mexmer Senior Engineer

    Messages:
    1,977
    thanks for update, i will do it somewhat later.
     
  21. d4rky1989 Apprentice Engineer

    Messages:
    332
    I think this is already possible by using
    Code:
    IMyTerminalBlock.GetMaximum<float> ("Override")
     
  22. Wicorel Senior Engineer

    Messages:
    1,262
    It used to.

    Now override goes from 0 to 100%. So 'maximum' is 100 for all thrusters.
     
    • Like Like x 1
  23. plaYer2k Master Engineer

    Messages:
    3,160
    Oh my god, you are right!
    I didnt bother doing much in SE programming lately so i didnt notice that impact.

    The change itself was annoying enough already and the good old slider in newton was great, i really dont know why keen changed it.
    Its an engineering game. Any step further away from proper values (i.e.: X kN, Y MNm, Z m) makes it only worse.
    Imo even gravitational acceleration should be in m/s² and not g as that only dumbs it down. But well, thats just my opinion.

    I really hope the override scale gets undone again.
    There should be "official" polls for these changes though with keens attitude to do changes, even if they are so small with yet huge impacts, without telling anyone.
     
  24. Krougal Senior Engineer

    Messages:
    1,012
    I dunno about polls, but at least mention these things in the changelog.
     
  25. plaYer2k Master Engineer

    Messages:
    3,160
    Sad fact is that once one notices them, it usually is too late.
    Also posting in these overly spammy change log threads generally ends up being unheard anyway from my experience.

    Much communication often feels being unheard by the devs because there very rarely is any comment on the current state, changes, in discussions etc. Which is why i highly suggest and point towards a position like a proper community manager for months already. Some person who stands inbetween the community and the devs. Who gathers the current flow of chatter and topics in this forum, reddit, steams forum etc to , who produces community events and alike. I actually even thought that this would be what @Xocliw got hired for but besides from the streams i didnt see much that indicates it is what i hoped it would be.
    That is of course no offense as it matters what his task actually is aswell as what the schedule has assigned.

    To sum that all up, i wish we had need more feedback on:
    - suggestions (some official statements on how well they play along with the current idea of the games design aswell as what could be an issue from a design perspective)
    - community discussions about feature/change XY (How does it fit into the game or how doesnt it. What are issues with X or Y.)
    - bug reports (@Phand was doing a great job and i have seen some more devs getting involved in bug replies but it overall feels that less bug reports get replied by devs than like a year ago. I however dont know if that is because dev activity went down or because bug report activity went up.)

    I know some argue that either Mareks blog is enough of that if a dev says something it gets weighted too much and many dont take it with a grain of salt but instead pour it into open wounds. Though a "culture" has to be taught at some point and imo nothing is more valuable than an open and honest communication. Example: The ongoing silence about Git and any API progress.
     
    • Agree Agree x 1
  26. Krougal Senior Engineer

    Messages:
    1,012
    LOL. I meant Keen putting items in the changelog, not us putting them in the feedback thread, if I were them I would stop reading it after the 2nd page.

    I concur. I brought up a community manager, but since it was in a thread (I wasn't the OP!) that was destined for flamewar it was poorly received (didn't help that I led off with a bad joke)
     
  27. Grounds Keeper Willy Trainee Engineer

    Messages:
    11
    Would also be great for automated sounds to allow changing of audio tracks

    IMySoundBlock
    - get current track
    - get current track length
    - get current time for playing track
    - set a track
    - set skip to position in track

    By also adding sound packs, although there are mods available already, you could allow for full sentence construction.

    For exmaple by adding audio for 1-10, 11..19, 20,30..., "hundred" so on you can have full count downs, distance read outs and so on.
     
  28. mexmer Senior Engineer

    Messages:
    1,977
    this thread is not about what you like to implement, but about functionality and information that exists ingame (trough either HUD, terminal UI, player block interaction or block to block interaction), but PB has no means to access it.
    if someone made mod, that acts like media player it's fine, but default sound block doesn't have such functionality, so extending it is up to moders, or write your own script that will do it by utilizing basic functionality.
     
  29. Malware Master Engineer

    Messages:
    9,866
    I'm using GetPrivateText with success? Is this another DS/MP specific thing, or was it broken last thursday?
     
  30. mexmer Senior Engineer

    Messages:
    1,977
    afaik getprivatetext, as well as setprivatetext text is broken in DS/MP, setprivatetext is not working properly even on SP,because setter is written incorrectly (fix is on github)
     
Thread Status:
Not open for further replies.
This last post in this thread was made more than 31 days old.