Jump to content

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


Diazo

Recommended Posts

Atrius129, Smilie:

I'm narrowing down what is going on here but I have three questions:

1) Are you actually losing assigned actions? Or just the group names?

2) Does this data loss happen in the editor only or also in flight mode?

3) If you assign actions to group 11 or higher, are those actions lost when the group names are lost? (Groups 1 through 10 have some special handling to interface with KSP's default groups.)

Thanks,

D.

Edited by Diazo
Link to comment
Share on other sites

Atrius129, Smilie:

I'm narrowing down what is going on here but I have three questions:

1) Are you actually losing assigned actions? Or just the group names?

2) Does this data loss happen in the editor only or also in flight mode?

3) If you assign actions to group 11 or higher, are those actions lost when the group names are lost? (Groups 1 through 10 have some special handling to interface with KSP's default groups.)

Thanks,

D.

Here is my report:

Javascript is disabled. View full album

1. It seems like both. Although the keybindings that were assigned to each group seem to have been saved, none of the actions or groups show up.

2.Any time you change screens (go to space center, change vessels, or even EVA) groups are completely wiped. I start off in the VAB, having assigned action groups (Pic. 1). Upon hitting the launch button, you can see that my ship has no groups assigned on the pad (Pic. 2).

3. I then assigned group 11 (Pic. 3) and went on EVA. Upon return, the groups were gone again (Pic. 4).

Also, symmetry and grouping are not working properly. In Pic. 3 you can see that slot 9 has a group assigned. I told it to fold up the radiators and the alcubierre drive (weird ring thingy at the top). When I click on the group or hit 9, only the first item that I had originally clicked when setting the groups deploys (so only the one radiator deployed, not the other one or the Alc. drive.) These were all things I was able to do back in 0.23.5

Using KSP 0.24.2 x64 with a bunch of mods.

Here is the output log if you need it.

Thank you for writing this great mod! I look forward to being able to use it again soon. It has become pretty essential to me.

Edited by Atrius129
Link to comment
Share on other sites

@Atrius129: Okay, something drastic is going on with your installation. The partModule that is attached to each part to save data seems to be missing so the mod has no where to save data.

This is almost certainly caused by a mod conflict in how KSP changed partModule loading order. Looking at the log, my first suspicion would be that it is with FAR.

Can you post the .craft file (either the one you save manually, or the Auto-Saved Craft.craft that KSP makes for you) so I can confirm that it is saving correctly and that it is the loading process that is the issue.

Also, can you please double check that you have modulemanager version 2.0.0 or newer and that there is a part.cfg file in the Diazo\AGExt directory that adds the ModuleAGExtData to every part? I'm pretty sure you have them as you mention that the mod worked for you in 23.5, but I need to make sure.

I'll look into it, but this might require changes to the save/load code to account for the differences in ksp 0.24.2 that are causing this so it could be a few days.

D.

Edited by Diazo
Link to comment
Share on other sites

You got it.

Off the top of my head, it is using parts from:

Interstellar (with folding drives)

Engineer

Procedural Parts

& yeah, I am using ModuleManager 2.2.0

That part.cfg file contained

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

}

Link to comment
Share on other sites

@User Unrelated: I suspect that this mod is not compatible with kOS. I do expose the code required for other mods to call my action groups, but I don't think kOS has added the commands on it's end to do so.

I'll add it to the list to look at once I get this save/load problem sorted out.

@Atrius129: Thanks for the .craft file. That confirms my suspicion that KSP is messing with the partModules as my AGX partModule is not present. The part.cfg is correct and my AGX partmodule is added to every part when you launch KSP, but then when the parts load in the editor my partmodule is being replaced with another mods. Therefore when the .craft file is saved, my AGX partmodule is not present and therefore my mod fails to save any data.

That means I have to re-write part of my save/load system and I can't give an ETA on that. Hopefully I can post a status update tonight after I get a few hours in working on it.

D.

Link to comment
Share on other sites

@User Unrelated: I suspect that this mod is not compatible with kOS. I do expose the code required for other mods to call my action groups, but I don't think kOS has added the commands on it's end to do so.

I'll add it to the list to look at once I get this save/load problem sorted out.

That would be sweet. kOS currently can't directly access part actions either, so in order to tell a part to do something I need to use the AG1-10 commands, and obviously 10 commands is rather limiting. Given however that they are reserved keywords, I doubt something like AG11 would work since it probably isn't defined :/

