Jump to content

[0.25] PartCatalog 3.0 RC8 (2014-10-08)


BlackNecro

Recommended Posts

Hey Toerti! Thanks for the category icons. However, I have to second Arron Rift's statement on them. Don't get me wrong. They are nicely done and I'd rather have them than not have them, but they clash with the stock GUI style which the rest of Part Catalog shares. As for black and white being boring, that might be so, but I don't think sorting icons are something you really want to be that lively. If there were grey-scale versions of your icons, I'd consider the mod perfect.

That said, there are some buttons in the KSP GUI that use color. The ones in the top right of the VAB/SPH are a good example. They use muted color backgrounds with dark icons drawn on top. The background color lights up a bit on mouseover and the icon turns white. I think that style would look really good for category icons. In fact, I'm liking the idea enough to try my hand at making all my Part Catalog icons like that, though I think I'll see how the GUI changes in .24 before making the attempt.

Link to comment
Share on other sites

Hi everyone ! I'm coming here again because I haven't found a workaround for the issue I was experiencing : to say it briefly, Autotag is FUBAR and does not recognize new parts. When I try to reset the tags by right-clicking on Autotag, it actually deletes all tags, turning my part list into an endless void. I'm using 64-bit : I'd like to test with 32 bit but I'm running too many mods to go back now :)

Did anyone have the same issue with the Autotag function ?

Link to comment
Share on other sites

I am currently reworking the icons. I am adding some more part icons as well as tweeking the colors as suggested. The active one ones are now darker and the off states are still the same. I will provide a download for the new theme as soon as it is finished.

I also changed a lot on the default.lua files and added some more 'mod'.rule.lua files. I will talk to BlackNecro regarding my changes inside the default.lua's if they will make it into the next RC.

The 'mod'.rule.lua's will also be provided as downloads soon.

Link to comment
Share on other sites

Hi everyone ! I'm coming here again because I haven't found a workaround for the issue I was experiencing : to say it briefly, Autotag is FUBAR and does not recognize new parts. When I try to reset the tags by right-clicking on Autotag, it actually deletes all tags, turning my part list into an endless void. I'm using 64-bit : I'd like to test with 32 bit but I'm running too many mods to go back now :)

Did anyone have the same issue with the Autotag function ?

Yes, it was caused by a bad lua script. Can you bring up the debug log (ALT+F2) and see if you have any parse errors right after you hit Autotag?

Link to comment
Share on other sites

Yes, it was caused by a bad lua script. Can you bring up the debug log (ALT+F2) and see if you have any parse errors right after you hit Autotag?

I'm reinstalling the mod and checking right now. I'll report back with the results.

Link to comment
Share on other sites

I am adding AlchemyTechnologies parts and they don't get listed in PC RC4. I hit Alt-F2 and Autotag again. Results in the log are:

[Exception]: LuaScriptException: [string "chunk"]:147: attempt to concatenate field 'resourceName' (a nil value)

I am running KSP in 64bit version on Windows.

Link to comment
Share on other sites

For those of you,who requested a more stockalike style of the icons.

PCV3_new-icon-theme.jpg

