Question: Is there a way to create damage by passing through an object?

Started by QuantumX, June 02, 2017, 06:14:27 AM

Previous topic - Next topic

QuantumX

So wondered if there is a way to create damage by passing through an object? say something like barb / razer wire using standard xml editing?

Fluffy (l2032)

not with only xml, no. If you were willing to learn C#, this would be a very nice first mod project.

QuantumX

ok thought so..

I might look into this in C# to use to learn, anywhere you would suggest to start?

Fluffy (l2032)

Jecrell just put up a nice tutorial that should cover the basics.

What you'll need to do is create a new ThingComp that checks if there are pawns on the same cell every 30 ticks or so, and then does some kind of damage. Attach the ThingComp to your building/trap/whatever, et voila. Latta's Doormats (which are now maintained by someone else) do something quite similar (remove dirt from pawns when they walk over) so could be a good place to start figuring out how to do it.

If you run into some specific issues, there's always the help forum.