Link to comment
Share on other sites

Version 1.12 Release

-KSP 0.24.2 re-compile.

-Add ability to show/hide Keycodes in the flight window.

To modify, right-click the AGX button on the toolbar and click the button that shows itself. Right-click the AGX button again to hide the button.

Nothing major here, but also nothing to try and fix the save/load errors people are getting. The reason being is that I am going to have to gut my save/load routine and that is going to take me a while to get version 1.13 ready.

As I had the show/hide keycodes feature half-finished as it was, I wanted to get it out before I started ripping the save/load routine apart.

Also in the bad news department, while it is not certain yet, there is a high possibility that version 1.13 will wipe all AGExt related data and so all assigned actions and action group names will be lost.

I will try to avoid this if I can, but the 0.24 update has made it so I can not rely on a partModule to save data, I have to move my data saving to a scenarioModule which will require writing a conversion routine to get the data across so no guarantees.

So, ya. Version 1.13 will fix the save/load not always working, but it is a fair chunk of work and so a ways off.

@Integration with kOS: It should be straightforward to add the reserved words needed to interface with this mod, but I need to get a working version first. I'm hopeful for shortly after 1.13 is out, but we'll see how it goes.

D.

Link to comment
Share on other sites

@Diazo

I'm looking at the kOS integration issue from the kOS side of the code.

This is the pair of standard KSP API calls kOS is using for action groups. I'll give the example for stock action group 10:

To Set:


someVessel.ActionGroups.SetGroup(KSPActionGroup.Custom10, (bool) val);

To Query current setting:


bool val = someVessel.ActionGroups[KSPActionGroup.Custom10];

Can you provide examples of the same two operations as they would be used for one of your extended action groups (Is it as simple as just changing the "Custom10" to "Custom11" and "Custom12" and so on for the extra action groups, or is it more complex than that?)

Link to comment
Share on other sites

I've got a thread in the Add-On development forum about it with more details (found here).

But the short answer is that I use reflection so that a hard dependency is not needed, which means you need to add "using System.Reflection" to the dependencies list where you add "using UnityEngine". Then add the following methods to kOS as appropriate. They go on the same level as Update(), like this:


public void Update()
{
//stuff
}
public bool AGExtInstalled()
{
//stuff
}
//repeat for the other two methods

First, to detect if AGX is installed so you can control if you even offer the commands:

public bool AGExtInstalled()
{
Type calledType = Type.GetType("ActionGroupsExtended.AGExtExternal, AGExt");
return (bool)calledType.InvokeMember("AGXInstalled", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, null);
}

This should work in every scene and return True if AGX is present and False if it is not.

