Jump to content

[1.2.2](Dec10/16) Action Groups Extended: 250 Action Groups, in-flight editing. Now kOS/RemoteTech


Diazo

Recommended Posts

Did a test with the modified part.cfg as you suggested, still on that install with FAR and those two vessels in game.

Possibly there is a change, because while switching from one to the other vessel and back through the map window ingame, the state is conserved. It sure was lost in my main game doing the same.

However, if I go to the space center and then back to the vessels, both lose some of the actionstates. I am now using only stock parts, and have observed that all antennae lose their states (using communotron 16, DTS-M1 on both, and communotron 88-88 on one vessel). Other parts are not affected, be those solar panels, scientific parts, ladders, reaction wheels.

Link to comment
Share on other sites

Alright, thanks for everything you've done.

At this point anything more will have to wait until I get off work and can get on my KSP computer at home (5-6 hours from now).

I think I know what is going on.

First, the modified ModuleManager part.cfg should fix the majority of the issues you are seeing as it will allow it to load the parts correctly.

Second, I will need to tweak my code to account for the Antenna's having two ModuleAnimateGeneric partModules, so there are two 'Toggle' actions. It also looks like the GUI displays "Toggle Antenna", but the name of the action in code is just "Toggle" so I will have to adjust for this.

If I'm right, I should have the fix for this out tonight. (If I'm wrong, who knows, but I will post about it at least.)

D.

Edited by Diazo
Link to comment
Share on other sites

Heh, you pretty much provided everything that allowed me to solve this. (Hopefully anyway, at this point I know what the problem to fix is, will do the actual code tonight.)

My next test will be tonight when I push Version 1.7b out. At this point you have also shown me how to test the issue on my own machine so the next release should fix it for you as well.

D.

Link to comment
Share on other sites

Version 1.7b Release

-Update to ModuleManger Version 2 (Version 2.1.5 now included in download).

Older versions of ModuleManager should still work but I will not guarantee it.

-Update part.cfg in download to match one from 3 of my posts ago.

-No changes to .dll file. (Expect version 1.7c in the next few days for that.)

@diomedea: I am still unable to replicate either of your issues, even using the Test1.craft file you uploaded. I've updated my modulemanager and part.cfg so I'm hopeful that means the first issue is resolved. That still leaves the antenna names though. Can you please grab the version 1.7b .dll with logging enabled here and then please do the following.

Make sure you have ModuleManger 2 or newer (pretty sure you have 2.1.5 from our previous conversation.)

The part.cfg file in my AGext directory has the lines added from post #174 in this thread. (Again, think you have already done this.)

Before starting KSP, make a copy of your persistent.sfs and any .craft files you will use during testing.

Load the game and try to cause the issues you are reporting.

Click the 'Edit' button on the flight window to dump the current state to the output_log.txt file.

Switch around vessels and toggle group states and action groups, etc. and remember what happens. Make sure to hit the 'Edit' button when you switch vessels, even if you don't actually edit anything. The state of the actiongroups is only recorded to the log when you click that button.

Close KSP and make another copy of your persistent.sfs.

Post the output_log.txt, both persistent.sfs files and any .craft files for me to download and a description of what happened as you switched vessels. (Behaved as expected, or what kind of errors did you encounter? Toggle State, action groups, etc.)

Anyone else who is having issues is free to do this same process also.

That process will give me all the information I could want to actually figure out what is going on which will hopefully let me lay this to rest.

D.

Link to comment
Share on other sites

Still found the same issue, though this time it took a second try through the Space Center for it to show, the first time it seemed all right.

All data collected and a description of the tests is here, hope that is telling something.

Link to comment
Share on other sites

Thank you very much for that, it was exactly what I was expecting.

And thank you for jumping through these hoops, I realize it is a hassle and really appreciate it.

Parsing the data now, will edit this post with results as I find them.

D.

