Jump to content

[Abandoned] LightSwitch Interface


Razchek

Recommended Posts

Haha awesome! Thanks for the swift responses, I look forward to the update! :)

You're welcome. :P

I thought I'd throw a bunch of these onto a vessel and toggle them all (to test the action grouping of course).

Looks.. weird lol.

uutjg1dl.jpg

Edit: eww, jpg..

Edited by Razchek
Link to comment
Share on other sites

Update 0.01.1a is out. Check the first post. :)

The code below for your interface I just realized something, you're defining a label inside a label twice. :P

MenuItems
{
...

Label
{
Label
{
Text
{
Binding = Resource
Name = Metal
}
Prefix = Metal:_
Suffix = _units
Color32 = 153, 153, 153, 190
}
Label
{
Text
{
Binding = Resource
Name = RocketParts
}
Prefix = Rocket_Parts:_
Suffix = _units
Color32 = 102, 34, 0, 190
}
}

Here's how it should look (the whole interface with the fix):

MenuItems
{
Label
{
Text = Mining Status:
Color = 1, 1, 1, 0.75
}

Label
{
Text
{
Binding = Resource
Name = ElectricCharge
}
Prefix = Electricity:_
Suffix = _units
Color32 = 255, 255, 0, 190
}

Label
{
Text
{
Binding = Resource
Name = Kethane
}
Prefix = Kethane:_
Suffix = _units
Color32 = 51, 255, 0, 190
}

Label
{
Text
{
Binding = Resource
Name = Ore
}
Prefix = Ore:_
Suffix = _units
Color32 = 204, 0, 0, 190
}

Label
{
Text
{
Binding = Resource
Name = Metal
}
Prefix = Metal:_
Suffix = _units
Color32 = 153, 153, 153, 190
}

Label
{
Text
{
Binding = Resource
Name = RocketParts
}
Prefix = Rocket_Parts:_
Suffix = _units
Color32 = 102, 34, 0, 190
}
}

Oh and you can use either Color OR Color32. The limitation is that you can only use one of those in the node (not both in one node). :)

Edited by Razchek
Link to comment
Share on other sites

I thought I'd throw a bunch of these onto a vessel and toggle them all (to test the action grouping of course).

Awesome!

you're defining a label inside a label twice.

Aha! Yeah that must have happened as I was copy and pasting nodes and changing the resource and color. It's always something small I miss :rolleyes:

Oh and you can use either Color OR Color32..

Yeah I was using color32 because I found a hex > color32 converter that I used while referencing hex charts. I just had forgot to change the alpha value to a color32 value.

Thanks for pointing that out! It all works now!

z9IyFxEl.jpg

7mLQMfrl.jpg

Now I just need to work on my color scheme...

Link to comment
Share on other sites

just tried the update..action grouping is nice. I still remember when I discovered action groups..completely changed the way I built my rockets :)

Anyways, I'm not sure if it was added in the 0.1.1a release or if it's been there from the start, but I just noticed that when I loaded my VesselStatus interface that displays Electricity, LiquiFuel, Oxidizer, and MonoPropellant onto a ship with no RCS it said "Temporary" in the name space. I thought that was a nice little additive in case you were ever to dock a ship to it with RCS.

Made a new "Environment Status" interface and LatAndLong works now.

TuUijeSl.jpg

Cool stuff keep it coming! Now to dive into Buttons :cool:

Link to comment
Share on other sites

Your mun station? looks fricken awesome btw. :)

Oh and a neat trick I forgot to mention (will post it in updates later) is that you can rotate the interface around on it's Y axis. So you could have (for example) in that last screenshot you posted with the pod that has an interface on the left and right. You could rotate the one on the right by 180° to have it facing the right way. ;)

Add YRotationOffset = 180 into your part config in the module where you define InterfaceName. :cool:

:o *mindblown* This... you destroyed my brain... SO MUCH AWESOMENESS!

