Jump to content

[MOD] Portable Lights


P_E_T_E

Recommended Posts

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.thumb.jpg.c9b2b488cdbba46f3c9197f4315fb4df.jpg

 

Custimisation Menu

 

20181130194602_1.thumb.jpg.9f3918cc7fe1068068b9139af6de8bf9.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.thumb.jpg.5ce40cb1350ea6325fa70e607809c8d5.jpg

20181130194534_1.thumb.jpg.0243fd650bc435d2d4c2f8c543602b84.jpg

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Archived

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

×
×
  • Create New...