Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Stormknight

#1
I wouldn't be posting here, adding a zip-file of the mod, if I wasn't interested in making the add-on available outside of steam. ;)

As I said, I'll look up additional file-hosting. Any good suggestions?
#2
Cool. It's on the Steam workshop and if there's interest in downloading from here, I'll look into an alternative file hoster.

Thanks for the heads up. :)
#3
Hey all,

I've recently got back into Rimworld with the 1.0 release and decided I would like some lights that automatically turned themselves off during the day, to save power when my colonists are busy cooking, smithing and all the other things they do.

So, this add-on was born. I've since added solar-powered lamps too (self-contained, just place them and they light up at night). Oh, and there's some low-tech lanterns too, including a holiday-themed pumpkin lantern that I got an idea for after watching my wife playing Sims 4.

Garden Lanterns
There are three garden lanterns available that can be built without any research needed. Functionally, they are the same as a torch, but hold twice as much "fuel" lasting for 40 days without needing to be re-fuelled.

  • Standard garden lantern - gives off a slightly yellow light.
  • Garden lantern (blue) - the same as the standard lantern, but with slightly different graphics and a blue tint to the light.
  • Pumpkin lantern - there are no pumpkins on the rim, so this is carved from wood and reinforced with a bit of steel.

Outdoor Lamps
A variant of the vanilla Standing Lamp, with additional properties:

  • Alternative graphics for the lamps.
  • The outdoor lamps automatically turn off at 07:00 to save power during the day. They automatically turn back on at 17:00.
  • Once Colored Lighting has been researched, they can be built in a variety of colours, including: red, blue, green, purple, and orange.

Outdoor Solar Lamp
Identical to the Outdoor Lamp from this add-on, except:

  • No need to run power to these lamps - they power themselves by absorbing energy during the day! They can also be easily moved when needed.
  • Visually different - the small solar panel can be seen by the lamp, making it easy to see which lamps are which.

Lamp Posts / Street Lamps
Taller and more powerful than the standard lamp:

  • Larger pool of light, in a variety of colours (requires Colored Lighting has been researched).
    • Provides limited cover in a gun fight.
    [li] Visually different to standards lamps - when placing, circle shows approximate area that will be lit.



Link to Steam workshop:
https://steamcommunity.com/sharedfiles/filedetails/?id=1545708330

Download:
(attached to this post)

Licensing - free for use. Please don't copy or redistribute without first seeking permission.

[attachment deleted due to age]
#4
Thank you Mehni,

Whilst I've used XML a fair amount before, I've not really touched xpaths and this really caught me out.

For reference, for anyone else looking to do this, the following works just fine:

<Patch>
<Operation Class="PatchOperationReplace">
<xpath>*/ResearchProjectDef[defName = "Electricity"]/label</xpath>
<value>
<label>Power</label>
</value>
</Operation>
</Patch>
#5
I'm trying to make several changes to the tech tree for a mod I'm working on and would like to use xpath patching so that I have as much compatibility as possible with other mods.

I feel like I must have missed something though, as it's behaving weirdly.

Consider the following patch code, that successfully adds Smithing as a prerequisite of Electricity:
<Operation Class="PatchOperationAdd">
<xpath>*/ResearchProjectDef[defName = "Electricity"]</xpath>
<value>
    <prerequisites>
      <li>Smithing</li>
    </prerequisites>
</value>
</Operation>


Now compare that to the following patch code I am trying to change the displayed name for Electricity in the tech tree:
<Operation Class="PatchOperationReplace">
<xpath>*/ResearchProjectDef[defName = "Electricity"]</xpath>
<value>
<label>Power</label>
</value>
</Operation>


The first chunk of code is successful, however when the second piece of code is added, it causes the whole Electricity entry to vanish from the research. In fact, it seems to cause the whole Electricity node to vanish, as having the REPLACE patch happening prior to the ADD patch causes the game to throw an error for the ADD action.

Does anyone out there know if it's possible to use patching and xpaths to change the values of ResearchDefs?