edit: Okay. This will require further testing (I'm out of time tonight), but as far as I can tell this is a linked issue between how KSP handles loading PartModules, FAR and AGext.

My theory is currently tentative and I have not been able to prove it yet, but if I'm right it has to do with partModule placement. The best fix I can offer for tonight is to change the following line in my part.cfg from:

@PART[*]:FINAL

to

@PART[*]:FOR[AGExt]

No promises that will fix it, but in theory it will still place my partModule after RemoteTech's so I don't break the animations, but before FAR's partModules so I can start avoiding conflicting with FAR's modules that get placed in the FINAL pass.

I'll try to have something more definite, but I may not get any more time to look at this until Saturday so I figure a possible fix is better then no fix.

D.

Edited by Diazo
Link to comment
Share on other sites

I was able to just check RemoteTech and its part.cfg use the FIRST pass so the part.cfg in my previous post will not break RemoteTech (99% certainty).

However, I still need to make sure my module goes in before FAR's and I don't see a way to force that to happen, so we have to get a little convoluted.

I'm still assuming the issue is PartModule placement, this should fix the problem for good. Change the AGExt part.cfg to as follows (code box shows the entirety of the file):

@PART[*]:FOR[AGExt]:NEEDS[!FerramAerospaceResearch]
{
MODULE
{
name = ModuleAGExtData
AGXData = Empty
AGXNames = Empty
AGXKeySet = 0
AGXActivated = 0
AGXLoaded = false
AGXGroupStates =
AGXGroupStateNames =
}
}

@PART[*]:BEFORE[FerramAerospaceResearch]:NEEDS[FerramAerospaceResearch]
{
MODULE
{
name = ModuleAGExtData
AGXData = Empty
AGXNames = Empty
AGXKeySet = 0
AGXActivated = 0
AGXLoaded = false
AGXGroupStates =
AGXGroupStateNames =
}
}

If I have my ModuleManager syntax correct, if FAR is not installed, my partModule will install on the FOR[AGExt] pass, if FAR is installed, it will install my partModule in the BEFORE:[FAR] pass and so guarantee my partModule is installed before FAR's.

Also, if the problem is something else, this won't do anything to fix it. I still have not yet been able to prove it is partModule placement, but it is a pretty strong guess.

D.

Link to comment
Share on other sites

This is just sketchy as a report, but I changed the part.cfg as in your post above (and installed RT2 with the testing environment). Launched the game, as soon as I took control of one vessel, all its antennae closed (animation played). The "red" actionstate in AGX therefore is in sync. However, I can't reopen them (possibly due to RT2, if out of range due to those antennae now closed).

Of course (I bet you already know), AGX changes state to "green" = active even if Rt2 prevents the action from occurring.

EDIT 1: the above was quite probably due to RT2. Disabled RT2 plugin while keeping your modified part.cfg, now no animation is played when taking control of a vessel (Animations play fine if commanded by the user). However, no improvement with actionstates with the new .cfg; and, DTS-M1 and Communotron-16 antennae now show to be "locked", no user control right-clicking on them, nor with using an AG with them. Notable, the communotron 88-88 is unaffected, not locked.

EDIT 2: tried with the fix at post #184 on my "normal" game (heavily modded). If I don't switch vessels, I can escape to Space Center and go back to the same vessel, and actionstates remain consistent. Unfortunately they don't while switching vessels (I hoped for a moment that did the trick :().

Edited by diomedea
Link to comment
Share on other sites

Okay, I got a little time in on this tonight.

First, I'm settling on a part.cfg as follows:


@PART[*]:FOR[AGExt]
{
MODULE
{
name = ModuleAGExtData
AGXData = Empty
AGXNames = Empty
AGXKeySet = 0
AGXActivated = 0
AGXLoaded = false
AGXGroupStates =
AGXGroupStateNames =
}
}

Second, here is the AGExt.dll version 1.7b with even more logging enabled. Please go ahead and run a test with this installed and then post the output_lot.txt for me please when you get a minute.

No rush on this, I won't get any more time to look at this until tomorrow sometime.

Lastly, I'm starting to get confused what is actually broken.

1) The on/off state of actiongroups. (Action group name going red/green in the Flight window.) Pretty sure this is broken from your last post.

2) The assignment of an action to an action group. (Assigning a Solar Panel's Deploy Panels action to action group #1.) I think this has not had any issues.

3) Whether an actiongroup is a toggle group or not. (The "Toggle Grp: Yes/No" button on the main selection window.) I'm not sure here, I think this has had no issues?

4) Actiongroup visibility in Groups 1 to 5. (Top right corner of Flight Window.) I'm not sure you've been testing this, but I don't recall you reporting an issue with it.

5) Actiongroup names. (Description text box on main selection window.) This sounds like it is okay.

6) View group names. (Bottom half of the keyset window.) No reported problems, but I'm not sure you are testing this.

Thank you again for all the help you are giving me on this.

D.

Link to comment
Share on other sites

Yep. The part.cfg is what I used in the last with my main install, now will use the same with the test install, and with the newest AGExt.dll.

What is actually broken is # 1, the on/off state. (sorry, I was less then clear on that lately). I have a number of parts with each vessel and define AGs for the toggle commands with them. With those AGs I also set the "Toggle Grp: Yes" and "Group #" in AGX edit window.

These parts start inactive in game, and all AGs with "ToggleGrp:Yes" set show in red, so they are correct at start.

While in flight, I activate the parts using the AGX AG (that is matched to the toggle command): the part becomes active,and AGX shows that AG in green, so that is correct.

I leave those parts active, then switch to another vessel, go back to Space Center, or both. When I return to the same vessel, those parts are still active, but the AG set for them shows red (that is the mismatch).

