PC Zombietronics: Digital Circuits Using Zombies

The modding forum here has some tutorials, and the wiki page on XPath syntax is excellent - very clear, comprehensive, and well-written. Truly a masterpiece*. You only need XPath if you want to make modlets which will load up and modify XML at run-time (leaving the original vanilla files intact). You can hand-edit the XML directly in the /config folder also of course, but maybe keep a copy of the original!

A great way to learn how to mod Thing X is to find a mod which already does something to Thing X and then open up the modlet xml file to see how they did it. That's how I got familiar with it. That and asking n00b questions in the modding forum. There is also Guppycur's unofficial modding Discord, which has an XML/XPath channel. Link is in the modding forum.

*I wrote it.
Thanks, I'll start looking through these and hopefully learn some things. One thing I've already learned through dnSpy is that the motion sensor has a "shouldIgnoreTarget" private method with this bit of code:

if (_target is EntityVehicle)
{
Entity attachedMainEntity = (_target as EntityVehicle).AttachedMainEntity;
if (attachedMainEntity == null)
{
return true;
}
_target = attachedMainEntity;




Which means there is absolutely no way via XML editing to get any entity that inherits from the Vehicle class to trip a motion sensor unless there is a player entity attached (i.e. in the vehicle driving it). So now I'm looking into either overriding this class using harmony so motion sensors can detect unattached vehicles as strangers (possibly limiting it just to vehicle that inherit the bicycle class) or trying to use XML to create a new animal that is basically a chicken with IsEnemyEntity set, that has no real AI attached to it, and has a crafting recipe.

 
Back
Top