I also added some new resource based Icons (especially inside the category storage; utility/generator and converter. Although I am not sure if we will ever see a mod who for example introduces neon or helium as a resource. The icons are there.

I also wrote some new rule.lua files for the following mods:

- AdvancedGenerators

- AviationLights

- NearFuture

- KethanePack

- MissionControl

To get the latest version and insructions go to this post!

Comments and suggestions are welcome!

Toerti

Edited by toerti
new files and instructions available
Link to comment
Share on other sites

I am adding AlchemyTechnologies parts and they don't get listed in PC RC4. I hit Alt-F2 and Autotag again. Results in the log are:

[Exception]: LuaScriptException: [string "chunk"]:147: attempt to concatenate field 'resourceName' (a nil value)

I am running KSP in 64bit version on Windows.

Could both of you please compress and upload the PartList.lua file inside the plugindata/partcatalog directory and send it to me for examination?

Link to comment
Share on other sites

I also wrote some new rule.lua files for the following mods:

- AdvancedGenerators

- AviationLights

- NearFuture

- KethanePack

- MissionControl

You can get it here!

Unzip the file and copy it into your GameData/PartCatalog/PlugIns/PluginData/PartCatalog folder.

EDIT: my scripts are now at https://github.com/Starstrider42/part-catalog-scripts. Forums make poor code repositories for some reason. :P

Edited by Starstrider42
Moved to Github
Link to comment
Share on other sites

I am happy to see more people playing with the rule.lua files!

If there will be more we might need an exchange thread of its own 😄

Edited by toerti
Link to comment
Share on other sites

For those of you,who requested a more stockalike style of the icons.

Here is a new theme set of all Icons. Simply unzip the file and copy it into your GameData/PartCatalog/PlugIns/PluginData/PartCatalog/Icons-Folder. It will overwrite the Categories folder inside.

http://www.toerti.de/kerbal/PCV3_new-icon-theme.jpg

I also added some new resource based Icons (especially inside the category storage; utility/generator and converter. Although I am not sure if we will ever see a mod who for example introduces neon or helium as a resource. The icons are there.

Just noticed this. Thanks for expanding the icons (it will work great with my generic storage/converter code :)), but I think we're running into a standardization problem both with the RC4 icons and with the new set. Basically, the resource icons have different names in different categories:

  • Argon and Helium is called by those names everywhere except for Engine/ION_, where they're abbreviated.
  • Power is called ElectricCharge or Electricity for converters, but EC_Battery for storage.
  • LH2 and Neon are available for all the groups except Control/RCS_
  • LiquidFuel is called both LF and LiquidFuel everywhere except for engines, where only LiquidFuel is available. An analogous situation applies to OX and Oxidizer.
  • MonoPropellant is called both MonoProp and MonoPropellant for RCS, Converters, and Generators, but only MonoPropellant for engines and storage. In addition, Engine/MonoPropellant does not fit the naming scheme for other engines.
  • XenonGas has no less than three names: Xenon for all categories except RCS, XenonGas for RCS, Converters, and Generators, and Xe for ion engines. Confusingly, it's Xe for ion engines and Xenon for regular engines.

BlackNecro and/or toerti, could you please pick one and only one name for the resource icons and use it consistently across the pack? That would make things much easier to code for. Thanks!

Edited by Starstrider42
Link to comment
Share on other sites

Thanks for pointing that out in detail. Will make it much easier for me to rename them. I will need to take a look into the default.lua files in order to name them correctly.

Some icons are doubled as well to make them work with the default fallback in order to check for an existing icon by the part resource name. Some name the resource Xenon and some XenonGas for example.

Link to comment
Share on other sites

Here is a new file!

It contains the corrected icons plus new default.lua-files (category;rule;fallback)

Plus the mod.rule.lua files from my inital post.

In order to copy the Icons folder into the same place, first delete the old Icons folder.

You can unzip the file and copy all to your KSP/GameData folder. When asked confirm overriding old files.

And here is the file.

-Toerti

P.S.: Don't forget to ctrl+click Autotag inside PartCatalog settings in order to recreate the tag-tree

Edited by toerti
Link to comment
Share on other sites

A few bugs I've noticed with the new scripts/icons:

  • The Structural/CargoBay icon does not have an off state, so it is not recognized by PartCatalog
  • The two halves of the Structural/Coupler icon don't match
  • The Category/RCS/MonoPropellant category does not have an icon.
  • Stock struts are not placed in Structural/StrutConnector

Link to comment
Share on other sites

Adding a 'Replace' call to escape slashes fixes breakage on text descriptions or paths that end in \ escaping a closing quote, fouling up partsString.lua...

From line 326 of LuaRuleHandler.cs;

private static string escapeString(object toEscape)

{

return toEscape.ToString().Replace("\\","\\\\").Replace("\"", "\\\"");

}

Link to comment
Share on other sites

Adding a 'Replace' call to escape slashes fixes breakage on text descriptions or paths that end in \ escaping a closing quote, fouling up partsString.lua...

From line 326 of LuaRuleHandler.cs;

private static string escapeString(object toEscape)

{

return toEscape.ToString().Replace("\\","\\\\").Replace("\"", "\\\"");

}

I recompiled with this.

After adding some bigger part packs (LLL & AlchemyTechnologies) I see some errors in the Log:

[Error]: Could not find part in index: ST.Rover

[Error]: Could not find part in index: ST.Solarpanel.small

[Error]: Could not find part in index: ST.LightSpot

4x [Exception]: LuaScriptException: [string "chunk"]:147: attempt to concatenate field 'resourceName' (a nil value)

The new mods don't show up.

Link to comment
Share on other sites

Is there some glitch that causes backslashes to show up as pipe characters on the forums?

This fixed a lot of problems I encountered with bigger part packs, I have SXT (by the maker of LLL), but no LLL or AlchemyTechnologies ...

partString is found at GameData\PartCatalog\Plugins\PluginData\PartCatalog\partString.lua

Paste line 147 from partString? Syntax check the whole file, and paste any other errors? Or upload the whole thing somewhere...

Link to comment
Share on other sites

[Exception]: LuaScriptException: [string "chunk"]:147: attempt to concatenate field 'resourceName' (a nil value)

Found a problem around line 147 in PartCatalog\Plugins\PluginData\PartCatalog\default.rule.lua

--RCS
for rcs in modulesByName(part,"ModuleRCS") do
if containsNodeTypeName(rcs,"resourceName","MonoPropellant") then -- EDIT START (check with iconExist)
addToModCategory(part,"Control/RCS/MonoPropellant")
else
addToModCategory(part,"Control/RCS/"..rcs.values.resourceName,rcs.values.resourceName, "Categories/Control/RCS_Misc")
end -- EDIT END
end

Changed this to:

	--RCS
for rcs in modulesByName(part,"ModuleRCS") do
if containsNodeTypeName(rcs,"resourceName","MonoPropellant") then -- EDIT START (check with iconExist)
addToModCategory(part,"Control/RCS/MonoPropellant")
elseif containsNodeTypeName(rcs,"resourceName","LFOX") then
addToModCategory(part,"Control/RCS/LiquidFuel")
end -- EDIT END
end

This does the trick to get the RCS with LiquidFuel listed!

Link to comment
Share on other sites

Might want to extend that elseif with a plain else case under it with addToModCategory(part,"Control/RCS/[something goes here]"), or there will be other missing RCS parts...

Strange though, if resourceName is nil, then that means that the RCS has no fuel, thus no category?


--RCS
for rcs in modulesByName(part,"ModuleRCS") do
if containsNodeTypeName(rcs,"resourceName","MonoPropellant") then
addToModCategory(part,"Control/RCS/MonoPropellant")
elseif rcs.values.resourceName == nil then
addToModCategory(part,"Control/RCS/Misc")
else
addToModCategory(part,"Control/RCS/"..rcs.values.resourceName,rcs.values.resourceName, "Categories/Control/RCS_Misc")
end
end

Maybe something like that? *Did not test.

Edited by JackQW
Had an idea, fixed typos, notes
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...