Jump to content

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


Diazo

Recommended Posts

I am working on the AGX-kOS Integration and i have a few feature requests for the AGX API.

1. The ability to trigger an action group on an arbitrary loaded craft, not just the active craft.

2. The ability to get a list of parts that are linked to an action group.

1 will make kOS integration possible 2 will make it compatible with some future work that we are planning on doing with action groups and is a much lower priority for me.

if you would rather have these requests on github, i would be happy to copy them over :)

Link to comment
Share on other sites

@erendrake: I have a whole set of features planned for the API, including your requests. Going over the external API and adding a whole bunch of options is currently about fourth on my priority list.

RemoteTech is the other big mod I'm planning to add support to the API for.

D.

Link to comment
Share on other sites

Ok... when I updated, I wiped the Editor and RootDrive files so I could start fresh. Now none of the action groups are saving on in-flight ships if I exit to main menu. Also, the numbered files are only showing up when I have a ship actively in focus and they appear to delete themselves almost instantly.

[--- code babble warning ---]

I just took a peek at the code and I'm wondering if the DeleteOldSaveGames() function in Scenario.cs might be a culprit (at least for my particular bug). If I'm reading it right, it's loading every .SFS file in the current save folder and checking the AGextScenario number inside it against the filename of AGext#####.cfg. It then deletes any AGext#####.cfg file that isn't either A) the AGextScenario number or B) the AGextScenario number - 1.

The problem I see with that is that there are no checks in place to make sure that "persistent.sfs" is the only file actually checked; it will follow the above procedure for every .SFS file without stopping. The quicksave file also contains an AGextScenario number, as do (in my case, anyways) a grand total of 18 other .SFS files created at various times in the last week (some of them backups automatically created by Kerbal Alarm Clock, some created by me). This results in the procedure will loop 20 times with 20 different AGextScenario numbers and wipe any and all AGext#####.cfg files out in the process.

I might suggest keeping only a current, backup, and quicksave version of the .cfg file rather than the numbering system. Short term, this could probably be fixed by only loading persistent.sfs and no other save files when checking for AGextScenario, or saving a list of all AGextScenario numbers found and doing all the file deletion post-loop (which would keep a current and backup .cfg for each .sfs file found, which was probably the original intention). I'm going to grab the code and try these, see what happens.

---

UPDATE - Quick hack-job modification successful. No more file clobber and my test action groups in 51-52 and 201-203 persisted, names and all, across multiple load->in-flight->exit to menu cycles. Modified AGext.dll and Scenario.cs files are here. Changes made starting at line 86 in Scenario.cs.

[/--- code babble warning ---]

Edited by CCraigen
I can't English apparently.
Link to comment
Share on other sites

@erendrake: I have a whole set of features planned for the API, including your requests. Going over the external API and adding a whole bunch of options is currently about fourth on my priority list.

RemoteTech is the other big mod I'm planning to add support to the API for.

D.

Thats great news :) i know kOS scripts are action group heavy beasts so this is a pretty exciting change :)

Link to comment
Share on other sites

I'm currently getting an issue when I load a saved spaceplane, assign actions into #101-103, save and exit to Space Center, when I reload the ship in the SPH it's loading the action group names but none of the associated actions. This is on 1.15, and I'm assuming this is the same issue as described above? If I go straight from SPH to runway it keeps all actions assigned properly.

@CCraigen: Thank you for the report, it helps me confirm what is going on.

Interesting report on groups 101-103 there, most of the reports I'm seeing have everything behaving find in the SPH, it's going from SPH to Flight that people are seeing actions being lost.

I'm getting a similar bug in the VAB. Actions for the command pod are only save if they are in slots #1 to #10. In #11 and higher, the name is saved, non-command pod actions are saved, but not actions for the command pod. This is both when saving to a file and when exiting the VAB either to the Space Centre or to Launch.

Output_log.txt is here.

EDIT: I first noticed this under AGExt v1.14. Upgraded to v1.15a and it still exists.

Edited by Jacke
Link to comment
Share on other sites

Okay, this is getting a bit out of hand. I've made a note in the first post that version 1.15 is not stable and asked people to wait for Version 1.16 which I will have out Saturday the 20th at the latest.

@MaxShadow: That sounds like my timewarp "fix" in version 1.15a isn't. On verison 1.15a make sure that you are at 1x speed or you can downgrade to version 1.15. Note that in 1.15 any changes made to actions while under timewarp will be lost.

