Jump to content

Salvaged Electronics (Solar, Battery, Generator, Lights, Signs, Misc)


ShoudenKalferas

Recommended Posts

Here is a Modlet pack I've been working on. This is a Work In Progress (WIP), so please be kind with any problem reports.

 

It kept annoying me that I would pass a military base with a generator ("destroyed") and be unable to wrench on it and have at least a CHANCE at recovering a working unit. The same with solar panels. Just because the world went to crap and everyone turned to Zombies doesn't mean all the electronics of the world stop functioning. So I'm working through a Modlet pack that will allow the players to wrench at any electronics (solar, generator, battery, signs, lights, and misc parts), and at least have a chance at obtaining a usable item that they can place in their own base.

 

TESTED as working:

Battery Bank

Generator

Solar Bank

Lights

Parts

 

UNTESTED:

Signs

 

I've split this into multiple Modlets to make it easy for you to enable/disable any specific category of items:

Salvaged Electronics - Battery Bank (tested)

Salvaged Electronics - Generator (tested)

Salvaged Electronics - Lights (tested)

Salvaged Electronics - Parts (tested)

Salvaged Electronics - Signs (untested, use at own risk)

Salvaged Electronics - Solar (tested)

 

Current Download:

A18.3_1.1 - https://github.com/XelaNull/7DTD-SalvagedElectronics/archive/A18.3_1.1.zip

 

Previous Download:

https://github.com/XelaNull/7DTD-Sal.../A18.3_1.0.zip

Link to comment
Share on other sites

Sadly, it looks like the lighting mod is not working properly. I am able to wrench off lights and obtain items.. However, when I go to place the light somewhere, even with power connected up the light does not turn on. Oddly, I do have the switch enabled so you get the option in-game to turn the light on and off.. but the actual light does not come on. I'm not sure why this is and will have to dig around further to see if I can come up with a way to fix this. If anyone has any modding experience and has an idea on this, I would greatly appreciate any suggestions. I've tried asking on Discord without any luck.

Link to comment
Share on other sites

I've got the Lights modlet working as intended now and the Parts modlet has been reported by players as working. The only modlet not tested at this point is signs. Once I let this lights release bake in a bit as far as release, I'll then circle back around to the signs. Enjoy working wrenchable POI Lights giving you usable placeable lights!

Link to comment
Share on other sites

  • 2 months later...

Salvaged Electronics - Solar 

I get an error and it won't load.  the log won't tell me what the problem is, it just tells me it won't load.

 

from the log

2020-05-01T16:13:31 32.912 INF ItemIDs from Mapping
2020-05-01T16:13:32 33.820 WRN XML patch for "recipes.xml" from mod "Salvaged Electronics - Solar Bank" did not apply: <remove xpath="/recipes/recipe[@name='solarCell']" 
2020-05-01T16:13:38 39.161 INF createWorld: Navezgane, ModTesting, GameModeSurvival
 

 

thanks

 

Link to comment
Share on other sites

1 hour ago, mlburgoon said:

Salvaged Electronics - Solar 

I get an error and it won't load.  the log won't tell me what the problem is, it just tells me it won't load.

 

from the log

2020-05-01T16:13:31 32.912 INF ItemIDs from Mapping
2020-05-01T16:13:32 33.820 WRN XML patch for "recipes.xml" from mod "Salvaged Electronics - Solar Bank" did not apply: <remove xpath="/recipes/recipe[@name='solarCell']" 
2020-05-01T16:13:38 39.161 INF createWorld: Navezgane, ModTesting, GameModeSurvival
 

 

thanks

 

This is just warning, not an error. The mod itself should be loaded, but if it does not load due to this warning, try to remove this piece of code from solar bank recipes.xml:

<!-- The line below was added for compatibility in case another modlet creates this recipe -->
	<remove xpath="/recipes/recipe[@name='solarCell']" />

As the comment suggests, it's added for compatibility with any other mod you may be using that is also creating this recipe. However, base game does not have this recipe, so this mod is trying to remove something that does not exist in the first place, hence the warning you're getting.

Link to comment
Share on other sites

45 minutes ago, mlburgoon said:

Ah.  ok.  Thanks.  I guess this goes back to some of my original posts and questions about modding.  Make sure to use unique names for stuff you do and create so it does not cause issues.

 

Thanks again.

Making unique names can cause all kinds of dooms. The recipe name must match the name of an item it creates...

 

So...

You could go around this by creating a new unique item with its unique name and recipe. Then you would make sure this new item inherits the same properties of the existing item you're trying to replicate.

 

Say you wanted to create a new solarCell item and recipe for it, then you could call it NewSolarCell both in the new item as well as in its recipe. If you did it this way, you would probably also have to figure out how to allow solar banks to use it, because by default they can use solarCell, but not your NewSolarCell. And that's a tricky part which would lead you to finding this line inside solar bank block that governs solar bank itself:

<property name="SlotItem" value="solarCell"/>

As you can see, it takes solarCell as an input, however, your newly created unique solar cell is called NewSolarCell and not solarCell, right? So you would run into a show stopper right there and start asking a question "how to extend solar banks to also use NewSolarCell and not just solarCell?" And that would be a good question, but unless the game can accept multiple values inside value attribute like it does in case of tags attribute, you would have to create your new unique solar bank too. Value attribute can actually take several inputs separated by commas, but would it work in this case? I don't know, but if you ever wanted to go that extra mile to find out, it could be added through xpath like this inside blocks.xml of your mod:

<append xpath="/blocks/block[@name='solarbank']/property[@name='SlotItem']/@value">,NewSolarCell</append>

 

Link to comment
Share on other sites

Ah.  Yes.  I didn't realize solarCell was already in the game.  So that explains that.  I know for stuff I create that is NOT in the game already, I try not to use a "generic" name, but make it unique for my new unique object.  My new mod I just put out does this just right.  The current repair kit that is in the game is left alone.  But my custom ones have very unique names so they don't get blasted by another mod somewhere.  That also makes it more compatible with new mods and other mods because if they use the default repair kit, it still works.

 

Link to comment
Share on other sites

6 minutes ago, mlburgoon said:

Ah.  Yes.  I didn't realize solarCell was already in the game.  So that explains that.  I know for stuff I create that is NOT in the game already, I try not to use a "generic" name, but make it unique for my new unique object.  My new mod I just put out does this just right.  The current repair kit that is in the game is left alone.  But my custom ones have very unique names so they don't get blasted by another mod somewhere.  That also makes it more compatible with new mods and other mods because if they use the default repair kit, it still works.

 

Actually it's a double-edged sword in this case, because use of vanilla repair kit is getting replaced in all vanilla items, therefore it probably has no use for repairing anything if you play with just this mod and no other mods that would add some use for it again. One of the possible solutions for this would be to use vanilla repair kit as an extra ingredient in recipes for the extra repair kits that you are creating.

Link to comment
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...