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

Topics - jamaicancastle

#1
Related to this bug about character names, Thing labels that include brackets [] break the grammar resolver when, e.g., they find their way into the battle log.

Specifically this was discovered with a modded bullet with brackets in its label. Looking at the resolver log, other possible sources of brackets include: weapon, PawnKindDef, and BodyPartDef labels, backstory titles (either abbreviated or full), or faction names. There may be others.

With the brackets removed, the log works fine. In the linked thread, disallowing brackets in pawn names was mentioned by Tynan as a solution; that would be fine here, but if that is the case, a ConfigError should be raised, similar to when a def has a defName that isn't allowed.

The other approach would be to sanitize input when loading custom rules from fields such as labels, perhaps by omitting the brackets or replacing them with parentheses or another allowed character. A label of "[test] my item" might be changed to "test my item" or "(test) my item" before handing it off to the grammar resolver.

A grammar resolution trace is attached. Note line 4, where the label "[LC] Solemn Vow Bullet LC" creates a spurious, unresolveable "LC" element.
#2
Outdated / [B18] Shoo!
February 20, 2018, 08:23:15 PM

First-time modder here for Shoo!, an idea from the community Discord.

This mod adds a new designator that tells your colonists to harmlessly direct animals out of your base if they become trapped inside or are just inconvenient. (Cooperation not guaranteed, especially for large or very wild animals.) Animals that you shoo will pass through doors, allowing you to push them out of buildings with a minimum of micromanagement.

Compatibility: Shoo! should be safe to add to games currently in progress. It should be safe to remove as long as no pawns are in the process of shooing animals, no animals are marked for shooing, and no animals are currently fleeing from having been shooed.

This mod includes the Harmony patching library. No additional download is needed.

Thanks to the RW modding Discord for their help. Special thanks to Mehni for an excellent guide to the inner workings of jobs, and for heroic efforts in fixing the Inexplicable Herd Animals Bug.

Workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=1307441653
Dropbox [B19]: https://www.dropbox.com/s/zqb708lysi4hyzm/Shoo%21.zip?dl=0
Dropbox [B18]: https://www.dropbox.com/s/ip67qrj1rb3vek3/Shoo%21%20B18.zip?dl=0

Edit 9/10: updated for B19 release.
#3
Help / Question about tags and inheritance
January 07, 2018, 12:36:58 AM
I've been tinkering with item generation and items tags lately, and it's occurred to me to wonder: if I have a parent def with a list of tags, and a child def with a list of tags, does the child's list append to the parent's or overwrite it?

That is, say I have two defs in relevant part:
<thingDef name="Parent">
<apparel>
<tags>
<li>This</li>
<li>That</li>
</tags>
</apparel>
</thingDef>

<thingDef name="Child" parentName="Parent">
<apparel>
<tags>
<li>The other thing</li>
</tags>
</apparel>
</thingDef>

will Child have This and That, or only The other thing? If it does have all three tags, is there an easy way to remove one of them, aside from adjusting the inheritance structure?

Also, tangentially related - is there a way to expose the tags apparel items have in-game at all? I tried poking around in the dev menu but couldn't find anything.
#4
Mods / [Mod Request] Tree Respawning
November 21, 2017, 04:51:45 AM
I'm having trouble with the tropical swamp biome and was hoping a kind modder could help me out. Basically, my problem has to do with how plants (especially trees) respawn when there are very few open spaces (fertile tiles without plants already on them) in the map. I like how it affects cover and combat, I don't mind the movement speed penalties, and I think it has a good balance when encroaching on fields, but when trying to build anything it's just cripplingly terrible. No matter how quickly the pawns clear trees, they'll pop back up again two, three, four times while constructing even simple buildings like floor tiles. Any time your pawn leaves to tend to their needs - new tree. Any time they bring up more building supplies - new tree. And they all have to be cut down again from scratch. This is the single most pointlessly frustrating thing Rimworld has yet done to me and I think we can all agree that's a high bar.