@CCraigen: I'll go back and look at that as it seems there is a bug in there. However, I need to keep the basic system as each .sfs and it's associated AGExt.cfg file is a snapshot in time. If you do a manual save at the space center before launching a big mission, then get to Jool and realize you've messed up and load the save you made manually before the mission, I need to save the AGExt.cfg for that save. If I just keep a few as you mention, when the player loaded the save from the spacecenter, all actions on the save would be lost as the associated AGExt.cfg file had been deleted. The -1 was implemented to keep around a backup copy just in case of a crash that a player could go into the .sfs file and change the AGExtScenario number and load from that file. (Note I have not had a chance to look at your code change yet.)

@erendrake: I am looking forward to getting all the issues cleaned up and working on the kOS stuff. I have 3 pretty big issues to fix first though. :/

For the record, here is what I am looking at, if you have a bug/issue that needs fixing that I've not listed let me know and I'll add it in to the Verison 1.17/1.18 work. I will have the mod 100% stable before I start work on the kOS/Remotech stuff.

Version 1.16: Fix the save/load routine and re-enable AGExt during timewarp. (To be released by September 20th.)

{Any hotfix releases necessary to get Version 1.16 stable go here}

Version 1.17/1.18: Fix SPH -> Flight actions not loading correct. Add support for vessels to remember their Keyset/GroupsName/GroupVisibility through docking and undocking.

Version 1.19/1/20: kOS/RemoteTech support.

D.

Edited by Diazo
Link to comment
Share on other sites

Makes sense why that system needs to stay in place. The change I made just makes it more selective in its deletion of old files.

----

Code did this previously:

