sirkut / InfernalRobotics

Update to r4m0n Dammed Robotics that works on Kerbal Space Program 0.20.2
Other
17 stars 16 forks source link

[feature] Show rotation and rotation axis numbers on rightclick menu for the part? #24

Closed Dunbaratu closed 9 years ago

Dunbaratu commented 9 years ago

Preferred Proposal:

Would you be willing to alter the KSPField parameters for rotation and rotation axis so that they appear (read only) on the right-click popup panel for the IR parts? (I think it's just guiEnabled=true, so it's not a matter of how hard it is, but of whether you're willing to expose the numbers to view).

The reason is for purely selfish reasons but I think IR would benefit from a lot from this too - It has to do with making the mod Kerbal Operating System interact well with IR and get the two to play nice together so users can write scripts that move the robotic hinges. I'm one of the two active devs on the kOS mod at the moment.

We're trying to come up with a good way to let kOS do everything a player could do manually as a pilot. One scheme we are partway through implementing is exposing all the KSPFields, KSPEvents, and KSPActions for PartModules to the kOS script so it can "click" the same buttons the player can click when flying manually, and so it can "look at" the same readouts the player can look at when flying manually, and tweak the same tweakables.

But one problem we immediately thought of is that just because KSPFields have to be public to the other programmers that doesn't mean the maker of the mod wants them to be exposed to users. So we wanted to respect the decisions of all the other mod writers and only expose those KSPFields which are currently visible to the human player in the rightclick panel. If it's not guiEnabled at the moment (or ever), then we won't let users see it.

And that's where this request comes from. We'd like to let kOS scripts "read" the current position of IR hinged parts, since unlike the human player the script can't just look at the screen to figure it out. But those fields are hidden from the gui in IR (because they're actually accessed through IR's own unique gui windows) and we'd have to violate the rule we're trying to adhere to if we exposed them.

A kOS script can move an IR hinge using the action groups, but it can't read where the hinge currently is, at the moment, because we're trying to avoid writing special exception one-off cases for each mod out there.

Secondary, alternate proposal

If you are unwilling to expose these two KSPFields to the user on the rightclick gui panel, would you mind if we made an exception for your mod and allowed kOS users to read them even though they're not on the gui panel? I'm thinking of something involving a whitelist we make in kOS - KSPFields that are on the whitelist are fields we will allow users to access even though they aren't visible on the menu panel.

This secondary proposal would involve absolutely zero work from IR at all - just your blessing for us to do a thing that is already technically possible, but might be a bit rude and unstable for us to implement without your go-ahead.


Thanks for your time in reading this. I think this would benefit both kOS and IR. We get users requesting that they wish they could control IR parts through their kOS scripts a bit better than they can now, where the script has to be "blind" about the current position of the hinge.

ZodiusInfuser commented 9 years ago

I cannot comment on sirkuts plans for IR or whether these proposals go with or against it, but I personally think there's no harm in adding a readout of current angle/displacement to each parts tweakable menu. Could actually make it easier for players without kOS, as they don't have to eyeball things as much.

sirkut commented 9 years ago

Rotation and translation values are now exposed in the tweak menu system. I'm going to close this for now and if there are other requirements I will see about doing more. In fact I need to test this new feature out with kOS. Thanks guys.