The following only work in flight mode. (I'm not sure if they gracefully fail or throw an error if AGX is not present.)

To activate an action group, pass the following method the action group to activate as an integer:

public void AGExtActivateGroup(int group)
{
Type calledType = Type.GetType("ActionGroupsExtended.AGExtExternal, AGExt");
calledType.InvokeMember("AGXActivateGroup", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, new System.Object[] { group });
}

To check a groups status, pass the following the group to check as an integer and it will return a bool:

public bool AGExtGroupState(int group)
{
Type calledType = Type.GetType("ActionGroupsExtended.AGExtExternal, AGExt");
return (bool)calledType.InvokeMember("AGXGroupState", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, new System.Object[] { group });
}

I am out of time to test tonight, but it has been a long time since I actually tested these methods. Notably I'm not sure if the state check is working as intended now that I've added toggle state monitoring. It should return the state of the monitored action if available but I have not actually tested that.

Let me know how it goes, if something is broke I'll push a quick fix for you tomorrow after work.

D.

Edited by Diazo
Link to comment
Share on other sites

Does this mod leave traces somewhere out of the "GameData" folder?

Because I had it installed and keep having problems with my Action Groups after delete:

http://forum.kerbalspaceprogram.com/threads/88818-Action-Groups-stopped-working-%28except-1-and-7-%29

EDIT:

I figured it out: My keybindings got lost. Only Action Group 1 and 7 had Alpha 1 and Alpha 7 set as "alternative", the others had none.

I suspect this mod that once was installed but I'm not certain.

Edited by mecki
Link to comment
Share on other sites

I do have to unbind the keys for groups 1 through 10 from KSP and reroute them to my mod.

However, it is supposed to rebind them back when you quit so that when the mod is uninstalled keys 1-10 go back to activating the KSP defaults.

At this point the output_log is lost because you've run KSP since so I don't think I can diagnose why it did not rebind back to the KSP default, but I will add a note in the opening post about it.

D.

Link to comment
Share on other sites

unInstalled AGX to do some Bughunting (Don't you worry i will install it soon enough again ^^) regarding KM and Action groups, Turns out KSP didn't like that.

I'm in no way good at reading these logs but i think it said something about Missing AGE on the ship, hoping you get more use of these then me https://drive.google.com/folderview?id=0B-748mPPvmGGNnlKX0taUzBNS1E&usp=sharing .

Link to comment
Share on other sites

Hmm, I don't add any parts to the ships so if you delete the Diazo\AGExt directory, the mod should be gone.

I'll take a quick look and see what I can find.

D.

edit: Okay, the messages in the log about finding ModuleAGExtData are (or should be) harmless. All that means is that as KSP is loading the ship, it finds the saved data in the ship file, but it can't find the .dll that defines that data and so skips it. As the .dll that uses that data is not present (it was deleted when the Diazo\AGExt directory was deleted) KSP skipping the loading of that data is not an issue as it will not be used.

Edited by Diazo
Link to comment
Share on other sites

hm Crashes stop when i add KSE back and the Start again when i remove it again, got tired of loading the game and restarting it after 12-15 tires (about half with and half without KSE and everytime i had it removed it crashed) it crashes at 1 of 2 points 1: as i enter the game (chose 1 game to load). Or 2: when i enter the VAB.

I'm way to tired to try anything else now but i'll try to make a completely new game (save/persistent/whatever^^) and see if it stops, But if you say it has nothing to do with it i believe you (since i cant really read error logs well enough to actually get what it says) and will continue my hunt for this elusive bug.

I also understand that i have A lot of mods and any of them could create this problem and it could be a coincidence.

Edit: Haha just realised that I'm actually making a bug report about issues when removing a mod not when adding it xD.

Edited by Sutima
Link to comment
Share on other sites

Heh, fun times.

Anyways, there seems to be issues at the moment surrounding partModules and them getting mixed up when too many of them are present and some piece of code gets run. (Which piece of code is not known at the moment....)

I'm currently rewriting this mod to save to a scenarioModule instead of a partModule for the next version which will hopefully simplify things, especially in troubleshooting stuff like this.

D.

Link to comment
Share on other sites

Heh, fun times.

Anyways, there seems to be issues at the moment surrounding partModules and them getting mixed up when too many of them are present and some piece of code gets run. (Which piece of code is not known at the moment....)

I'm currently rewriting this mod to save to a scenarioModule instead of a partModule for the next version which will hopefully simplify things, especially in troubleshooting stuff like this.

D.

Okey, so i tried to go to sleep, but knowing that this issue would still be there when i woke up i went up to investigate this problem.

After Adding and removing AGE a few times hoping for a different result i decided to throw out everything i knew and thought i knew and decided to act on my first instinct.

So i asked myself " what could this be" So after removing AGE i also removed FF (final frontier) and it started without a crash.

My reasoning was that the few last Crash reports it crashed after it asked for the missing AGE files but just before that i saw some error msg regarding FF.

Sorry to lay all the blame on your product ^^, Like i said earlier i have a lot of mods turns out that not all of them like to play together.

I'm happy enough with this result to be able to sleep now.. will do some more digging tomorrow.

Edit 1: OCD dictaded that i keept trying, had the debug menu up, last error i saw was something like KM (klockhead martin smartparts) looking for AGEX CFg or something, sorry for all the spams, really just trying to help and i don't know what information you find relevant so i just provide as much as i can. now i really do have to sleep xD.. latest log and error dumps https://drive.google.com/folderview?id=0B-748mPPvmGGS0xsX1VBNW1QQUU&usp=sharing

Like i said, i have a lot of mods running and it could really be any or all of them, just taking the info i see and trying to find the cause and potentially help you guys (awesome modders) to hunt down bugs.

Edited by Sutima
Edit 1 *insert witty name*
Link to comment
Share on other sites

I'm assuming you are talking about this message:


[Part]: PartModule ModuleAGExtData at km.valve, index 1: index exceeds module count as defined in cfg.
Looking for ModuleAGExtData in other indices...

That is expected behavior after removing a mod that attaches a partModule to a part.

Assume that with AGExt installed, the part has 5 partModules total and the AGExt is at location #3.

After removing AGExt, the part now only has 4 partModules, but the save file still has 5 modules. Therefore when it hits module #3, it expects Klockhead Martin's partModule, but it sees AGExt's partModule in the save file. It then goes looking for an AGExt partModule and fails because AGExt is not installed. It then loads the other 2 partModules to get a working part for that game session.

This can happen with any mod's partModules, in this case it happens to be AGExt and Klockhead Martin's partModules based on the mods you have installed and the order KSP loads them in.

D.

Link to comment
Share on other sites

Thx.

Like i said, i really don't know how to read it and so on, so i rather just provide information until some one tells me to shut up.

Anyway i'm sorry for being a bother and i thank you for your explanations i really do find it interesting and fun to learn more about it. I'm a bit ashamed that i did not take the time earlier to learn more about how mods work with ksp.

Anyway just wanted to say thanks for your patients and hardwork on Awesome *once you have them you can't be without them* mods..

Edited by Sutima
Link to comment
Share on other sites

I do have to unbind the keys for groups 1 through 10 from KSP and reroute them to my mod.

However, it is supposed to rebind them back when you quit so that when the mod is uninstalled keys 1-10 go back to activating the KSP defaults.

At this point the output_log is lost because you've run KSP since so I don't think I can diagnose why it did not rebind back to the KSP default, but I will add a note in the opening post about it.

D.

Hi, ive got the same trouble wiz keybinding after desinstall, i desinstall because i try everything i can imagine, but im unable to link more than one part by group :( not easy when u have lots of engines to group.

So when uninstall, my "normal" group key dont work anymore, but group 1 and 2 have still their key binded to the one i do wiz ure mod (numpad 1 & 2)

After reading that post, i edit my .craft, and find that their Custom01 as key. May not be Alpha01 ?

By the way, can u explain me how to group several parts in a group, cauz i cant :(, and i need ure mod, its extrmly usefull when u have a bit complex ship (if i arrive to have it correctly working :D)

Link to comment
Share on other sites

First, nothing I do or affect with this mod should require opening the .craft file directly. If the default action keys are not working after uninstalling this mod, you can go into Main Menu -> Settings and rebind them to the keys you wish.

For reference, in the .craft file where it says "Custom1", that means that action is bound to action group 1, it has nothing to do with the key assigned to that group. If you change this to something else, you will possibly corrupt that .craft file and have to recreate it.

Second, be aware the current version has problems with saving data for some people due to changes made in 0.24

If you are assigning actions and they are getting lost, I will have to ask for you to wait until I can get the next version out which redoes how the mod saves data from scratch.

Third, you can assign as many actions to the same group as you like. Leave the group number the same, so don't click on the groups window, and then click a part, assign the action, click another part and assign its action and it will go into the same group. If you click an action and it does not appear in the "Actions (This Group)" window, or the Groups window does not highlight the group green, then you are having the data loss problem I am currently working to fix.

Lastly, the rewrite is going well. Now that I have figured out how config nodes work I was able to get the editor saving data working in short order last night so I'd say I'm about 30% done. I still am not 100% sure how I'm going to handle parts changing vessels (such as undocking where a single vessel becomes two) but I've got some ideas. It will probably depend on how the code looks when I get to that point.

So progressing but enough unknowns left that I'm not even going to guess at an ETA.

D.

Edited by Diazo
Link to comment
Share on other sites

Hey Diazo. Just wanted to see how things were going.

I also wanted to see if you were doing anything about the issues involving selecting multiple parts, because I don't think I really saw that being addressed.

Not trying to rush you at all; I know you have a life. Thanks again!

Link to comment
Share on other sites

@Issue selecting multiple parts? I'm not aware of anything wonky with what is currently implemented. Some people are reporting issues with the actions for selected parts not showing, but that's happening when both a single or multiple parts are selected.

I also have a "select all parts of this type" button I plan to add at some point in the next few versions, but that is not present in current version yet.

@Progress on next version: Getting there. Editor works. However, I had the rewrite for Flight mode mostly done when I realized it was not going to work and had to rip it all out and start again. Trying to account for ships entering/leaving physics range, docking/undocking, parts being destroyed, etc. is surprisingly difficult to keep track of correctly.

D.

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