Jump to content

[WIP] [1.12.x] MOARdV's Avionics Systems - MAS Interactive IVA! (v1.3.7, 7 April 2023)


MOARdV

Recommended Posts

2 hours ago, MOARdV said:

The only thing that looks questionable is 'powerOnVariable' - you don't need to include it unless you plan on using a master power switch (and then you'd need to define a master power variable).  Nothing else seems off from a quick inspection.

Thank you. I've removed the powerOnVariable, but am still seeing these errors:

[LOG 10:00:19.228] PartLoader: Compiling Part 'WildBlueIndustries/Buffalo2/Parts/Command/buffaloCommandPod/wbiBuffaloCommandPod'
[WRN 10:00:19.234] PartLoader Warning: Variable maxSkinTemp not found in Part
[EXC 10:00:19.247] UnityException: Internal_CreateGameObject is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'MASFlightComputer' on game object 'wbiBuffaloCommandPod'.
See "Script Serialization" page in the Unity Manual for further details.
	UnityEngine.GameObject..ctor () (at <12e76cd50cc64cf19e759e981cb725af>:0)
	AvionicsSystems.MASFlightComputer..ctor () (at <177a2c548c7640c9bc351c4169da46e0>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.GameObject:AddComponent(Type)
	Part:AddModule(String, Boolean)
	Part:AddModule(ConfigNode, Boolean)
	PartLoader:ParsePart(UrlConfig, ConfigNode)
	<CompileParts>d__56:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[EXC 10:00:19.251] NullReferenceException: Object reference not set to an instance of an object
	PartModule.Awake () (at <cd473063d3a2482f8d93d388d0c95035>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.GameObject:AddComponent(Type)
	Part:AddModule(String, Boolean)
	Part:AddModule(ConfigNode, Boolean)
	PartLoader:ParsePart(UrlConfig, ConfigNode)
	<CompileParts>d__56:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ERR 10:00:19.252] PartLoader: Encountered exception during compilation. System.NullReferenceException: Object reference not set to an instance of an object
  at PartModule.ApplyUpgradeNode (System.Collections.Generic.List`1[T] appliedUps, ConfigNode node, System.Boolean doLoad) [0x00029] in <cd473063d3a2482f8d93d388d0c95035>:0 
  at PartModule.Load (ConfigNode node) [0x000f9] in <cd473063d3a2482f8d93d388d0c95035>:0 
  at Part.AddModule (ConfigNode node, System.Boolean forceAwake) [0x0006f] in <cd473063d3a2482f8d93d388d0c95035>:0 
  at PartLoader.ParsePart (UrlDir+UrlConfig urlConfig, ConfigNode node) [0x00f10] in <cd473063d3a2482f8d93d388d0c95035>:0 
  at PartLoader+<CompileParts>d__56.MoveNext () [0x00685] in <cd473063d3a2482f8d93d388d0c95035>:0 
	UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
	UnityEngine.Debug:LogError(Object)
	<CompileParts>d__56:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[ERR 10:00:19.252] PartCompiler: Cannot compile part
	UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogFormat(LogType, Object, String, Object[])
	UnityEngine.Debug:LogError(Object)
	<CompileParts>d__56:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

Link to comment
Share on other sites

Ok, I found it:

        GameObject audioObject = new GameObject();
        AudioSource audioSource;
        GameObject morseAudioObject = new GameObject();

On lines 1723 and 1725. I moved the creation of audioObject and morseAudioObject to the start method, and that did the trick! This is Buffalo 2's MAS IVA, based on the outstanding IVA that you made for Kerbal Flying Saucers. It needs some work but the basics are there:

w9IiSOl.png

5QaS65c.png

iBmtsQ0.png

I may need to replace that HUD with a custom-built one that's much thinner.

I'll have a PR for you soon for the fix. Thanks for all the great work!

Link to comment
Share on other sites

19 hours ago, Angel-125 said:

Ok, I found it:

Ah.  Thank you.  I wonder why I didn't hit that in the smoke testing I did of MAS.  That's really odd.  Anyway, I'll get that integrated and released as soon as I can (which will probably be this weekend, since work is already promising to keep me overly busy this week).

Link to comment
Share on other sites

  • 2 weeks later...
55 minutes ago, Stone Blue said:

@MOARdV why would I be getting a KSP-AVC notification that there is a new update v1.3.4 available, when all i can find on the repo is 1.3.3?

Excellent question.  I checked GitHub, and I did not accidentally update the version file, so it should still report 1.3.3, as far as I know.

(Sorry, I meant to get an update out last weekend, but things have been chaotic lately)

Link to comment
Share on other sites

weird... I had an issue with MAS throwing tons of spam in the log w/a certain IVA, so I reinstalled (what i thought) was the latest local copy i had.
got AVC notif that 1.3.3 was available :P
Turns out my latest local was only 1.3.1... so i grabbed/installed 1.3.3...

Now... AVC does NOT warn me that 1.3.4 is available, and I guess it (correctly) reports 1.3.3 as current... vOv ???

Weird...

Link to comment
Share on other sites

  • 3 weeks later...

Howdy, all.  It took a while, but I finally put together MAS v1.3.4, now on GitHub.  This is another bug-fix release, with updated MM Patches courtesy @Stone Blue to eliminate log spamming when you don't have some IVA mods that MAS supports, and a fix for exceptions from @Angel-125.  I reimplemented the vessel recovery feature, so hopefully those soft locks people were seeing are gone.  And I replaced my old IAS computation (which was way wrong) with the KSP-computed IAS.

Link to comment
Share on other sites

On 7/25/2022 at 7:49 PM, Angel-125 said:

Ok, I gotta figure out how to make Blueshift's jumpgate part module work with MAS!

I keep looking at that image, and I keep thinking to myself, "I think I see how to make it work".  One of these weekends, I need to install Blueshift and start experimenting.  Maybe it'll help me get more of the touchscreen MFD pages completed while I'm at it.

Link to comment
Share on other sites

  • 2 weeks later...

@MOARdV I'm trying to setup some MFD props, but I get an err that for the life of me I cant nail down.
 

Spoiler

220901T105757.866 [ERROR] [ModuleManager.UnityLogHandle.InterceptLogHandler.LogFormat] [AvionicsSystems] INITIALIZATION ERROR: MASMonitor configuration failed.
220901T105757.867 [ERROR] [ModuleManager.UnityLogHandle.InterceptLogHandler.LogFormat] [MASMonitor] Failed to configure prop #52 (MAS_APEx_MFD40x20)
220901T105757.868 [ERROR] [ModuleManager.UnityLogHandle.InterceptLogHandler.LogFormat] [MASMonitor] System.ArgumentException: Unable to find MAS_SUB_PAGE 'APEx40x20 Top Menu' for SUB_PAGE found in MASPage MAS_APEx_MFD40x20_PG_Standby
  at AvionicsSystems.MASPage.ResolveSubPage (ConfigNode subPageNode, UnityEngine.Vector2 fontSize) [0x000c2] in <cc4df75878ce477191265da555230414>:0
  at AvionicsSystems.MASPage..ctor (ConfigNode config, InternalProp prop, AvionicsSystems.MASFlightComputer comp, AvionicsSystems.MASMonitor monitor, UnityEngine.Transform rootTransform) [0x00224] in <cc4df75878ce477191265da555230414>:0
  at AvionicsSystems.MASMonitor.Start () [0x0055f] in <cc4df75878ce477191265da555230414>:0

I have scrubbed all the sub pages, and cant find a missing reference for the 'APEx40x20 Top Menu' sub page, in any of the other pages.
Is there any way to nail down *exactly*, WHICH sub page listed in the `Standby` sub page the problem is in?

There are 45 of them :O

Edited by Stone Blue
Link to comment
Share on other sites

5 hours ago, Stone Blue said:

I have scrubbed all the sub pages, and cant find a missing reference for the 'APEx40x20 Top Menu' sub page, in any of the other pages.
Is there any way to nail down *exactly*, WHICH sub page listed in the `Standby` sub page the problem is in?

Based on the error (the 'Unable to find' message), there error is in the MAS_PAGE named "MAS_APEx_MFD40x20_PG_Standby".

MAS thinks it sees a reference to a SUB_PAGE in the standby page with a name field of "APEx40x20 Top Menu", but there is no MAS_SUB_PAGE sub page in the config node database with that name.

My first guess is that the SUB_PAGE has whitespace in the name (before and after 'Top'), when it should have underscores or no spaces?

Link to comment
Share on other sites

3 hours ago, MOARdV said:

Based on the error (the 'Unable to find' message), there error is in the MAS_PAGE named "MAS_APEx_MFD40x20_PG_Standby".

MAS thinks it sees a reference to a SUB_PAGE in the standby page with a name field of "APEx40x20 Top Menu", but there is no MAS_SUB_PAGE sub page in the config node database with that name.

My first guess is that the SUB_PAGE has whitespace in the name (before and after 'Top'), when it should have underscores or no spaces?

Yeah... I got that it seems to be a reference in the 'Standby' page... i thought it was saying it was a problem with *another* page, referenced in the Standby page vOv

Yeah, i changed the sub page name, but its some how pickking up the original name somewhere... thats where I thought I had scrubbed all 45 pagefiles, and found nothing.

WAIT!... theres supposed to be NO whitespace, and NO spaces in the page names?!?

I have this as a *root* node, in the main MFD prop cfg, with a *whole* bunch of TEXT nodes....
 

PROP
{
	<stuff>
}

MAS_SUB_PAGE
{
	name = APEx_40x20 Top Menu		//ALCOR40x20 Top Menu V2
	<stuff>...as in a whole bunch of TEXT{}s...
}

...and this as child nodes in all the page cfgs...

MAS_PAGE
{
	<stuff>....

	SUB_PAGE
	{
		name = APEx40x20 Top Menu			//ALCOR40x20 Top Menu V2
	}

	SUB_PAGE
	{
		name = APEx40x20 Bottom Menu		//ALCOR40x20 Bottom Menu V2
		position = 0, 608
	}
}


is that how to "define" those sub pages (as a MAS_SUB_PAGE root node, somewhere), then just reference them as child SUB_PAGE nodes in all the MAS_PAGE nodes?

Also, @MOARdV where/what is this "config node database" you speak of? you mean just the regular KSP database, or one specific to MAS?
 

Edited by Stone Blue
Link to comment
Share on other sites

question: is there a way to say make different IVAS togglable from inside the VAB? so you can load both RPM MAS and RPM ASET IVAS but then choose in the VAB/ SPH which one to use?

if that is impossible for any reason i can understand due to how ksp loads things.

but i also wanted to know if i load this and rpm which one gets loaded? or is it a roll of the dice?

am an idiot there was reviva in your first post. sorry for the stupid question.

Edited by AntiMatter001
Link to comment
Share on other sites

3 minutes ago, AntiMatter001 said:

question: is there a way to say make different IVAS togglable from inside the VAB? so you can load both RPM MAS and RPM ASET IVAS but then choose in the VAB/ SPH which one to use?

if that is impossible for any reason i can understand due to how ksp loads things.

but i also wanted to know if i load this and rpm which one gets loaded? or is it a roll of the dice?

Is this what you're looking for?
 

 

Link to comment
Share on other sites

1 minute ago, AntiMatter001 said:

OH SHI I DIDN'T EVEN KNOW THERE WAS A MOD FOR IT#

welp thank you! i just wanted to test MAS without needing to constantly uninstall and re-install the two mods since rpm is VERY cranky when it gets installed and uninstalled

Yeah, it's a godsend. We have to thank @610yesnolovely for his awesome work

Link to comment
Share on other sites

8 minutes ago, Forked Camphor said:

Yeah, it's a godsend. We have to thank @610yesnolovely for his awesome work

Why thanks. And yes, it was born out of the very same frustrations and then I thought "well why don't I make a mod to fix this?" (I'm a gamedev by profession). If you have issues or IVA mods you want to see let me know in the above thread.

I've supported most of the main IVA mods for Stock and Missing History, including hopefully all the MAS ones. If you have any requests/issues, check the README (where I've tried to collect all the IVA mod names I can find) and/or post in the above thread. Support is mostly driven by "I need this personally" :-)

https://github.com/harveyt/reviva/blob/main/README.md

Edited by 610yesnolovely
Link to comment
Share on other sites

13 minutes ago, AntiMatter001 said:

last i will say of this but i'm just surprised your able to choose mid game. thought the way ksp loaded things meant you can't change mid session without needing to re-boot the entire game so it ignores one of the IVAs

thats why RevIVA is a plugin, and gets around that

Link to comment
Share on other sites

2 hours ago, Stone Blue said:

is that how to "define" those sub pages (as a MAS_SUB_PAGE root node, somewhere), then just reference them as child SUB_PAGE nodes in all the MAS_PAGE nodes?

Yes, that's exactly the way it's supposed to work.  I wonder if it's some dumb ConfigNode behavior related to the comment on the same line?  I don't think I explicitly trim excess whitespace off of the beginning and end of the name, so maybe it's because of trailing whitespace in the MAS_SUB_PAGE entry?  If that is the problem, that'd be really annoying (but easy to fix).  But I'm spitballing at that.

Would you mind removing the comments off of the "name=" lines for the SUB_PAGE and MAS_SUB_PAGE, and make sure there's no blanks after the name?  Prolly only check just the one name and see if that makes it happy - if that works, I can turn a fix around later today, or tomorrow AM at the worst.

The only other "maybe" I can come up with is if the PAGE node had mismatched braces, or something.  I should add some extra verbose logging to list all of the sub pages MAS detects.

 

2 hours ago, Stone Blue said:

Also, where/what is this "config node database" you speak of? you mean just the regular KSP database, or one specific to MAS?

During startup, MAS collects all of the MAS_SUB_PAGE nodes in its own database, so when you specify a SUB_PAGE, it only needs to search its smaller collection, instead of searching through the entire KSP ConfigNode database.

Link to comment
Share on other sites

4 hours ago, AntiMatter001 said:

last i will say of this but i'm just surprised your able to choose mid game. thought the way ksp loaded things meant you can't change mid session without needing to re-boot the entire game so it ignores one of the IVAs

All the IVA internal models and data are loaded at the start of the game. The issue is that each command pod originally could only choose one of those (hard wired), so the last mod (probably alphabetical) would win and set only one IVA, even though all the data for all the choices would still be loaded.

Reviva itself essentially provides a bridge between a very cool mod called B9PartSwitch which can do all sorts of in-game magical part switching (fuel tank contents, etc, but not IVA because they're weird) and some special bits of code that are essentially "unload the IVA model" (which is when your kerbals disappear mementarily) and "load the IVA model" (which is stock code used when you switch to a craft anyway) - plus some extra code to handle RPM and MAS computers. It's like a bunch of duct tape and super glue of already existing amazing code that I didn't write.

Caveat emptor: You may lose a Kerbal or spacecraft, warranty especially void if you change IVA with a different number of seats while in flight. :-D However I'm using it all the time without incidents (other than due to my bad designs).

Edited by 610yesnolovely
Link to comment
Share on other sites

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