Jump to content

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


Diazo

Recommended Posts

Alright, I've posted version 1.23a, linked in the previous post, to add the Toggle Monitoring support for my new Actions Everywhere mod.

I've also gotten started on the youtube videos,

Unfortunately I was unable to find a microphone and had to use the subtitles so I'm hoping I got it right. The video is only 90 seconds long and I would appreciate any feedback.

D.

Link to comment
Share on other sites

So, when building a spaceplane, I added a RealChutes Radial Chute and configured it to be a drag chute. I then added an action for Cut Chute. I now see this in the log:

AGX actsToCompare.count != 1 0 Part: RC.radial_4292892696 Module: RealChuteModule ActionCut

Link to comment
Share on other sites

Version 1.23b

-Fix RealChute AGX Ambiguous action.

Download here. URL link is .dll file only, you need to install version 1.23 .zip file first.

@Einarr: Thank you for the report, here is the version that fixes that error. It is only the .dll file but I expect to release a full .zip version later today after I do some more work on the mod.

D.

Edited by Diazo
Link to comment
Share on other sites

Hmm, having an issue toggling any engine now...wonder if it's a conflict with some of the Stock Fixes plugins...

Edit: I've removed the suspected plugins. No effect. I'm going to revert to an older version of AGX to see if it's AGX.

Edit 2: Reverting to 1.23a resolved the issue. So something you did for 1.23b caused Toggle Engine for all engines I've tested (including stock ones) to stop working.

Edited by Einarr
Link to comment
Share on other sites

Weird, I can not replicate i.t However, I'm testing on my dev environment with only my mods and blizzy's toolbar installed.

For comparison, my test vessel was a simple 6 part vessel with command pod, 2 fuel tanks, the engine on the bottom and 2 clamp arms to keep me on the pad.

There are only 3 things I can think of to check however:

1) Any error messages in the log?

2) If you enable the toggle monitoring, does it swap between red and green when you click the action?

3) Does the engine work otherwise? IE: With staging the engine turns on?

I need more information at this point to try and track down what is going on as my current best guess is a conflict with another mod.

D.

Edited by Diazo
Link to comment
Share on other sites

1. Didn't see any, but I can check again when I have a vessel again.

2. I'll have to check.

3. Staging works normally, as does the right click action buttons.

I'll probably end up making a test craft. Most recently I've seen the issue with the B9 SABREs, and the Thermal Nozzle from KSPI. As I said though, reverting to the 'a' version resolved the issue.

Link to comment
Share on other sites

I'll probably end up making a test craft. Most recently I've seen the issue with the B9 SABREs, and the Thermal Nozzle from KSPI. As I said though, reverting to the 'a' version resolved the issue.

Which is what is really stumping me. The only difference between 1.23a and 1.23b is I added the toggle monitoring for 3 more part modules, none of which had anything to do with engines and looking through my code I can't see any possible causes between those two versions.

The bit of data I am really interested in is the Toggle state and what the text color does when you click it. Note that one possible outcome is that when the Group that has the Toggle Engine action in it is red (engine off) and you click the button it flashes green for half a second and reverts to red.

D.

Link to comment
Share on other sites

Haven't fired up KSP yet today, and I have some stuff to deal with first. However, When I was experiencing the problem I'd hear the audio associated with turning the engine on/off, but the engine state would not actually change. I'll have more data later.

Additionally, I'm often found on the official KSP IRC channel.

Edit: After resolving another issue I was having where I'd end up in NullSpace if I tried launching a vessel, I no longer seem to be having the issue I was describing...at least with the small SABRE on the launchpad...more testing is required for the Thermal Nozzles.

Edit 2: The Thermal Nozzles are now also working correctly...at least on the launchpad...

I was having issues with Tweakscale, including some otherwise stock landing struts (the LT-2s) scaled to 140% having their mass change when an on orbit vessel was loaded. The mass change was a massive increase to what was reported in the VAB, caused the vessel to violently shake until one or more of the offending struts broke off. I ended up having to use Whack-A-Kerbal to remove the last one. Tweakscale was also responsible for me not being able to launch new vessels, sending me to NullSpace instead (no Kerbin, launchpad, runway, vessel, tonnes of NRE spam in the log, etc).

