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

[MOD?] [ASSISTANCE NEEDED] POI Lights

First time posting here, I have been playing A17 (also some earlier alphas) with a couple of friends and so far we've been enjoying it.
I love all the new POI lights that were added to the game for decoration but I've been struggling trying to find a way to allow the player to toggle them on or off. I would be very grateful if anyone could help me with this. This is what I tried so far:

First, I added the light I wanted to mod as a new block that inherits most of the properties from the original block and renamed it to e.g. lanternDecorLightPlayer. So in game there would be two blocks; lanternDecorLight which would be the POI lantern and lanternDecorLightPlayer which would be a craftable lantern for the player. Sample XPath code:

Code:
<configs>

<append xpath="/blocks">

	<block name="lanternDecorLightPlayer">
		<property name="Class" value="Light"/>
		<property name="Extends" value="porchLight01"/>
		<property name="CustomIcon" value="lanternDecorLight"/>
		<property name="CreativeMode" value="Player"/>
		<property name="RuntimeSwitch" value="true"/>
		<property name="TakeDelay" value="5"/>
		<property name="Model" value="Entities/Lighting/lanternDecorPrefab"/>
	</block>

</append>

</configs>
Now if I set the Class property to PoweredLight it all works fine I can hook up a generator and allow the lights to be toggled by the player on or off. This is great for most of the light like the ceiling fan lamps etc...

BUT I would also like to have the ability to toggle the lantern/torch block on or off without it being hooked up to a generator.

I've tried to set the Class to Light, but even with the RuntimeSwitch property set to true I get no option to toggle the lights. I've dug deeper into the .dll and found that the class BlockLight has several checks for _world.IsEditor() (which I think is the prefab editor mode?). I've modified the dll to disable these checks and that worked well. I was able to get the lights to toggle using the Light class without being in the prefab editor mode. Which btw brings up this cool customisation menu:

View attachment 25673

However, this workaround is not optimal since it allows me to toggle every POI light even those not owned by the player. What I was wondering is; is there a way to set the class to PoweredLight and have it turn on without any generators/battery banks being hooked up to it. If that is not possible, would it be possible to use the dedicated ModAPI to somehow load a custom block class into the game? Say BlockPlayerLight, I know its possible with SDX but I would ideally prefer to not use it.

If anyone is interested in using it, I've uploaded the modified Assembly-CSharp.dll that removes the _world.IsEditor() check so you can use the menu in the normal game mode: Alpha 17 B208

Some more screenshots of the menu if anyone is interested:

View attachment 25674View attachment 25675View attachment 25676View attachment 25677

Download History:

Alpha 17 B208

Alpha 17 B199
Can we get one for B221 - Use this ALOT!! Thanks in advance

 
Here is the updated Stand Alone Assembly-CSharp.dll that removes the _world.IsEditor() check so you can use the menu in the normal game mode: Alpha 17 B231 Updated

This does not need electric to function. Great tool for to light up areas you wish or Street Lights in real time.

What this does is allow you to Turn ON/OFF any POI lighting in game in real time without using the world editor.

Works on SP and MP and works on Dedicated Servers. I use it all the time to turn on POI Lights in my Dedicated server.

 
Here is the updated Stand Alone Assembly-CSharp.dll that removes the _world.IsEditor() check so you can use the menu in the normal game mode: Alpha 17 B231 Updated
This does not need electric to function. Great tool for to light up areas you wish or Street Lights in real time.

What this does is allow you to Turn ON/OFF any POI lighting in game in real time without using the world editor.

Works on SP and MP and works on Dedicated Servers. I use it all the time to turn on POI Lights in my Dedicated server.
Does this work with Build240 Stable and how would one potentially install your "All POI lights can be interacted with on a visible control panel" mod to a dedicated server?

 
Does this work with Build240 Stable and how would one potentially install your "All POI lights can be interacted with on a visible control panel" mod to a dedicated server?
It works on 240 Stable. It only gets installed on the client side it doesn't need one for a dedicated server. However if you have it installed on your end, you can enter a server and turn them on, tested on several dedicated server games I entered.

 
It works on 240 Stable. It only gets installed on the client side it doesn't need one for a dedicated server. However if you have it installed on your end, you can enter a server and turn them on, tested on several dedicated server games I entered.
Yep installed to local client and worked great on the server. Would love to use this on main server without turning off EAC. I don't suppose you have found any A17 Stable equivalent of djkrose's EAC white list? https://7daystodie.com/forums/showthread.php?69772-djkrose-s-Scripting-Mod

Or any other method that allows admin's to connect with SDX mods. Thanks again for your work on this.

 
Yep installed to local client and worked great on the server. Would love to use this on main server without turning off EAC. I don't suppose you have found any A17 Stable equivalent of djkrose's EAC white list? https://7daystodie.com/forums/showthread.php?69772-djkrose-s-Scripting-Mod
Or any other method that allows admin's to connect with SDX mods. Thanks again for your work on this.

I have uploaded version for Dedicated servers both for SDX and Non SDX

See link below as this is where I am maintaining the newest files now.

https://7daystodie.com/forums/showthread.php?100888-POI-Light-Enabler-Real-Time

 
Back
Top