• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

[MOD] Portable Lights

P_E_T_E

New member
Adds portable light blocks (lantern and flashlight) to the game.

Similar to the torch, once crafted they can be placed anywhere to give off some light and they can also be picked back up again.

If you hold 'e' there is also a custimisation menu that can adjust various parameters of the lights like color and effect

To install copy both folders Mods and 7DaysToDie_Data to the root directory of the game.

Recipes

20181130194447_1.jpg

Custimisation Menu

20181130194602_1.jpg

Other Screenshots

Download PETE_-_Portable_Lights.zip

Thanks to developer_fyy fo helping me solve the custom block class loading issue.

Known issues:

  • Once the color/custimisation settings are set if the light is picked up and placed again it reverts to its original settings.
  • Server does not push mod.dll to the players, everyone playing on the server needs to install the mod locally
  • On a dedicated server only the player changing the settings can see the changes (client sided custimisations?)

20181130194441_1.jpg

20181130194534_1.jpg

 
Last edited by a moderator:
Getting loads of NullReferenceException with this one for single player, and some block not found errors for dedi server.

 
Last edited by a moderator:
2018-12-01T12:43:34 39.065 ERR XML loader: Loading and parsing 'blocks.xml' failed

2018-12-01T12:43:34 39.065 EXC Class 'BlockPlayerLight,mods' not found on block candleWallLightPlayer2!

Exception: Class 'BlockPlayerLight,mods' not found on block candleWallLightPlayer2!

at BlocksFromXml.CreateBlocks (.XmlFile _xmlFile, Boolean _fillLookupTable) [0x00000] in <filename unknown>:0

at BlocksFromXml.CreateBlocks (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0

at WorldStaticData.LoadBlocks (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0

at WorldStaticData+<loadSingleXml>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0

UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

UnityEngine.DebugLogHandler:LogException(Exception, Object)

UnityEngine.Logger:LogException(Exception, Object)

UnityEngine.Debug:LogException(Exception)

Logger:masterLogException(Exception)

Logger:Exception(Exception)

Log:Exception(Exception)

<loadSingleXml>c__Iterator1:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

2018-12-01T12:43:35 40.133 ERR XML loader: Loading and parsing 'items.xml' failed

2018-12-01T12:43:35 40.133 EXC Unknown block name 'wallTorchLightPlayer' in use_action!

Exception: Unknown block name 'wallTorchLightPlayer' in use_action!

at ItemActionPlaceAsBlock.ReadFrom (.DynamicProperties _props) [0x00000] in <filename unknown>:0

at ItemClassesFromXml.parseItem (System.Xml.XmlElement _node) [0x00000] in <filename unknown>:0

at ItemClassesFromXml.CreateItems (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0

at WorldStaticData.LoadItems (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0

at WorldStaticData+<loadSingleXml>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0

UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)

UnityEngine.DebugLogHandler:LogException(Exception, Object)

UnityEngine.Logger:LogException(Exception, Object)

UnityEngine.Debug:LogException(Exception)

Logger:masterLogException(Exception)

Logger:Exception(Exception)

Log:Exception(Exception)

<loadSingleXml>c__Iterator1:MoveNext()

UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 
Looks like some of the errors are caused by his .dll adding class "BlockPlayerLight" but his blocks are set to use class "PlayerLight". Opened the .dll and it looks like that's the case. He might have made a last minute change and forgot to update before release. Edit: Actually I'm not sure, he said on the other thread that shouldn't be the case. I may need to look into this more. Not sure if I am proficient enough with .dll hacks to fix on my own.

Exactly what I needed thanks! I created a dll called mods.dll with a new class BlockPlayerLight, for the class code I simply copy pasted the decompiled BlockLight class and removed the editor world checks and used this xml code for the block:
For the class name I removed Block because the game adds that automatically when looking for the class and it works great I can access the menu and toggle lights without modifying Assembly-CSharp.dll

I will try to create the recipies and the block xmls and put it up for download if anyone wants to use it. Thanks for your help!


Second error with wallTorchLightPlayer I'm guessing this is during load and because of the previous error blocks.xml is not loading at all, thus causing the error where none of the default blocks can be found.

 
Last edited by a moderator:
So, I just tested it myself and it seems to work fine. Are you guys sure you have it installed properly? You placed mods.dll in 7DaysToDie_Data\Managed? If you are positive it's installed properly, are you sure another mod isn't conflicting, or when exactly do you see these nullreference errors?

 
This isn't working with my A17 but i would like to use it. Can it be updated? I mean, i saw another post but the photos don't seem to be like the original make.

I am talking about the portable lights mod.

 
Last edited by a moderator:
Back
Top