Jump to content

[1.3.1] ScienceAlert 1.9.1: Experiment availability feedback (10.feb.18)


DennyTX

Recommended Posts

I'm afraid you are going to have to change your code a bit.  There is a Unity bug where it compresses image files when it loads them into the game database, and if it isn't a power of two, messes it up.  So I had to put code into the Toolbar to manually load the button image from the file, bypassing the compression that Unity does.

This mod is inserting the button into the internal game database, the problem is that I have no way to know if a texture was inserted by a mod or loaded by Unity.  And Unity is messing up the textures so I had to write my own routines to load the buttons from the file, bypassing the database

Hold off on any changes, I may have just come up with a way to detect this

Edited by linuxgurugamer
Link to comment
Share on other sites

 @jefftimlin Again, thanks for taking this on board. It seems that there's a (minor) error being thrown though.

Whenever the ScienceAlert flask icon is being displayed on the toolbar, the log gets spammed with error messages like this:

[Toolbar] [ERROR] Cannot find texture to load:C:/Games/ksptest/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0056

This is from a test with KSP 1.4.1, with only your updated version for 1.4.1 (Release 1.1) and Toolbar Continued 1.17.5.

Full log is here: https://www.dropbox.com/s/yg18wn0w0if5odl/output_log.txt?dl=0

The actual icon displays just fine, regardless of the error messages, and it doesn't seem to affect playability in any way, so it's no big deal to me. Just thought I'd mention it.

I've tried rolling back Toolbar to earlier versions, and it didn't help. I tried renaming the "ScienceAlert-Updated" folder to just "ScienceAlert"; didn't help. I tried placing the "Textures" folder from the github source inside the ScienceAlert folder; the same error message occurs but it displays a purple square instead of the icon. I've tried downloading the source code and compiling it myself;  no dice.

Like I say, seems harmless and doesn't seem to bog my computer down any, so *shrug*, no biggy.

Pinging @linuxgurugamer as this seems to be a disagreement between these two mods, and from previous posts it seems like he was dealing with some icon issues earlier.

Link to comment
Share on other sites

@UnanimousCoward Sorry it's spamming the log. The issue is as @linuxgurugamer described, where ScienceAlert is using its own mechanism to load the textures from within the DLL, but the Toolbar mod is trying to load them as files from disk, to get around an apparent compression issue. Sounds like he was onto a fix/workaround of some kind to avoid trying to load them from file in this case.

Link to comment
Share on other sites

  • 2 weeks later...

@jefftimlin @linuxgurugamer I repeat my post from April 4th, still spam with ScienceAlert 1.9.0.1 and ToolBar controller 0.1.6.0

Edit:

as I went EVA and boarded, the "MJ" icon was gone from Toolbar, also no more existing in the list of available icons.

Log:
https://www.dropbox.com/s/kprzazfhyrxesq0/2018-04-14_2 KSP.log.7z?dl=1

Edited by Gordon Dry
Link to comment
Share on other sites

That's odd. From the log, this would still seem to be a problem with the toolbar mod:

