Simplest base for creating a new pawn.

Started by Makani, August 06, 2018, 12:30:23 PM

Previous topic - Next topic

Makani

I know there's a bunch of robot mods but... they're all doing so many things it's hard to learn from them.

So I wanted to know how I can do something really simple: I want to have a workbench with a recipe that can create a pawn. Workbenches and recipes I know enough XML to put together. But the pawn spawning... From what I can tell that definitely takes C#. But I'm not really sure how to do that minimalistically, nor how to bridge that to a recipe.

Could anyone provide any resources/explanations/examples specific to this? (Even just making an already in game pawn, I know setting up a race is a bunch of work in itself).

Thank you.


RawCode

all pawns are instances of pawn class, there are no simple or hard pawns, they all same class

mipen

The simplest way to do this would be to create an item which spawns a pawn when it is spawned, and make this item the result of the crafting bill. This way, the bill will be completed, the item will be made and when it is dropped by the crafter, it will spawn the desired pawn. Then you can despawn the item.

To do this, you will need to create a custom class for the item which overrides the SpawnSetup method.
Use the PawnGenerator static class to instantiate the pawn and GenSpawn.Spawn method to spawn it.