{Check an existing ##.cfg file against an sfs file {if it doesn't match ## or ##-1 delete the ##.cfg file} repeat for all remaining sfs files} repeat for all remaining ##.cfg files}

Changed code reorders this slightly to avoid clobbering all files if you've got multiple sfs files with differing save ##:

{Check an existing ##.cfg file against an sfs file {if it matches ## or ##-1 sets "keep" to true} repeat for all remaining sfs files} if "keep" has not been set to true delete the ##.cfg file} reset "keep" to false and repeat for all remaining ##.cfg files}

This results in the most recent 2 ##.cfg files being kept for each sfs file present, provided the cfg files exist in the first place.

Edited by CCraigen
Link to comment
Share on other sites

@MaxShadow: That sounds like my timewarp "fix" in version 1.15a isn't. On verison 1.15a make sure that you are at 1x speed or you can downgrade to version 1.15. Note that in 1.15 any changes made to actions while under timewarp will be lost.

Hmm no, it doesn't work in 1.15 either. I can remove previosly assigned actions while in flight, but there's no way to add more, the main window is missing. Perhaps is some kind of conflict with another mod?

Link to comment
Share on other sites

@MaxShadow: Okay, so the Flight window (with the Edit button) stays visible, but clicking it does nothing? Or does only some of the windows show up?

When you click the Edit button, the Main window, the Groups window, and the Current Actions window should all show.

D.

Link to comment
Share on other sites

@MaxShadow: Weird, that looks like the window is opening off the monitor screen somehow.

If you go to KSP_Install\GameData\Diazo\AGExt\AGExt.cfg and find these two lines


FltSelPartsX = 200
FltSelPartsY = 200

Those are the pixel locations of the top left corner of the window you are missing. You should find that they are either negative or some large number that is off your screen. If you change them to the 200 as shown, that will put the window back on your screen and you will be able to drag it where you want to.

I'll look at adding some sort of check to prevent this happening in the future.

D.

Link to comment
Share on other sites

Diazo, if we're trying to transfer a design from one saved game to another, as edited in the Editor, do we have to transfer the AGExtEditor.cfg file as well? Or more exactly, the stanza from that file for the design being moved, ie. the text "VAB...{ name = <ship in question>...}"? Or is everything in the .craft file when the game is exited?

Link to comment
Share on other sites

@MaxShadow: Glad to help.

@Jacke: To transfer a craft file, you do need to move the ConfigNode relating to that ship as-well. In the AGExtEditor.cfg in the save game you are moving a craft from, find the correct node and then copy that node to the AGExtEdtior.cfg file in your new game.

If you are starting a new game, you can just copy the AGExtEditor.cfg file over in its entirety.

When you open the AGExtEditor file, the node for a craft is as follows:


VAB123456789123456798465 //first line to copy
{
name={ship name}
//node data here
}//last line to copy, the close bracket
VAB222222222222//first line of the next vessel, do not copy

The amount of lines between the two brackets will vary depending on how many actions you have assigned, the easiest way is to find the next vessel identifier line and the close bracket just above it will be the last line you need to copy.

I am planning to merge this data into the .craft file itself at a future date, I will need to do so to support sub-assemblies. (At the moment, AGX can not save actions to sub-assemblies.)

D.

Link to comment
Share on other sites

@Jacke: To transfer a craft file, you do need to move the ConfigNode relating to that ship as-well. In the AGExtEditor.cfg in the save game you are moving a craft from, find the correct node and then copy that node to the AGExtEdtior.cfg file in your new game.

If you are starting a new game, you can just copy the AGExtEditor.cfg file over in its entirety.

When you open the AGExtEditor file, the node for a craft is as follows:


VAB123456789123456798465 //first line to copy
{
name={ship name}
//node data here
}//last line to copy, the close bracket
VAB222222222222//first line of the next vessel, do not copy

The amount of lines between the two brackets will vary depending on how many actions you have assigned, the easiest way is to find the next vessel identifier line and the close bracket just above it will be the last line you need to copy.

I am planning to merge this data into the .craft file itself at a future date, I will need to do so to support sub-assemblies. (At the moment, AGX can not save actions to sub-assemblies.)

D.

Thanks, Diazo! And good luck with sub-assemblies, because I've been stung in the past by them and I wasn't even going near doing the no-no: symmetry of a sub-assembly with symmetry. So I now use SelectRoot and EditorExtensions and just rebuild craft. :)

Link to comment
Share on other sites

Version 1.16b Release

Download here.

Version 1.16b

-Fix show/hide of AGExt window in flight mode

-Rework action-part save code to improve behavior when launching a new vessel.

(Version 1.16a not released)

Version 1.16

-New Save/Load code in Flight mode so actions will save/load correctly.

-This re-enabled AGExt during timewarp and it will now save correctly there as well.

-Include fix by CCraigen to handle old files better.

Alright, here we go with the fixed (rewritten) save/load code. This is a significant change under the hood in the code and while it passes all my tests I will be around this weekend to hotfix any issues that slipped past me.

I'm also going to start work on the fix for the SPH actions loading incorrectly, hopefully that will be out this weekend also.

D.

Edited by Diazo
Link to comment
Share on other sites

I started a full new save due to an unrelated issue and while trying launches from the SPH I found AGExt to be working properly when with names and actions for normal and extended entries when the plane spawns. I don't know if this bit of info will help but I thought anything at all related might be useful. This was with 1.15a as I did not find 1.16 until just now but if there is any difference I will be sure to post.

Link to comment
Share on other sites

I too can no longer hide the AGX window. Additionally it still forgets the action groups contents going from vab to launchpad. You know the editor extensions mod? You can press tab to switch between plane/rocket mode. Could that be confusing your code?

Link to comment
Share on other sites

I too can no longer hide the AGX window. Additionally it still forgets the action groups contents going from vab to launchpad. You know the editor extensions mod? You can press tab to switch between plane/rocket mode. Could that be confusing your code?

With EditorExtensions, the TAB key allows you to design in the VAB yet have your design launched on the runway, and similarly design in the SPH and launch on the pad.

Link to comment
Share on other sites

Okay, fix for not being able to hide the window is in 1.16b.

EditorExtensions? I'll grab that to check it out.

D.

EidtL Okay, it looks like EditorExtentions will mess up actions when launching a fresh vessel if you save in the other mode although you can swap modes while in the editor without issue.

IE: Enter VAB, hit tab as much as you want to swap modes. Save in SPH mode, actions will screw up. Save in VAB mode, actions should be okay.

I'm working on tweaking how actions save to parts to work around this and the other errors people are seeing with actions not appearing correctly when launching.

edit the second: Okay, version 1.16b is out. Fixes the window not hiding issue and also has my first attempt at improving the Editor -> Flight situation.

Note I have not been able to replicate this on my own computer. I did go back and rework it so it functions differently under the hood so I'm hopeful I've fixed it but I will need feedback on if I have.

This reworked version should be compatible with Editor Extensions.

Version 1.16b download is in the same post as version 1.16 was, I just editor that post as it has only been 12 hours or so between these two releases.

Edited by Diazo
Link to comment
Share on other sites

Thanks for working on this, Diazo.

Have another couple of issues. First, all 5 keysets are labeled "KeySet1key1" and that is apparently from the GameData/Diazo/AGExt/AGExt.cfg in your current download.

Second, whenever KSP starts up, it blanks the value of "KeySet1" in that same AGExt.cfg file in the KSP directory tree. Currently I'm fixing it externally by copying the value from KeySet2 after KSP starts up (faster than setting the 10 default values individually) as AGExt appears to reread that file when going into the Editor.

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