With the latest tests, done only with stock parts, only communication antennae exhibit this, the AGs for toggle commands with other parts stay correct.

However, parts with other mods are also affected (with my main install, it happens with scientific parts belonging to SCANsat, Kethane, InterStellar, Extraplanetary LaunchPads; and probably much more).

Will upload new test results soon.

EDIT: Tested, results here. Please note what I put in the test description, this time I switched many times before the issue happened, only came when I reversed the order I was selecting vessels when re-entering flight mode. Can't say for sure, but in previous tests I selected vessels in casual order; this time I stickied to a pattern and while it was kept, the issue wasn't showing. (always trying to find what may be happening...)

Edited by diomedea
test results now included
Link to comment
Share on other sites

Okay, the latest test did allow me to figure out what is going on, but it would be tricky to fix.

These test also revealed a huge usability issue where if you toggled an action via the right-click menu, my mod did not see it to update.

So, time to re-write the entire toggle state logic to both fix the errors that currently exist and allow real time monitoring of part states. I'm already mostly done, but allowing for the necessary bug squashing that has to happen it is still a bit of work.

I'd like to say I'll have the next version out tomorrow night, but I've never made a release data promise before and I doubt I'll start now.

Next version should have this problem squashed for sure though.

D.

Link to comment
Share on other sites

Yes, I feel monitoring the state of parts will definitely solve that issue. Right-clicking to activate/deactivate them was what I did to re-sync the AGX states till now. I also suspect other methods may exist to indirectly change the state of parts, as the state may be toggleable by other plugins; and those state changes would be lost as well without monitoring.

On bug squashing, of course I feel committed to at least help with testing (so to find new bugs and hopefully confirm those squashed).

Also, don't start promising release dates :). Not even Squad does. It may put you under pressure from your own commitment, so bringing away the pleasure of programming.

Link to comment
Share on other sites

Version 1.8 Release

1)Rewrite toggle state monitoring code from scratch.

-Action states are now monitored in real time for all associated actions.

Example: On a Solar Panel, the Extend, Retract, and Toggle actions will all show red when the panel is retracted and green when the panel is extended.

Warning: I have to use the on/off logic as presented to me by the creator of the module. There are a few modules that result in the green/red being counter-intuitive. For example the Lock Steering on a wheel. In-game this will show green for steering unlocked and red when the steering is locked, even though the on state that would normally be green is steering locked.

-This also means you can monitor actions that normally don't have feedback. For example the "Invert Steering" has no feed back in game, you have to actually drive to test it. Now if you assign a toggle action to that, this mod will show green for normal and red when the steering is inverted.

-The weakness is that I have to add each partModule in the code. In version 1.8 all the stock modules are added, I will be adding all the mods I can for release 1.8a tonight or Monday.

-Note that this is partModules I have to add, not parts. Part packs that do not have dependencies will work with version 1.8 as they only use the stock partModules.

-This still defaults to off until I can get all the popular mods supported (hopefully only a week or so).

2) Better handling of ModuleAnimateGeneric to work correctly with parts that have more then one animation.

-The field I was looking at does not change between animations on the same part. This resulted in my mod thinking there was only a single animation on a part regardless of how many there were. Fixed.

@diomedea: This is why that communications antenna would often be the only part to have its actions screw up.

This should fix all the known issues that I am aware of at the moment.

Are there any mods specifically people want me to look at to make sure they get added to the toggle state monitoring?

D.

Link to comment
Share on other sites

Excellent. Now I have some real work to do checking all my mods have their actionstates correct. Will certainly begin to propose some (my full list of mods is certainly too long).

I understand you actually need to add partModules; then, could be best to actually show which ones are with parts that don't have their actions correctly recognized? Or just mentioning mods is enough for you?

EDIT 1: Yup, version 1.8 works great :D! All toggle states are recognized correctly. Yes, Reaction wheels (also on command modules) are bit less intuitive, show red when "not operational" for whatever reason (e.g. lack of charge). Perhaps a different color to show they are enabled but not operating...

EDIT 2: Mods to be added to toggle state monitoring. The following are currently the most evident to me:

- SCANsat (in particular the version 7 under development): has some sensors and adds its own module to parts of other mods: the concerned partmodule is "SCANsat"

- Kethane: detectors: concerned partmodule is "KethaneDetector"; converters: "KethaneConverter"; generators: "KethaneGenerator"; extractors: "KethaneExtractor"

- Extraplanetary Launchpads: multiple parts, seem to use the same partmodules as Kethane

Edited by diomedea
Link to comment
Share on other sites

Version 1.8a is out.

SCANSat and Kethane should now show their toggles correctly.

Extraplanetary launchpads piggybacks off Kethane and had nothing specific to it.

I got started on Firespitter, but it has a lot of partModules for me to check so I've released how far I've gotten.