Thank you. >_<

Edited by Razchek
Link to comment
Share on other sites

Your mun station? looks fricken awesome btw. :)

All credit for that goes to pasty2k2. I was messing around with Extraplanetary Launchpads and could not, for the life of me, get all the components into space and onto another celestial body..let alone alll in one shot :P

pasty2k2 was kind enough to upload his craft file for me and I'm sure he wouldn't mind if anyone else uses it. Warning though it uses a lot of mods, I only had to add like two and I just grabbed the individual parts that he used and dumped the rest so they didn't have to be loaded into RAM.

Link

Add FONT=Fixedsys]YRotationOffset = 180 into your part config in the module where you define InterfaceName.

Was kinda confused there for a second with the unfinished tag and whatnot but I figured it out :P Neat trick! I may just end up making two sets of parts...

Or..new suggestion: add a button to the right click menu of the part to toggle the display 180 degrees each time it's clicked. If that's possible..would save me having to be absolute of the placement of the projectors before launch. Maybe add a button for vertical flopping as well in case we put the part on upside down without noticing.

Link to comment
Share on other sites

I am absolutely loving playing around with this. I'm slowly getting the knack of it. Is there any way you could post the configs you used for the Kethane demonstration video you have on YouTube? It would be great if you ended up with a small database of configs that users have submitted.

Keep up the brilliant work, this just blows me away :)

Link to comment
Share on other sites

I can submit mine as well as long as Razcheck is cool with it :)

That would be great if he is OK with it. It was mostly by studying your pictures that helped me understand what to do. Have you had any luck with buttons yet?

Link to comment
Share on other sites

You can distribute the interfaces you make freely. :)

For using plugin libraries' methods in your interfaces as long as the targets you use are already exposed as public or protected members/class of other public or protected classes then there should not be a problem.

If you still feel uncomfortable or it is explicitly noted in the author's plugin that you are not allowed to do this, you could ask the author of the plugin to provide clarification on whether you are allowed to use specific methods and/or classes for use with this project.

MenuItems
{
Label
{
Text = Kethane
Color32 = 0,0,0
}

Label
{
Text
{
Binding = KSPField
Path = Kethane.KethaneExtractor.Status
}
Prefix = Drill Status:_
Color32 = 0,128,0
}

Button
{
Text = Deploy Drill
Type = Method
Target = DeployDrill
}

Button
{
Text = Retract Drill
Type = Method
Target = RetractDrill
}

Label
{
Text
{
Binding = Resource
Name = Kethane
}
Prefix = KReserve:_
Suffix = _units
Color32 = 0,200,0
}

Label
{
Text
{
Binding = Resource
Name = ElectricCharge
}
Prefix = Electricity:_
Suffix = _units
Color32 = 0,50,200
}

Label
{
Text
{
Binding = Environment
Type = LatAndLong
}
Color32 = 255,70,0
}
}

I've noticed a bug after testing this again. Buttons are at the bottom regardless of the position in the interface config. This _may_ be fixed in the next update depending on my progress with the in-game interface designer. :)

Link to comment
Share on other sites

That would be great if he is OK with it. It was mostly by studying your pictures that helped me understand what to do. Have you had any luck with buttons yet?

I've been relaxing this Sunday, so I haven't dabbled into the buttons yet, that'll be a project saved for when I wake up.

But for now here's a link to my custom interfaces.

Just merge it with your GameData folder and you should have 3 new interfaces:

MiningStatus - displays current amount of Electricity, Kethane, Ore, and RocketParts

VesselStatus - displays cuurrent amount of Electricity, LiquidFuel, Oxidizer, and MonoPropellant

EnvironmentStatus - displays current Temperature, Gravity, Acceleration, Pressure, and Latitude and Longitude

Each interface has its own corresponding part that goes with it, so be sure to add all the interfaces you want in the VAB before launch.