[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask

It shouldn't be trying to load the file from disk, it doesn't exist.

I can't reproduce the problem though, so not sure.

Link to comment
Share on other sites

6 hours ago, jefftimlin said:

That's odd. From the log, this would still seem to be a problem with the toolbar mod:

[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask

It shouldn't be trying to load the file from disk, it doesn't exist.

I can't reproduce the problem though, so not sure.

It actually isn't, and i've added an additional message to the log to verify.

Explanation:

Since most mods load their icons from image files, the toolbar first tries to load the image from disk.  Failing that, it then checks the game database.

Here is the output from my log file with the additional debug statements:

[Toolbar] [ERROR] Cannot find texture to load:R:/KSP_1.4.1_dev/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0020
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

[Toolbar] [ERROR] Texture loaded from game database: ScienceAlert/textures/flask0020

And I got the flask on the toolbar.

@jefftimlin if you are taking this over, you may want to look at the ToolbarController.  I noticed in th ScienceAlert code that there was a log of code related to controlling the toolbar button, most of that can be removed if you replace it with the Toolbarcontroller.

So, @Gordon Dry, all of these messages in the log:


[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0093
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0094
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0095
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0096
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0097
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0098
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0099
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0100
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0001
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0002
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0003
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0004
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0005
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0006
[Toolbar] [ERROR] Cannot find texture to load:D:/Kerbal Space Program/KSP_x64_Data/../GameData/ScienceAlert/textures/flask0007

If this is the log spam you are referring to, I'll see what I can do about reducing it.  But, 

 

I just released an update which removes that log spam

1.7.17.6

  • Removed log spam when textures are loaded by mod and not from a file
Link to comment
Share on other sites

  • 4 weeks later...

Hello all, does Science Alert require Blizzy's toolbar? I am using @jefftimlin's release and I am not getting a science alert button in my stock toolbar. With @linuxgurugamer's Toolbar Controller included, I had assumed that it would work with or without Blizzy's toolbar.

 

Edit: I have just noticed the settings.cfg file in the mod folder and checked out the source code to figure out how to use it:

1) You can set ScanInterfaceType = ScanSat to disable biome alerts unless the biome has been scanned. (I am not too sure about the details.)

2) It seems I have to use Blizzy's toolbar, because the ApplicationLauncher option for ToolbarInterfaceType has been commented out. Still I have hopes that the mod can use lgg's toolbar controller to have access to both toolbars. Possibly in a future release.

Edited by canisin
Link to comment
Share on other sites

  • 4 weeks later...

@jefftimlin @DennyTX

This mod is very useful and should be updated for 1.4.  If there isn't any objection, I'll be working on adopting this and updating it for 1.4, as well as adding support for the toolbarcontroller and clickthroughblocker.

By using the ToolbarController, the user will have the option as to where to put the button, and will remove any complex button logic from the code

 

Link to comment
Share on other sites

8 hours ago, linuxgurugamer said:

@jefftimlin @DennyTX

This mod is very useful and should be updated for 1.4.  If there isn't any objection, I'll be working on adopting this and updating it for 1.4, as well as adding support for the toolbarcontroller and clickthroughblocker.

By using the ToolbarController, the user will have the option as to where to put the button, and will remove any complex button logic from the code

 

@linuxgurugamer no objections from me. I did already update it for 1.4.1, but any further updates would be welcome. I was just about to try it out in 1.4.3 last night but ran out of time, so I'm not sure if it works or not. I never received any response from @DennyTX when I contacted him about the mod, so I'm not sure what his intentions are.

 

Link to comment
Share on other sites

1 minute ago, jefftimlin said:

@linuxgurugamer no objections from me. I did already update it for 1.4.1, but any further updates would be welcome. I was just about to try it out in 1.4.3 last night but ran out of time, so I'm not sure if it works or not. I never received any response from @DennyTX when I contacted him about the mod, so I'm not sure what his intentions are.

 

There is an amazing amount of code which can be eliminated by using the toolbar controller, I started wo t.f king on it today 

Link to comment
Share on other sites

I have a beta for people to test, 1.9.2-beta1

  • Adoption by LGG
  • Added support for ToolbarController
  • Added support for the ClickThrough Blocker
  • Removed old code used for the Blizzy Toolbar

This REQUIRES the latest version of both the Toolbar Controller (just updated) and ClickThroughBlocker

It seems to be fully functional and working, although I'm waiting for someone to remake the flask icons for the stock toolbar

ToDo

  • Update icons for stock toolbar
  • Add code to ignore certain experiments

Available here:  https://github.com/linuxgurugamer/ScienceAlert/releases

License is GPL

I'd really like some feedback on this, there were a lot of changes needed to remove old, unused code which was there for the Blizzy Toolbar, but never really used.

 

Link to comment
Share on other sites

Actually, I'm getting an error when using it my regular playthrough with a bunch of other mods. Not sure what might be conflicting.

When experiments become available, it plays a sound and shows the experiment buttons in the UI, but the toolbar icon doesn't animate.

In the log:

[EXC 12:06:12.077] ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
	System.Collections.Generic.List`1[System.String].get_Item (Int32 index)
	ScienceAlert.ScienceAlert+<DoAnimation>d__30.MoveNext ()
	ScienceAlert.ScienceAlert.Update ()

Edit: Actually it's easy to reproduce without any other mods installed except for the dependencies. Simply revert to launch, and the problem starts happening. I'll see if I can debug it.

Edit 2: Yep, fixed it. I'll send a PR.

Edited by jefftimlin
Link to comment
Share on other sites

6 hours ago, jefftimlin said:

Actually, I'm getting an error when using it my regular playthrough with a bunch of other mods. Not sure what might be conflicting.

When experiments become available, it plays a sound and shows the experiment buttons in the UI, but the toolbar icon doesn't animate.

In the log:


[EXC 12:06:12.077] ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
	System.Collections.Generic.List`1[System.String].get_Item (Int32 index)
	ScienceAlert.ScienceAlert+<DoAnimation>d__30.MoveNext ()
	ScienceAlert.ScienceAlert.Update ()

Edit: Actually it's easy to reproduce without any other mods installed except for the dependencies. Simply revert to launch, and the problem starts happening. I'll see if I can debug it.

Edit 2: Yep, fixed it. I'll send a PR.

Great, thanks.  Was a simple fix, appreciate it.  For those who may be interested, I've added new icons for the stock toolbar, and missed repopulating a list after a revert.

I've merged @jefftimlin's changes, will be in the next beta

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