Simpit-team / KerbalSimpitRevamped

A revamp of the Kerbal Simpit Mod for KSP
BSD 2-Clause "Simplified" License
24 stars 15 forks source link

[Feature]:TimeKeeper Integration #31

Open Lucaspec72 opened 3 years ago

Lucaspec72 commented 3 years ago

Is your feature request related to a problem? Please describe.


There isn't a way to get the number of sols/orbits that the current vessel achieved (example : 42 orbits since the vessel was launched

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]


i need a way to get the number of Sols/Orbits of the active vessel (basicly just get the value from https://forum.kerbalspaceprogram.com/index.php?/topic/178121-18-timekeeper-102-2019-10-17-orbits-and-sols-counter/&tab=comments#comment-3446917)

What is the issue that you are facing, that you would like resolved? How would it benefit players?


adding integration for Timekeeper would allow players to easily get the number of days that went by since landing, or the number of orbits a satellite has done since it was placed in orbit.

Is it an existing/new feature in the game that would benefit from support by this mod?


not that i know of

Describe the solution you'd like

add a way of getting the sol/orbit's value from the mod as a float or something (idk about the format, float is just a example) and a boolean to know whenether the float value are Sols or Orbits

A clear and concise description of what you want to happen.


get the current sol/orbit (sol vs orbit determined by boolean ?) value of the current vessel and the state

How would it be best that the feature is implemented? What sort of data may need to be sent by the mod to controllers? Would it require a digital signal, or an analogue one? Maybe it needs a terminal command to help use it, or a GUI button?


just get the sol/orbit value from the TimeKeeper mod as you do with variables like altitude for example

Describe alternatives you've considered


the only alternative is not adding a day/orbit counter, and it's not that big of a deal, but it would be neat to have

A clear and concise description of any alternative solutions or features you've considered.


none

What about the current features of the program do not quite, if at all, allow you to implement/carry out what you would like to do?


there aren't any

What is the nearest feature in the mod (If there is one), that is along the lines of what you are suggesting?

...

Additional context


the timekeeper mod (https://forum.kerbalspaceprogram.com/index.php?/topic/178121-18-timekeeper-102-2019-10-17-orbits-and-sols-counter/&tab=comments#comment-3446917)

Add any other context or screenshots about the feature request here. Any drawings, screenshots, pseudocode/logic diagrams, and more are all appreciated. Anything that you feel may help others understand your idea would be great!

PBechon commented 3 years ago

Here is the clickable link to the mod.

I think a simple message would be

struct TimekeeperData{
  bool isOrbitMode; //true if counting orbits, false if counting sols
  int count; // number of orbits/sols as reported by the Timekeeper mod
}

The first field should be TimekeeperModule.mode == TimekeeperModule.CountModes.Orbits. The second field should be a copy of TimekeeperModule.count

@Lucaspec72 would that be OK with you ? @LRTNZ What is your opinion on support this mod as an optional dependency ?

Lucaspec72 commented 3 years ago

this would be perfect ^^ (i am a bit worried of the integer limit though, is timekeeper's count also a integer ? if not maybe a float could be better (i think it has a higher max value right ?))

PBechon commented 3 years ago

On Timekeeper side, an int is used. But in C# a int is 32 bit while in Arduino it is a 16bit int. I agree with your point, we should use the same thing on both side. How about this then (since long is 32 bit in Arduino) :

struct TimekeeperData{
  bool isOrbitMode; //true if counting orbits, false if counting sols
  long count; // number of orbits/sols as reported by the Timekeeper mod
}
Lucaspec72 commented 3 years ago

Sounds good.

LRTNZ commented 3 years ago

this would be perfect ^^ (i am a bit worried of the integer limit though, is timekeeper's count also a integer ? if not maybe a float could be better (i think it has a higher max value right ?))

You would be better off using a double as a larger int, than a float in most cases. Unless you want to deal with the imprecision of a floating point number?

Lucaspec72 commented 3 years ago

float was just a example, as long as we can get the value, it's format isn't that big of a deal. (PBachon's comment about using a long sounds like a good idea, since it doesn't have the 16bit limit of arduino integers. never used long variables though so i may be wrong)

PBechon commented 3 years ago

Based on a first try on my part, this seems to be difficult without modyfing Timekeeper. The attributes are not public so cannot be easily accessed from another mod.