Note: You need the original mod from the OP for these to work, the mod is not included. Also if you use an interface on a ship that has 0 storage for a particular resource, it will just say "Temporary" where it would normally show the resource name and amount.

@Razcheck - The link I have provided includes my interfaces with their respective edited parts that I made..if this is against your policy, I will take it down immediately and provide an interface only archive. I just figured since the interfaces need to be referenced in the part config that I'd upload the individual parts as well for those less inclined to make that connection.

Link to comment
Share on other sites

The link I have provided includes my interfaces with their respective edited parts that I made..if this is against your policy, I will take it down immediately and provide an interface only archive. I just figured since the interfaces need to be referenced in the part config that I'd upload the individual parts as well for those less inclined to make that connection.

That's fine. ;) You only need to ask if you're going to distribute the assembly (plugin) or source code.

Feel free to call me Raz, that's easier to type than the full horrible alias lol.

Link to comment
Share on other sites

Awesome stuff. I used a slightly different method for creating the multiple parts, I only keep one part but modify the config to create 3 different version of the part.

PART {

// --- general parameters ---
name = LSGUI_Mining
module = Part
author = Razchek | Hubs.co.nz

// --- asset parameters ---
mesh = LSGuiModel.mu

// --- node definitions ---
node_attach = 0.038, 0.0, 0.0, 1, 0, 0

// --- editor parameters ---
cost = 750
category = Utility
subcategory = 0
title = L.S.I Projector MkI Mining
manufacturer = Hubs' Electrical
description = A clean-cut external projection computer module for controlling vessel mechanics.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,1

// --- standard part parameters ---
mass = 0.0005
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900

MODULE
{
name = LSPartModule
InterfaceName = LSGUI_Mining
}
}

PART {

// --- general parameters ---
name = LSGUI_Environment
module = Part
author = Razchek | Hubs.co.nz

// --- asset parameters ---
mesh = LSGuiModel.mu

// --- node definitions ---
node_attach = 0.038, 0.0, 0.0, 1, 0, 0

// --- editor parameters ---
cost = 750
category = Utility
subcategory = 0
title = L.S.I Projector MkI Environment
manufacturer = Hubs' Electrical
description = A clean-cut external projection computer module for controlling vessel mechanics.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,1

// --- standard part parameters ---
mass = 0.0005
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900

MODULE
{
name = LSPartModule
InterfaceName = LSGUI_Environment
YRotationOffset = 180
}
}

PART {

// --- general parameters ---
name = LSGUI_Vessel
module = Part
author = Razchek | Hubs.co.nz

// --- asset parameters ---
mesh = LSGuiModel.mu

// --- node definitions ---
node_attach = 0.038, 0.0, 0.0, 1, 0, 0

// --- editor parameters ---
cost = 750
category = Utility
subcategory = 0
title = L.S.I Projector MkI Vessel
manufacturer = Hubs' Electrical
description = A clean-cut external projection computer module for controlling vessel mechanics.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 0,1,0,0,1

// --- standard part parameters ---
mass = 0.0005
dragModelType = default
maximum_drag = 0.0
minimum_drag = 0.0
angularDrag = 0
crashTolerance = 6
maxTemp = 2900

MODULE
{
name = LSPartModule
InterfaceName = LSGUI_Vessel
}
}

That creates 3 different versions using only 1 model.

Note that I used slightly different interface file names though

Edited by scottholio
Link to comment
Share on other sites

That's cool. :) In the future I'm hoping you wont need to do this, at the moment I'm working on an in-game interface designer (coming along nicely :D) that will save a lot of effort. I want to get this implemented early stages so that during alpha and beta stages people have a more user-friendly way to interact with this plugin.

The interfaces will then be assignable in-flight. I'm not sure yet whether I want to enable mid-flight interface editing, at the first stage that will be restricted to the VAB/SPH.

That's my plan at least. :)

Oh and don't worry, the VAB/SPH will be inactive during the interface edits so no click-through happens with the GUI interactions.

