[1.3] Crash Landing (v14.01) (04-08-2021)

Started by Katavrik, January 04, 2015, 12:53:47 AM

Previous topic - Next topic

TeflonJim

#315
Quote from: Elixiar on July 04, 2016, 01:24:04 PM
Anyone got any possible solutions? Not sure what is causing this :/
Having the right version of Crash Landing is important, so ensure you have the Prepare Carefully variant from the main page.

Ensuring you have the right load order is important. Prepare Carefully must be higher in the load list than Crash Landing.

Finally, having any other mods which affect the MapGenerator will break this. For example, I had the Misc. MapGenerator mod loaded and that caused exactly the problem you describe. Removing it brought Crash Landing to life.

Chris


ekfkr92


darkrage000

Quote from: ekfkr92 on July 19, 2016, 07:29:52 AM
Is it working in A14?
Since the title of the topic starts with [A13] im going to take a guess and say no.

TeflonJim

I've updated the source code and defs a bit. Not that it works yet so absolutely no one should get excited by that.

Katavrik, I'm more than happy share the modified source code, library and defs here with your consent. These changes are (roughly):


  • A new ScenPart class below (speculatively). Is there any reason this can or should not use a ScenPart to trigger the event?
  • A few changes to enum values (Faction and FactionDefOf have to be updated).
  • Thoughts.TryGainThought changed to Thoughts.CanGetThought (unsure if this is the right method, but TryGainThought is not there).
  • MapDataInit.colonists for Verse.Current.Game.InitData.startingPawns (MapDataInit is no longer available). This may be an appropriate value to use given that this is used to pad out the colonist count on a Cryo sleep block crash.
  • Changed the constructor for PawnGenerationRequest to use the new (I guess) named parameters.
  • Changed the static method call DoExplosion to use the new named parameters (Note: This may be the cause of Bug 2).

The ScenPart class


using RimWorld;

namespace CrashLanding
{
public class ScenPart_Crashlanding : ScenPart
{
public override void PostGameStart()
{
IncidentParms_CrashLand parms = new IncidentParms_CrashLand ();
parms.faction = Faction.OfPlayer;
parms.modeIsHard = false;
IncidentWorker_CrashLand wokr = IncidentDef.Named ("Main_BigShipCrashIncident").Worker as IncidentWorker_CrashLand;
wokr.TryExecute (parms);
}
}
}


Bug 1 (Critical)

Found no usable data when trying to get defs from file RandomCrashTemplates.xml

The error is repeated for StartingCrashTemplate.xml and CrashLanding_Options.xml. It seems like the way to load new defs might perhaps have changed.

Exhibits as this error:

Exception from asynchronous event: System.NullReferenceException: Object reference not set to an instance of an object

The stack trace varies slightly depending on the method I override in ScenPart, but everything points back to bad def file parsing.

Bug 2 (Unknown severity)

Could not resolve cross-reference: No Verse.ThingDef named Puddle_Fuel found to give to Verse.ProjectileProperties Verse.ProjectileProperties

May relate to the change in calls to DoExplosion (bad interpretation on my part perhaps). May relate to the change in def type of Puddle_Fuel (now Filth).

It's hot, I'm going to play RimWorld for a bit :)

Chris

TeflonJim

Going to attempt to pull the settings into CCL's mod configuration menu if I can. That should work around the problem of using Defs as a vehicle for passing in configuration.

When there's time...

notfood

Thank you for your efforts. This is one of my favorite mods.

Katavrik

Quote from: Fregrant on July 19, 2016, 03:45:32 AM
Update please?
Yes, it will be updated. I plan to work on the update during next weekend. But i am not sure, if i can finish it before the next week.

Quote from: TeflonJim on July 19, 2016, 10:37:37 AM
I've updated the source code and defs a bit. Not that it works yet so absolutely no one should get excited by that.
I appreciate you effort, and gladly accept any help. However, i understand that updating existing mod should be done by myself, because i know the code and have a relevant expirience. Even though, i spent a lot of time to remember how it works, during every update.

If you really want to help, we can discuss this by private messages. Otherwise i will do update by myself, you just need to wait.

Quote from: TeflonJim on July 19, 2016, 10:37:37 AM

  • A new ScenPart class below (speculatively). Is there any reason this can or should not use a ScenPart to trigger the event?
  • A few changes to enum values (Faction and FactionDefOf have to be updated).
  • Thoughts.TryGainThought changed to Thoughts.CanGetThought (unsure if this is the right method, but TryGainThought is not there).
  • MapDataInit.colonists for Verse.Current.Game.InitData.startingPawns (MapDataInit is no longer available). This may be an appropriate value to use given that this is used to pad out the colonist count on a Cryo sleep block crash.
  • Changed the constructor for PawnGenerationRequest to use the new (I guess) named parameters.
  • Changed the static method call DoExplosion to use the new named parameters (Note: This may be the cause of Bug 2).
We cleary should use ScenPart. It is a long awaited addition, that i hope solve most of compatible problems with EdB mods and others.
My code related to DoExplosion has a lot of duct tapes, i need to fix it by myself.

TeflonJim

Not a problem, I just really like your module :)

Chris

Katavrik

Updated to A14d:
- Scenarios added. You should start the new game with one of the CrashLanding scenarios. Modes are gone.
- If you you make new scenario by editing CrashLanding scenarios, it will have crashlanding event at the start. That mean, you can add various scenario parts through in-game editor, without breaking CrashLanding.
- The mod should be compatible with other mods changing MapGeneratorDefs, for example Miscellaneous mod.

notfood



luminisone

 :D Thank you for the update! I really love playing with this mod :)


BlackSmokeDMax