Other people use Tweakscale and have little or no issues, but for whatever reason, I can't use it. Perhaps something to add to a list inc ase others have similar issues and aren't posting about it.

Edit 3: Seems I was mistaken, at least about the small SABREs. Got a mostly B9 spaceplane of mine on the runway, and pressing the keyboard button (Alpha1, for group 1) results in the audio I was referring to earlier, but the state is not actually toggled (the group stays Red). Actually clicking the button, or the switch in the B9 cockpit does properly toggle the group. Gonna check the log now.

Edit 4: Nothing from AGX in the log file once flight is loaded seems to be out of the ordinary.

Edited by Einarr
Link to comment
Share on other sites

Edit 3: Seems I was mistaken, at least about the small SABREs. Got a mostly B9 spaceplane of mine on the runway, and pressing the keyboard button (Alpha1, for group 1) results in the audio I was referring to earlier, but the state is not actually toggled (the group stays Red). Actually clicking the button, or the switch in the B9 cockpit does properly toggle the group. Gonna check the log now.

This sounds like the lockout on the default groups is failing, so when you press 1, AGX toggles the engine on, then because there is no lockout, KSP also gets the 1 and also activates the action group a second time. This immediately turns the engine back off as it is a toggle action in question.

You can check if the lockout is in place by pressing ALt-F12 then checking that under the "Input Lock Stack" that "AGExtControlLock" is in effect.

I do provide a method to disable the control lock, if you open the GameData\Diazo\AGExt\AGExt.cfg file, what is the LockOutKSPManager set to? If it is set to 1 then AGX is trying to lock and failing, this is a bug I'll have to check. If set to 0 (zero), that means the lock is overridden and AGX will not try to lock out the controls.

If there is no AGExtControlLock in the Alt-F12 input stack and LockOutKSPManager is set to 1 in the .cfg file, that is an issue I will have to look into. If this is the case, the workaround is to unbind one of the keys. I would prefer that you unbound the keys from KSP's settings screen, but you can unbind them in AGX and use KSP defaults to activate groups 1 through 10.

Assuming the issue is what I'm thinking it is anyway. The test would be to bind the Activate Engine action instead. Two "activate this engine" commands leave you with a running engine, where two "toggle this engine" commands turn the engine on then right back off.

Hopefully this works things out, let me know how it goes.

D.

Link to comment
Share on other sites

I'm in the middle of a complete KSP and mod set reinstall/configure. My response may take a bit.

I do provide a method to disable the control lock, if you open the GameData\Diazo\AGExt\AGExt.cfg file, what is the LockOutKSPManager set to? If it is set to 1 then AGX is trying to lock and failing, this is a bug I'll have to check. If set to 0 (zero), that means the lock is overridden and AGX will not try to lock out the controls.

This value is set to 1.

And for the moment I can't reproduce it, even with the same craft I'd had the issue with. *shrug*

If it rears it's ugly head again, I'll post again.

Edit: About that ugly head...I think it may have something to do with KSPI's radiator code. They are supposed to glow brighter as they get hot. I have a couple of the small radial ones mounted to keep from overheating with the solar panels. However, I've noted an excessive amount of log spam associated with the code that changes the emissive for the glow. I now have a green group with the engines not active after using the keyboard. Additionally, I can't simply bring up the Alt-F2 window in the usual way anymore. I think KSP is being overloaded by the log spam.

Edited by Einarr
Link to comment
Share on other sites

Interesting.

For reference, the color (red/green) of actions on engines is checking the 'isOperational' parameter in code. All a green means is the engine is on and trying to produce thrust. If the engine is not producing thrust for some reason, such as lack of a resource, it will still show the engine as green as the engine is trying to produce thrust, it is just failing for some reason.

If the engine is showing red in the flight window of AGX, that means the engine is off and will not produce thrust under any circumstance.

At least under normal operating conditions, if you are right about KSP being overloaded with log spam, who knows what exactly is going on.

D.

Link to comment
Share on other sites

So after removing the solar panels and all radiators from the spaceplane I first noticed the issue on, the Issue remains. This time, I managed to record it with Fraps, with the ingame log console open.

