Crash landing for starting colonists

Started by Katavrik, January 04, 2015, 02:10:39 AM

Previous topic - Next topic

Katavrik

I've created a mod about crash landings: https://ludeon.com/forums/index.php?topic=8967.0

There are new crashPods that fall with explosion and damage. But i cant modify starting colonists drop pods, or place them in my new CrashPods.

How can i place starting colonists in a custom DropPod?

Loki88

There might be some useful information in the event for a random pawn joining the colony.

All I can think of is spawning in a random pawn with it's faction locked to the colony.

Katavrik

I've already know how to spawn new colonist for the colony. But i dont have access to the event, that launces first colonists. I guess, i need modify it. But i dont know where to search.

Pathing

Prepare carefully mods can access some options that affect 3 starting colony.
You may want to check.
Steel is food. Steel is defense. Steel is weapon.
Steel is RimWorld.

EdB

#4
Quote from: Katavrik on January 04, 2015, 02:30:14 AM
I've already know how to spawn new colonist for the colony. But i dont have access to the event, that launces first colonists. I guess, i need modify it. But i dont know where to search.

It looks like we've both been working on a similar idea.  I just released a mod that starts your colonists out in the ruins of their crashed ship.

To do this, I needed to swap in a custom version of the MapIniter_NewGame class.  This isn't easy to do, but it's definitely possible.  You can decompile either the Prepare Carefully mod or the new Scenarios mod to see how to do it.  The Mod Order mod includes full source code that describes some of techniques that you'll see in the other mods--that may make it easier to figure out what's going without comments in the decompiled code.

You need to do swap in a new MapIniter_NewGame class because in Alpha 8, there's no other way to access the map generation process.  It sounds like this will change with Alpha 9, and map generation will become moddable again.  It should be much easier after that release.

EDIT: While I think it's true that this may be the only way to hook into map generation, there are probably other ways to modify the map right after it's generated that would not require you to swap out that class.

Katavrik

#5
Thank you. I will try this.

Another question: What tool did you recommend for decompilation?

Katavrik

EdB, Thank you again. The problem is solved with you Scenario mod. Now i am your modder ).

I've look at the Wreckage scenario, where you already swap starting drop pods with ordinary spawn, and use it like template.
I did not understand how the colonists initializes, so i used initData from your dll. And its worked, but only with your EdbScenarios.dll as a reference dll.

EdB

Quote from: Katavrik on January 04, 2015, 09:56:57 PM
Another question: What tool did you recommend for decompilation?

I develop C# in MonoDevelop/Xamarin, and it has automatic decompilation of project dependencies.  It's very convenient.

For a standalone tool, JetBrains dotPeek works well.

Both tools get hung up a bit when decompiling certains types of code (closures, maybe), and from my experience, MonoDevelop/Xamarin handles some of these scenarios slightly better.