Can XML mods do anything besides add/modify items?

Started by DirectOrder, March 14, 2020, 11:17:19 AM

Previous topic - Next topic

DirectOrder

Can XML mods do anything besides adding/modifying items?  For instance, I can add a new item called "Book of Knowledge" just fine through XML, but THEN, as soon as the book is located within any stockpile, I want to trigger a win condition that pops up a window saying "Yay, you found the book of knowledge, your colony is now all powerful.  You win the game!"

Is this type of thing (win conditions, conditional testing, dialog boxes, etc) possible with XML coding, or is that 100% C#/DLL territory?

LWM

Somewhere, you need to have game logic (C#, altho I suppose other options are possible?) to make ANYTHING happen.

In this specific case, there is no built-in game-logic that you can hook into.  In the case of a new surgery to add bionic tentacles replacing arms, there are already hooks you can use.  If you want those tentacles to...never mind, this is turning into a bad example.  If you want to graft fishing rods to people instead of hands, you can do that, because replacing body parts is in-game logic.  If you want the fishing rods to make fish appear when your pawn is near water, that would require adding extra logic to the game, so C#.

You could probably do your specific case in a straightforward C#+XML mod (wouldn't need Harmony, for example), but somewhere, you'd need to add that logic to the game.

DirectOrder

That's what I figured.  Thank you for confirming, and for the detailed reply. I appreciate it!