Essentially all I'm doing in the video is demonstrating that the Issue occurs when I use the keyboard, but not when I click the button. I also don't have it when I click the switch inside the B9 cockpit, though I forgot to record it. The log console shows an audio warning, but that showed up after I enabled audio capture in Fraps. It should be unrelated as I've never seen it before.

Edit: This is no longer limited to the Toggle Engine action. For a single keypress, it it activating the actions assigned to the group twice, as demonstrated in this new video.

I didn't have the log console up this time for the video, but it doesn't matter as nothing shows up in the log anyway, as demonstrated by the first video.

Edited by Einarr
Link to comment
Share on other sites

Okay, that is very helpful.

I can't sit down to analyze until I get home from work but that is pretty clear what is going on.

First, as you were able to show it happening on group 11 (and 12?) in the second video, the Input Lock is a red herring. That could only be the cause on groups 1 through 10.

Therefore the most likely culprit is the new modifier keys code has a logic hole somewhere that I missed something. The only point of confusion with that is that I added that in version 1.23, not version 1.23a, so reverting from 1.23b to 1.23a would not fix the issue. Except that if this is intermittent, maybe it just did not happen when you reverted to 1.23a even though 1.23a has the potential to exhibit this behavior.

My only other question would be that this is not the first flight of the game session correct? You mentioned pulling parts off so I assume you were going back and forth to the SPH. If so, this opens up the possibility something is not resetting correctly and it is still trying to use the settings from the previous flight.

Also, so I can set up my system the same, what key was your Modifier 1 key?

I'll see what I can do when I get home,

D.

Link to comment
Share on other sites

I use RAlt and RControl for Mod 1 and 2 respectively. Those videos were shots after a complete restart of KSP and were the first flight. I had previously played around with parts as noted at the top of that post, but exited KSP to ensure the behavior I was seeing was not caused by KSP or various plugins not resetting things correctly.

Also, vBulletin sucks... *glares at an expired token*

Link to comment
Share on other sites

Version 1.23c

Download here.

-Fix ModuleEngines and ModuleEnginesFX to use .isIgnited instead of .getOperational

@Einarr: Thank you for those youtube videos. I was able to track down what is happening with those and replicate part of the problem.

As it turns out, it looks like Squad added a new variable .getIgnited, and changed how the .getOperational variable operates. This makes my post from last page wrong where I said .getOperational is true when the engine is on even if it is out of fuel.

Currently, .getOperational is only true when the engine is actually producing thrust. Having switched ModuleEngine and ModuleEnginesFX over to using .isIgnited which in fact stays true whenever the engine is turned on, the problem should be fixed.

This does not fully explain why activating by a key gave this behavior and clicking did not, but I speculate that it was because where I tied into the code. The keypress happens inside the Update code where the updates to the vessel state happen, while clicking on the action group the action happen in the GUI code that controls what displays on screen.

This does not explain the problem with the flaps action activating twice though, I am still looking into that. It is possible this means the engines still have issues as well but I'll see once I figure out why the flaps are wonky.

D.

Edited by Diazo
Link to comment
Share on other sites