So. What I don't want is to reduce the difficulty of clearly land in the first place. What I do want is to make it possible to actually keep it clear long enough to get some building done, provided that building is done promptly. I have three basic approaches, from most to least complex (as I understand modding, which is not that great or I'd do it myself).

1) Add a cooldown time on regrowing on the same tile. When a plant is cut down/dies/burns up on a tile, make it unable to receive a new (wild) plant for the next 3/6/12/however many hours. Even if it's short, this will at least give a small grace period that should help prevent getting stuck in an endless loop of chopping trees in the same tile. I'd rate this one more difficult because of the requirement that it keep track of recently cleared tiles, though.

2) Allow plants to require a more work to clear when they're more grown, so that freshly sprouted saplings don't require as much chopping down as a whole oak tree. This not only feels intuitive, it would preserve the feeling of the jungle constantly encroaching without making clearing the land absolutely pointless (since your constructors would only have to do the lesser clear work of the replants and not the full clear work). The difference in work required could be smoothly scaled by the growth %, or it could just have a "young"/"mature" breakpoint (I would suggest 40%, the point where trees can be chopped for wood) with fixed values.

Or 3) prevent new plants from sprouting on tiles in darkness, or tiles under a roof. In theory this should be the simplest change, and it makes some sense that since plants can't grow there, they shouldn't be able to sprout there either.

If anyone wants to take a stab at any of these ideas, or knows of a mod that does something like this already, I'd be much obliged.
#5
Ideas / Mining/Prospecting
November 06, 2017, 06:30:01 AM
So there I was tonight, playing the game, designating a bunch of mineable rock for... mining, when it occurred to me how kind of dull it was. So I wondered, what would make it more interesting?

For me I think the big problem with mining and searching for mineral veins is a) how most of the time you don't find anything, and b) how there's no real feedback or skill, you're just cutting channels into the rock and there's nothing else you can meaningfully do.

My suggestion is, what if mineral veins left "traces" that you could find in the surrounding rock? For instance, say there's a 5x5 vein of ancient steel buried in the middle of a bunch of granite. In an area around it - say another 5 tiles all around, maybe tied to the size of the vein - there will sporadically be "granite with steel traces" or something to that effect instead of regular granite, weighted more towards the tiles closest to the vein. These tiles have the same yield as regular granite but provide a hint that you're getting close to something valuable.

I think this would a) reduce the amount of innocent mountain you need to cut down to find useful materials, and b) give an element of skill and the chase to prospecting, finding traces and running them down until you find the deposit. (It could even sprinkle around false traces on map gen, representing veins that never get big enough to be useful.)

One issue I see with this is the number of objects needed with different types of metal and stone, but if the traces were a separate object on top of the stone that should keep the number down. I'm not sure how easy it would be to make it so that mining the stone removes both objects, but the traces could be removable another way. (Perhaps they would work as a type of filth?)
#6
Help / Animal behavior mod
September 22, 2017, 02:05:48 AM
I've been trying out some more open village-style base plans of late, and one thing I quickly noticed was random animals like emus and megasloths coming up to my people like they were at a petting zoo, which irks me in that low-grade way that leads to mod ideas. So I was thinking... what if animals were naturally averse to people?

My plan is basically as follows. The map is already divided into decent-sized regions, so I would give each one an "activity index". People walking around, construction, gunshots, etc. would increase the index in a given region, and it degrades over time. Then whenever a wild animal looks around for something to eat, a place to wander to, etc. it weights regions in favor of those with less activity. All tamed animals and manhunters would ignore activity entirely; it would apply only to wild animals in their normal behavior. (If everything else works out, I'm thinking of having it apply less to smaller animals, so squirrels still sneak in and bug your people. As they do.)

So my question is, does this seem like a reasonable approach? Are there any serious pitfalls? Will it totally break the game if I try to use regions like this? Is there, in fact, already a mod that does this?