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.

Script/feature for picking GPS coordinates from lcd/text panels

Discussion in 'Programming Questions and Suggestions' started by Maybesomeday85, Jun 12, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Easy way to pickup and activate GPS coordinates from text/lcd panels.
    So i am looking for someone who could do this. I tried and failed big time.
    Currently you have to do this

    -Press 0 to unequip weapons/tools
    -Left click text/lcd panel
    -Esc
    -Press i go to GPS sheet
    -Click grey GPS coordinates
    -Click show on hud

    Is there any easy way to make script in game which would pickup and show new coordinates with one click? Or possible for developers add feature which would do this?

    I have made scenario where player needs to pick up those coordinated using following method and it kinda interrupts the natural flow when you need to manually activate those coordinates. I know there is mods that give you next GPS coordinates when reaching previous but i prefer to go with 100% vanilla. And in a way that player are given rough coordinates and player needs to explore area, in order to find out where to go next

    My world to show where it would be used and how.
    http://steamcommunity.com/sharedfiles/filedetails/?id=940985066
     
    • Like Like x 1
  2. Wicorel Senior Engineer

    Messages:
    1,242
    In-game scripts do not have access to GPS coordinates.

    So there is no way.

    As you said, you can do this in MOD scripts.
     
  3. Maybesomeday85 Trainee Engineer

    Messages:
    61
    So basicly cant do that with 100% vanilla without developers help. I allso discovered that you dont need to unequip and left click to pick those coordinates just pressing F is enough. Allthough since game allready pickups GPS coordinates from panels with 1 click, developers shouldnt have much trouble chancing settings that coordinates show on hud instead of just adding them to GPS list. Or they would need to add command, that once added in panel would show those coordinates on hud. Other thing that came in my mind is that GPS coordinates remember did they have show on hud on/off when copied. Its up to developers then, do they want to add this sort of commands in game or do they think that this is job for mods.
     
  4. Wicorel Senior Engineer

    Messages:
    1,242
    They have said before the did not want to provide access for in-game scripts.
     
  5. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Ah ok. Then it would need to be feature in game or need some settings chanced, which is less likely to happen since mods allready does that job. I just like the idea being able to make 100% vanilla scenarios with programmable block and ingame features, instead of mods. But time will tell what developers do. (Fingers crossed) ;)
     
  6. Regn Trainee Engineer

    Messages:
    74
    I've written a "Planet Database" script that stores the follow information about planets

    - Planet ID
    - Planet name
    - Planet position from IMyCamera (Raycast) and IMyShipController (TryGetPlanetPosition)
    - Planet estimated radius from IMyCamera (Raycast.BoundingBox)
    - Planet maximum elevation from IMyShipController (TryGetElevation.Sealevel)
    - Planet minimum gravity from IMyShipController (GetNaturalGravity)
    - Planet maximum gravity from IMyShipController (calculated from minimum gravity, lowest possible gravity, and lowest to highest elevation)

    The data is stored in the programmable block, and if I choose to store it in a log on an LCD as well, I won't lose any data when the script is recompiled, or if the ship loses power, and since it goes full circle (the programmable block takes data from the log, and the log takes data from the programmable block), I'm free to edit the data via the LCD.

    In another part of the script it detects how far a Jump Drive can jump (picks the Jump Drive that can jump the farthest) and allows you to write which planet you want to jump to via the LCD. Once you write the name of the planet, if the name is found in the log, the script will plot a jump course for you to the planet. If you are 5000 km away from the planet, and you can jump 2000 km, it will give you the coordinates to 1999.99 km between you and the selected planet. And here's the cool thing, when you copy&paste these coordinates, they automatically appear in your player's GPS tracker, so that you can simply enter the cockpit and find the coordinates you just copied in your Jump Drive there. It's 100% vanilla.

    You can't edit your player's GPS in any other way, though, because you can only modify grid terminals via the programmable block, and your GPS is not a terminal on your electric grid.
     
  7. Elfi Wolfe Apprentice Engineer

    Messages:
    498
    Lidar Mapping Script will put anything it finds on a LCD and if you push F on that LCD all the GPS points on the LCD will be imported into the Suit GPS computer.
     
  8. EJTH Trainee Engineer

    Messages:
    4
    In the scripts I have made that needs GPS coordinate input I just make the script so I can copy paste the GPS entry into the programmable block CustomData, then parse it.
    Afaik your suit GPS coordinates only lives on the client side where as programmable blocks are executed on the server side (to the best of my understanding)
     
  9. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Still doesnt do what i meant.

    Kinda gave up on thinking keen would do something like this on vanilla game since they think its easy to mod and script this kind of things. Well guess what its not for most of us. And if it would be on vanilla game its less likely to broke after update.
     
  10. EJTH Trainee Engineer

    Messages:
    4
    Well I don't think that copy and pasting something or parsing the GPS format is hard at all. I understand your frustration that a space game doesn't have touch panels ^^.

    Anyhow here is what I do to make it easy to put in GPS coordinate in a custom script
    Code:
        String[] gps = Me.CustomData.Split(':');
        if(gps.Length > 5){
          Vector3 v = new Vector3(Double.Parse(gps[2]),Double.Parse(gps[3]),Double.Parse(gps[4]));
        }
    
    Theres probably a more concise way to do it, but im not really a C# guy.
     
  11. Wicorel Senior Engineer

    Messages:
    1,242
    You want Vector3D, not Vector3 (which is float).

    But otherwise, this will work.
     
  12. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Well i dont still understand how i can get coordinates from lcd panel so that it automaticly shows it on hud with 1 mouse click or by pressing F.

    You can just paste coordinates to lcd panel and when you click it suit pickups those coordinates but they are grey, so you have to manually find them in GPS menu and click show on hud.
     
  13. Elfi Wolfe Apprentice Engineer

    Messages:
    498
    Keen did that. if you see a GPS coordinates in the LCD by opening the LCD the suit auto pulls that info into the GPS in the suit.
    I just wrote it in that format.
    But you cannot do it the other way. no way for script to pull gps coordinates from the suit.
     
  14. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Yes it pulls GPS from lcd but they are still grey and you have to click show on hud.

    I feel so stupid right now. Again.. I must be doing something wrong.
     
  15. Pharap Apprentice Engineer

    Messages:
    175
    If you're up for the mod option, it's almost certainly possible.

    Adding and activating GPS coordinates from a Mod is relatively easy, here's an example:

    Code:
    var gps = MyAPIGateway.Session.GPS.Create("name of gps entry", "description of gps entry", position, false); // Creates GPS
    gps.ShowOnHud = true; // 'Activates' it (i.e. it shows up on the hud, it's blue, not grey)
    MyAPIGateway.Session.GPS.AddGps(player.EntityId, gps); // Syncs to the server in multiplayer
    
    Not sure how to handle the looking at and pressing F part though.
    It'll probably involve a raytrace or something.
     
  16. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Yeah there is way to do thing that i want. But it involves either using scenario editor or mods. Its just that i liked that it would be in vanilla game since updates are more likely to break things when you use those.

    So thing is that i want to get new coordinates when reaching current coordinates. That 1 click option from panel would be nice. You need those panels to be intact so you know where to go next, you cant just gravity bombard location to pieces.

    Depending what kinda code keen uses in best case scenario they would need to change one line true/false option. But well its still beta and developers do their best to make game better for everyone and it seems that i am the only one whos asking this chance. So its not very high priority, they have much more to do.
     
  17. Pharap Apprentice Engineer

    Messages:
    175
    Updates could break ingame scripts or the scenario editor too.
    It's just a chance you have to take sometimes, that's the curse of early access.

    I agree it would be nice to do such things in vanilla, but unless Keen unlocks the GPS API that won't happen. I don't know why they won't, aside from the possibility of someone adding multiple GPS signals I can't see how it could be misused badly enough to warrant their removal.

    I think that would be possible with the visual scripter but I'm not sure.
    I know you can activate events when a player steps inside a certain region, but I don't know if it has a GPS interface. I've never used the visual scripter, I prefer good old fashioned code to node editors.

    It's possible that it might be as simple as that, but the problem is more about what most players want rather than how difficult it would be.

    Part of the problem is that there might be other players with the opposite view saying they'd find the GPS locations turning on automatically to be annoying. Personally I rarely use that feature so it wouldn't bother me either way.

    Have you tried making an issue on the feedback area?
    https://feedback.keenswh.com/
    You might find it gets some interest, and at the very least someone from keen is likely to read it at some point. Make sure to word it carefully and make it obvious what you're asking though, ambiguous or badly worded suggestions almost always do badly.
     
  18. Maybesomeday85 Trainee Engineer

    Messages:
    61
    I have made suggestion in suggestion area in forums.
    https://forums.keenswh.com/threads/suggestion-gps-picking-from-text-panels.7395270/
    And now that i look how i have written that text it is kinda hard to understand what i was suggesting.:?

    I will make thread there allso, since that seems to be place what developers actually watch. And i try to make it more clear what i am suggesting.
     
    • Like Like x 1
  19. Pharap Apprentice Engineer

    Messages:
    175
    Yeah, I think it's either an attempt to streamline their workflow or because the forums aren't as popular as they used to be.

    Something like "Make GPS signals obtained from LCDs visible on HUD by default." would be a good descriptive name.

    Then in the main text state mention your specific reason for wanting them, but also mention how it could benefit other players.
    I suspect you're not the only one who wants to use a GPS from an LCD very soon after obtaining it.
     
    • Like Like x 1
  20. Maybesomeday85 Trainee Engineer

    Messages:
    61
    Used that description couldnt have nailed it better my self.
    Took some time but now i think its more clearer what i want and how it could benefit others.
    Thank you for helping me out. :tu:;)
    https://feedback.keenswh.com/idea/m...-lcds-visible-on-hud-by-default-59e3c04aa97c6
     
    Last edited: Oct 15, 2017
    • Like Like x 1
  21. Pharap Apprentice Engineer

    Messages:
    175
    No problem, I think it's a perfectly reasonable request.
    At least this way Keen will probably look at it and make a decision, and hopefully if there are people who do/don't like the idea they'll reply and say why.

    I decided to drop a vote from something else I was voting for so I could add one to this.
    It's a shame we only get 20 votes.
     
Thread Status:
This last post in this thread was made more than 31 days old.