Okay, I was not able to replicate the flaps error. :(

So, I have enabled detailed logging on Version 1.24d.

Download here.

There is no functional difference between this and 1.23c, only the expanded logging.

Now, when you activate an action on the keyboard it will print two messages to the log:

AGX Key check for some reason 1 -> This means that a key assigned to a group (group 1 in this case) was pressed. Note that this step ignores modifier keys, so any group that activates on Alpha1 will show.

AGX Key activate for some reason 1 -> This means that a key assigned to a group (group 1 in this case) was pressed. Note that this applies the modifier keys and a group that displays this will be passed to the activate actions code.

And any time an action is activated, whether by mouse or keyboard, for each action this will show:

AGX action activate FIRE! Toggle Engine -> This means that the Toggle Engine action was fired in the activate direction. This will appear once per action, so activating a group with 4 actions should print 4 of these lines to the log.

If you can see what this does I would really appreciate it. I've setup my system the same as your youtube videos and the Flaps behave as expected for me so I'm hoping this will tell me what is going on.

D.

Link to comment
Share on other sites

Would you like me to take a screenie of my GameData folder so you can see all the mods I'm cramming in?

Edit: You asked for log entries, so here's a few, and erm, no, the Toggle Engine issue has not been squashed.

Anyway, I deployed a sat into Polar orbit of Kerbin for a contract, and when I went to use the keyboard to shut the engines down (Group 1), I had some of your new logging things come up. Be advised I did hit the key multiple times, so the log is showing all of it.

[LOG 03:03:58.594] AGX Key check for some reason 1
[LOG 03:03:58.595] AGX Key activate for some reason 1
[LOG 03:03:58.596] AGX action activate FIRE!Toggle Engine
[LOG 03:03:58.598] AGX Key check for some reason 1
[LOG 03:03:58.599] AGX Key activate for some reason 1
[LOG 03:03:58.600] AGX action deactivate FIRE! Toggle Engine
[LOG 03:03:59.110] AGX Key check for some reason 1
[LOG 03:03:59.111] AGX Key activate for some reason 1
[LOG 03:03:59.112] AGX action activate FIRE!Toggle Engine
[LOG 03:03:59.114] AGX Key check for some reason 1
[LOG 03:03:59.115] AGX Key activate for some reason 1
[LOG 03:03:59.116] AGX action deactivate FIRE! Toggle Engine
[LOG 03:03:59.827] AGX Key check for some reason 1
[LOG 03:03:59.829] AGX Key activate for some reason 1
[LOG 03:03:59.830] AGX action activate FIRE!Toggle Engine
[LOG 03:03:59.831] AGX Key check for some reason 1
[LOG 03:03:59.832] AGX Key activate for some reason 1
[LOG 03:03:59.833] AGX action deactivate FIRE! Toggle Engine
[LOG 03:04:14.314] AGX Key check for some reason 1
[LOG 03:04:14.315] AGX Key activate for some reason 1
[LOG 03:04:14.316] AGX action activate FIRE!Toggle Engine
[LOG 03:04:14.317] AGX Key check for some reason 1
[LOG 03:04:14.318] AGX Key activate for some reason 1
[LOG 03:04:14.320] AGX action deactivate FIRE! Toggle Engine
[LOG 03:04:16.658] AGX Key check for some reason 1
[LOG 03:04:16.659] AGX Key activate for some reason 1
[LOG 03:04:16.660] AGX action activate FIRE!Toggle Engine
[LOG 03:04:16.661] AGX Key check for some reason 1
[LOG 03:04:16.663] AGX Key activate for some reason 1
[LOG 03:04:16.664] AGX action deactivate FIRE! Toggle Engine
[LOG 03:06:01.809] AGX Key check for some reason 1

Edited by Einarr
Link to comment
Share on other sites

I was afraid of that.

[LOG 03:03:58.594] AGX Key check for some reason 1

[LOG 03:03:58.595] AGX Key activate for some reason 1

[LOG 03:03:58.596] AGX action activate FIRE!Toggle Engine

Looking at the log, this is showing AGX behaving correctly and that there is only a single activation of the action per keypress. (I've cut the log down and am showing just a single keypress.)

My only concern would be the speed of the keypresses. Can you remember the speed you pressed the 1 key? The log is showing only 4 thousands of a second between the first two keypresses. (.594 to .598)

The time between the second and third is just over one tenth of a second (58.598 to 59.110), but that's only if you were mashing the key as fast as you possibly could.

I'll look into it and see if the detection of the keydown is the issue, but I'm pretty much taking what KSP passes to me and there is not much I can deal with. I may simply have to add a timer that an action group can not activate again until half a second has passed or something.

D.

edit: Pretty sure that is the issue. Just ran a test mashing the 1 key as fast as I physically could and it was one tenth of a second (100 ms) between presses. No way are you pushing the key twice with only four thousands of a second (4 ms) between them.

Edited by Diazo
Link to comment
Share on other sites

Version 1.24a

Download here.

-Fix issue where KSP was passing a key press twice so an action group would activate twice in the same instant. This resulted in Toggle actions doing nothing as they would activate and instantly deactivate. Toggle actions should now behave correctly.

-Move toggle group check cooldown from Update to FixedUpdate.

-1.24a: Force part activation so gimbals turn on correctly

@Einarr: This should squash the issue you are seeing. Just in case I have left all the logging enabled from version 1.23d but there has been a new one added:

AGX Action not activated, that group still in cooldown -> Means the action group is still on cooldown and will not trigger.

As I can't actually fix the error itself (KSP passes a keypress twice), I've put a cooldown on how often an action group can activate. The defaults to 5 Update() frames, which is about 90 milliseconds at 60fps. If you want to change this, you can add the following line to the AGExt\AGExt.cfg file:

ActivationCooldown = 5

Where the number is how many Update() frames that have to pass between group activations. A higher number is a longer cooldown.

Note that this cooldown is per group, activating group 1 enforces the cooldown for group 1 only, you can activate group 2 immediately afterwards without the cooldown being a factor.

For reducing processing load, the toggle state monitoring only runs a few times a second. This used to run in the Update() frame, but as action groups actually affect things on the vessel which updates in the FixedUpdate() frame, it makes more sense that the monitoring code runs in FixedUpdate. The toggle state code should still run at about the same speed, but it now runs every 15 FixedUpdate frames instead of in the Update() frames.

Version 1.24a

Added an override so that when an engine is turned on the gimbal attached to the engine turns on also.

Currently, the ModuleEngines and ModuleEnginesFX partModules do not activate the part they are attached to when activated by an action key or the right-click menu, as opposed to being staged with the Spacebar where the part is activated. Therefore the ModuleGimbal on the same part does nothing as it detects the part is is attached to is not activated and thinks the attached engine is still off.

The override ties into the action so that when the "Activate Engine" or "Toggle Engine" action on the ModuleEngines or ModuleEnginesFX partModule is activated, AGX will force activate the part so the gimbal will work.

This means any builds that have added the Toggle Gimbal action to the same action group as a workaround can now remove it as this override now makes sure the gimbal is activated for you.

D.

Edited by Diazo
Link to comment
Share on other sites

I'll do some more testing using only one keypress. As for the speed at which I was doing it, I rather doubt I was doing it even as fast as .1 second. I'm thinking it was closer to .5 seconds between keypresses.

Edit: More testing has confirmed that the issue seems to be resolved finally. I'll be sure to post again if it crops up...

Edited by Einarr
Link to comment
Share on other sites

Just a status update on a couple things.

First, 0.90 has hit experimentals, I am expecting AGX to explode rather spectacularly when run on KSP 0.90 for the first time. Make sure you have a backup of your saves if you want to experiment. I'll have an update out ASAP but I don't get 0.90 any earlier then you guys.

As there are massive editor changes I'm expecting to have to re-write a significant chunk of the editor code when it is released. To jump on it as fast as possible I'm not going to touch the code for anything else as I want a stable version to start from.

This means the actions saving on sub-assemblies is going to have to wait until after AGX is stable on KSP 0.90.

Second, I've started on a series of youtube videos to hopefully go over how AGX functions better then the first post in this thread does.

Note that as I was unable to find a microphone I had to use subtitles.

Several more videos going over Flight Mode, Keysets, Docking, etc. are planned but I've been delayed in getting them ready so I'm putting these two out there as is.

Is it worth my time to complete the video set or do I need to find a working microphone to make it worth the time?

Here's to 0.90

D.

Link to comment
Share on other sites

What is the difference between Toggle and Toggle Antenna???!?!?!????

I have a a dts-m1 and it only opens if I choose Toggle and I have a aies commtech esc-exp omni and it only opens if I choose Toggle Antenna? What is the difference?

Edited by ctbram
Link to comment
Share on other sites

It is an oversight on the part of the creator of the part.

If you are using the antenna I think you are, it has two animations, one for opening/closing the antenna and one for the animated blinking light when transmitting. (I'm still at work and can't check the antenna names from your post.)

Both those animations use a piece of code called ModuleAnimateGeneric so there are two ModuleAnimateGeneric's on the antenna. The "Toggle" action is part of ModuleAnimateGeneric and used to toggle the animation. In this case, you (the player) are not supposed to be able to trigger the light blinking animation since it does so automatically during transmission, but the creator of the part forgot to hide the Toggle action from you in the interface.

There is nothing I can do about this, AGX presents to you all the actions available to be selected on the part, it is up to the creator of the part to make sure the actions presented are correct.

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