Jump to content

A15 - Working Electric Lights


Valmar

Recommended Posts

Here you go:

 

<block id="540" name="tableLamp">

<property name="Extends" value="endTableLamp" />

<property name="CustomIcon" value="endTableLamp" />

<property name="Class" value="Particle" />

<property name="ParticleName" value="candleWall_flame" />

<property name="ParticleOffset" value="0.5,1.6,0.48" />

<property name="Light" value="15" />

</block>

 

WOW .. that was fast... many thanks for that..

 

But i cant get it to work. i add it to blocks.xml and the server will not start again. I had to remove it again from the xml file. and server running again :/

Link to comment
Share on other sites

Make sure the block ID is not taken. Add it down on the bottom file (above </blocks>

 

The code, as is, works fine for me on a vanilla file.

 

nothing was using id 540.. i change it to 2019 and now all if working.

 

Sorry for the late testing, i have been sick..

 

so onces again.. Thanks for making it..

 

Best regards

 

Hjorten

Link to comment
Share on other sites

  • 1 month later...

I love this, and hope you keep it up but I was wondering if you could find a way to make those table lamps emit light? Would be nice to have a working 1 of those to go with my couch but the ones I have found in game (book store I think is where I got em) dont work.

Link to comment
Share on other sites

The table lamp is a bit unique. It doesn't actually have an "on" state. But you could add a candle effect to it to make it emit a little light.

 

Here you go:

 

<block id="540" name="tableLamp">

<property name="Extends" value="endTableLamp" />

<property name="CustomIcon" value="endTableLamp" />

<property name="Class" value="Particle" />

<property name="ParticleName" value="candleWall_flame" />

<property name="ParticleOffset" value="0.5,1.6,0.48" />

<property name="Light" value="15" />

</block>

Link to comment
Share on other sites

  • 4 weeks later...

Truly a great mod, I smiled when I first saw the effect in my base. Torches has it limits and have a very orange'ish color.

I was first thinking to add batteries as a power source but batteries dont drop that often and clutter the inventory, but a generator or something like that would be cool. Anyway its not really a big issue sine torches have unlimited fuel also.

Link to comment
Share on other sites

  • 1 month later...

Honestly I'm not sure if it works in A15 since I never tried this version. In A15 we have a new property that actually lets us toggle lights on and off - which works a whole lot better than my DeadGrass version used here. I will update the code to this new standard when A15 is officially released to the stable branch.

 

Here is an example, though:

 

Old A13 Code:

 

<block id="2016" name="lightWall">

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="Extends" value="wallLight01" />

<property name="Class" value="Deadgrass" />

<property name="CustomIcon" value="wallLight01" />

<property name="Place" value="TowardsPlacerInverted" />

<drop event="Destroy" count="0" />

<property name="CanPickup" value="true" />

</block>

 

New Code:

 

<block id="2016" name="lightWall">

<property name="Extends" value="wallLight01" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="wallLight01" />

<property name="Place" value="TowardsPlacerInverted" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

 

 

 

Before I used the Class of Deadgrass make the lights come on. Now we have a new property that makes that old method pointless.

<property name="RuntimeSwitch" value="true" />

This property lets you turn the light on or off with the interaction key. Its so much better than my old way.

 

Here is what I'm using in my experimental Valmod build right now:

A15 Experimental code

 

 

<block id="2008" name="lightPorchBrass">

<property name="Extends" value="porchLight04Brass" />

<property name="DescriptionKey" value="lightGroupDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="porchLight04Brass" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2009" name="lightPorch">

<property name="Extends" value="porchLight04" />

<property name="DescriptionKey" value="lightGroupDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="porchLight04" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2010" name="lightCeiling3">

<property name="Extends" value="ceilingLight01" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="ceilingLight01" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

 

<block id="2012" name="lightCeilingDomeBrass">

<property name="Extends" value="ceilingLight02Brass" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="ceilingLight02Brass" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2013" name="lightCeiling">

<property name="Extends" value="ceilingLight04" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="ceilingLight04" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2014" name="lightCeiling2">

<property name="Extends" value="ceilingLight05" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="ceilingLight05" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2015" name="lightCeilingBrass">

<property name="Extends" value="ceilingLight05Brass" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="ceilingLight05Brass" />

<property name="Place" value="TowardsPlacer90" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

<block id="2016" name="lightWall">

<property name="Extends" value="wallLight01" />

<property name="DescriptionKey" value="WorkingLightDesc"/>

<property name="RuntimeSwitch" value="true" />

<property name="CustomIcon" value="wallLight01" />

<property name="Place" value="TowardsPlacerInverted" />

<drop event="Destroy" count="0" />

<drop event="Harvest" name="Lightbulb" tool_category="Pluck" count="0" />

</block>

 

 

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

Light Particle Effect?

 

Hey Val,

 

Invariably in any "horror" or "suspense" film I watch there is a florescent light fixture or a neon sign on the side of some building with one letter that is flickering on and off at random intervals. I was thinking that adding this feature would make a really awesome mod, but doubt there is a particle effect currently in game which would accomplish it. I thought about using the torch flame effect, but wanted the color of the flame particle effect to be closer to what the current florescent store lights are. Any ideas on a workaround for either thought? Thanks

Link to comment
Share on other sites

Hey Val,

 

Invariably in any "horror" or "suspense" film I watch there is a florescent light fixture or a neon sign on the side of some building with one letter that is flickering on and off at random intervals. I was thinking that adding this feature would make a really awesome mod, but doubt there is a particle effect currently in game which would accomplish it. I thought about using the torch flame effect, but wanted the color of the flame particle effect to be closer to what the current florescent store lights are. Any ideas on a workaround for either thought? Thanks

 

 

What you're after is not possible with XML alone.

Link to comment
Share on other sites

  • 8 months later...

with a little modification it works fine still. Here's my code for a Fluorescent Light

<block id="1721" name="FluorescentLight_NoPower">
<property name="Class" value="Deadgrass" />
<property name="CreativeMode" value="Dev"/>
<property name="CustomIcon" value="ceilingLight07" />
<property name="DescriptionKey" value="FluorescentLight_NoPowerDesc"/>
<property name="HandleFace" value="Top"/>
<property name="CanPickup" value="true" />
<property name="Material" value="Mmetal_thin" />
<property name="Shape" value="ModelEntity" />
<property name="Collide" value="melee,bullet,arrow,rocket"/>
<property name="StabilitySupport" value="false"/>
<property name="Model" value="Entities/Lighting/player_ceilingLight07Prefab" />
<property class="RepairItems">
	<property name="forgedIron" value="1"/>
	<property name="electricParts" value="3"/>
	<property name="electronicParts" value="2"/>
</property>
<drop event="Harvest" name="electricParts" count="1,4" tool_category="Disassemble"/>
<drop event="Harvest" name="electronicParts" count="1,2" tool_category="Disassemble"/>
<drop event="Harvest" name="scrapPlastics" count="1,2" tool_category="Disassemble"/>
<drop event="Destroy" name="scrapIron" count="5" prob="1"/>
<drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>
<property name="EconomicValue" value="76"/>
</block>

 

You have course don't have to have the repair items or harvest events but I have it there so it's more like a normal light.

Just remember if it's not on when you first place it pick it up and try again.

Link to comment
Share on other sites

with a little modification it works fine still. Here's my code for a Fluorescent Light

<block id="1721" name="FluorescentLight_NoPower">
<property name="Class" value="Deadgrass" />
<property name="CreativeMode" value="Dev"/>
<property name="CustomIcon" value="ceilingLight07" />
<property name="DescriptionKey" value="FluorescentLight_NoPowerDesc"/>
<property name="HandleFace" value="Top"/>
<property name="CanPickup" value="true" />
<property name="Material" value="Mmetal_thin" />
<property name="Shape" value="ModelEntity" />
<property name="Collide" value="melee,bullet,arrow,rocket"/>
<property name="StabilitySupport" value="false"/>
<property name="Model" value="Entities/Lighting/player_ceilingLight07Prefab" />
<property class="RepairItems">
	<property name="forgedIron" value="1"/>
	<property name="electricParts" value="3"/>
	<property name="electronicParts" value="2"/>
</property>
<drop event="Harvest" name="electricParts" count="1,4" tool_category="Disassemble"/>
<drop event="Harvest" name="electronicParts" count="1,2" tool_category="Disassemble"/>
<drop event="Harvest" name="scrapPlastics" count="1,2" tool_category="Disassemble"/>
<drop event="Destroy" name="scrapIron" count="5" prob="1"/>
<drop event="Fall" name="scrapMetalPile" count="1" prob="0.75" stick_chance="1"/>
<property name="EconomicValue" value="76"/>
</block>

 

You have course don't have to have the repair items or harvest events but I have it there so it's more like a normal light.

Just remember if it's not on when you first place it pick it up and try again.

 

 

Ty for that, so I could use this as a template to update the other lights in the mod?

Link to comment
Share on other sites

You would need to make a recipe for it and add it to the localization if you wanna craft it in game. The way I have it set up is it's a dev block pulled from the creative menu so doesn't really need it.

 

 

 

Ok, that makes sense. Your help is much appreciated.

Link to comment
Share on other sites

  • 5 months later...
  • 4 months later...
  • 11 months later...

Archived

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

×
×
  • Create New...