I also checked FAR and RasterProp Monitor, but neither of them had any toggle actions that I saw.

Should I dig into FAR some more? Are there things like flaps or spoilers that should be toggles? (Specifically, what part names do I need to be looking at?)

Also posted the order I'm going to look at mods for adding the toggle support, there any other mods I missed that you guys would like to see support for?

@ReactionWheel states: This is a limit of the red/green (off/on) system. If the wheel is working it is green, if not working it is red. I don't have the option in the current version to display a different color for the wheel being not operational but for different reasons. Note that this is unlikely to change, I'd have to change my entire data structure to do this. Currently each action is current on or off via a boolean, to add a 3rd state (or more) would be a massive undertaking.

Note that an action group can display yellow in the Flight window, but this means that some of the actions in that group are on and some are off. It is not a 3rd state I could use as you are asking about.

D.

Edited by Diazo
Link to comment
Share on other sites

Certainly you are fast. I won't be able to test everything as fast as you implement it :D.

About FAR, it adds this partmodule to all concerned parts: "FARControllableSurface". I can see that module being added to stock parts with "FerramAerospaceResearch.cfg" file (so, concerned parts are listed in there). Possibly other mods (Procedural Wings? B9?) have their own config to add that FAR partmodule to their parts.

Yes, spoilers should be a toggle (I reckon it is tied to the stock "Brakes" command by default in FAR). Flaps seem to have 4 different states, probably good to show as active whenever the state is not "0".

On Reaction Wheels. Sure I don't want you to change data structure because of them. After all, the operational state is temporary. But if only red/green is possible to show, then the state to be shown could be better not be the "operational" state, but what is the state of the toggle enabling torque (no idea what it is called in game, sorry). Would be great if possible to also monitor the operational state (if not with the same AG, as another) but there is no command tied to that to link to an AG. So, if only possible to show a red/green state, that should reflect what the command is ("toggle torque").

Of course I was not considering the "mixed" state shown in yellow. There are no different Reaction Wheels or no different actions with a reaction wheel to monitor together. Unless the operational state could be exposed so to be linked to an AG (but that would require making a new partmodule just for Reaction Wheels).

Link to comment
Share on other sites

@FAR: That is the partModule I need to look at? Will do.

@Reaction wheels: So change the on/off from showing if the wheel is active or not to showing if the wheel is enabled or not. (So red if the wheel is toggled off, green if the wheel is on even if it can't function due to electricity shortages.)

That makes sense, I just grabbed the 'isOperational' variable and it looks like that does not quite do what I expected.

D.

Link to comment
Share on other sites

Version 1.8b Release

-Reaction wheels toggle state now only shows off when turned off by the player. If the wheel is not functioning due to a lack of ElectricCharge, the wheel will still show active (green) on the flight window.

-Finished support for Firespitter, adding FAR and Infernal Robotics toggle state support.

D.

Link to comment
Share on other sites

Cerberus got me thinking - would it be possible to define global action keys, letting your mod automatically add specific parts to an action group? Lets say all solar panels toggle on x, all engines on y, all SAS parts on z? (x,y,z being groups in your mod to be defined.)

not sure about point of control. i have a action key set to disable all torque on all my ships except for 1 reaction wheel on the main module of a station. so any time i dock i just push 0 and all ships/modules docked have their torque turned off. i usually set engines to be shutdown on the same action key that way no silly shift mistakes happen. ha ha. then when i undock i just push 2 and everything turns back on again.
Link to comment
Share on other sites

Hmm, as I think you are requesting, that all parts of type "solar panel" or "engine" be selected at once is probably not going to happen. It comes back to "what is a solar panel?" I can answer that question for stock parts, but for all the mod parts out there? I have no way of knowing.

What I can do is add a "select all parts that match" button so that if you select a solar panel, all solar panels that are the same on the station could be selected at once. This would be limited to part type though, if you selected a 1x6 deployable solar panel and clicked this button, it would only select the 1x6 solar panels on the station. The 2x6 solar panels would not be selected.

That has actually been on the things to add list but as it is a pretty minor feature it has kept being pushed off by other stuff.

D.

Link to comment
Share on other sites

Version 1.9 Release

Compile for KSP 0.24 64-bit

Update download to include ModuleManager 2.2.0

Throttle checking of throttle states from 60 to 3 times a second.

Added Interstellar and Tac Life Support toggle monitoring.

Nothing major this time around. No changes were required to make the mod 0.24 compatible so everything should still be the same.

D.

Link to comment
Share on other sites

Having a problem with the names for action groups not saving with the craft. ie, set everything up, save, exit the building, go in and load the craft, all names are gone but the actions remain. Note was using groups 11+ for names. I use 1-10 for assignments for Smart Parts :)

In case it helps with this https://www.dropbox.com/s/31f92l1u0cuk9tb/output_log.txt

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...