Link to comment
Share on other sites

Awesome stuff. I used a slightly different method for creating the multiple parts, I only keep one part but modify the config to create 3 different version of the part.

Very cool! I didn't realize you could do that. That's cool. So when you add an interface all you have to do is add the code to the original part config and just name it differently. I like your naming scheme better :P

at the moment I'm working on an in-game interface designer

Sounds awesome can't wait!

Oh and don't worry, the VAB/SPH will be inactive during the interface edits so no click-through happens with the GUI interactions.

I wish other modders knew how to do this. That's one thing I hate when using Simple Part Manager, I make a selection and in the process grab half of my ship and set it somewhere...

Keep it up Raz!

Edited by fractl
Link to comment
Share on other sites

I am absolutely loving playing around with this. I'm slowly getting the knack of it. Is there any way you could post the configs you used for the Kethane demonstration video you have on YouTube? It would be great if you ended up with a small database of configs that users have submitted.

Keep up the brilliant work, this just blows me away :)

This was what I thought also. Many interfaces will be standard, like operating a kethane drill. There should be a repository for common interfaces, or possibly a thread just for them

Link to comment
Share on other sites

This was what I thought also. Many interfaces will be standard, like operating a kethane drill. There should be a repository for common interfaces, or possibly a thread just for them
at the moment I'm working on an in-game interface designer (coming along nicely :D) that will save a lot of effort. I want to get this implemented early stages so that during alpha and beta stages people have a more user-friendly way to interact with this plugin.

The interfaces will then be assignable in-flight. I'm not sure yet whether I want to enable mid-flight interface editing, at the first stage that will be restricted to the VAB/SPH.

That's my plan at least. :)

Oh and don't worry, the VAB/SPH will be inactive during the interface edits so no click-through happens with the GUI interactions.

Won't be needed, Interfaces will be made ingame, Unless I did not understand this right.

Link to comment
Share on other sites

Ok, I've just been playing with the button code for Kethane drills that Raz posted yesterday. If you have multiple drills on a vessel the button only works for one of the drills. Is there a way for it to deploy/retract multiple drills together? Maybe there is a way to assign an action group to the interface button?

Also Raz, for the in-game interface designer, have you seen the mod Actions-On-The-Fly? ActionsOnTheFly

That might be helpful to check out possibly?

Link to comment
Share on other sites

Ive been trying to make a interface for my kethane scanner and i was wondering how you got the drill to deploy ive looked at your script. i want to do the same thing but with the medium scanner, by the same i mean activating it and deativating it.

could you please help?

Link to comment
Share on other sites

Ive been trying to make a interface for my kethane scanner and i was wondering how you got the drill to deploy ive looked at your script. i want to do the same thing but with the medium scanner, by the same i mean activating it and deativating it.

could you please help?

I managed to get it working for scanning, but as I said above this also only works for one of the scanners you have on board. Here is the config:

MenuItems
{
Label
{
Text = Kethane Scanner
Color32 = 0,0,0
}

Label
{
Text
{
Binding = Resource
Name = ElectricCharge
}
Prefix = Electricity:_
Suffix = _units
Color32 = 0,50,200
}

Label
{
Text
{
Binding = KSPField
Path = Kethane.KethaneDetector.Status
}
Prefix = Detector Status:_
Color32 = 0,200,0,190
}

Button
{
Text = Start Scanning
Type = Method
Target = EnableDetection
}

Button
{
Text = Stop Scanning
Type = Method
Target = DisableDetection
}
}

Edited by scottholio
Link to comment
Share on other sites

thanks my problem was i was putting activate detector. and another thing on raz's drill script it said deploydrill. and on the detector you have to put enable.

1.does it matter what you as long as it refers to turning it on and are there specific quotes for different actions

2. could i instead of putting enable and disable, put toggle to save space on the lsi gui

Edited by drswagboss
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...