Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Fallcoast

#1
Quote from: BasedGreg on June 15, 2019, 02:04:24 PM

Yeah, took me a little longer than I'd like to admit to figure out I was using a .NET standard instead of a .NET Framework hahah

Also, after using iLSpy and poking around in the dlls I managed to figure that out. I now no longer get errors! Except now the building still won't work. It's in the game and I've made a custom workgiver class (based on the fermenting barrel), but my test pawn can't load in the cartridges or really interact with the object at all. It just sits there like a glorified end table, except less useful.


No worries dude, not the first time that's tripped somebody up. 

The job not working could be a few things.  There needs to be a JobDriver class and WorkGiverDefs+JobDefs in XML too.  If the defs aren't there I don't think the game is aware that it can assign that job to pawns.  Do you get a menu when right clicking the building with a pawn selected?

I also remember a gotcha with those Def's driverClass and giverClass attributes.  Rimworld core defs use just the C# class name, but I had to use {namespace}.{class} to get modded jobs to work.

Hopefully this helps you out.
#2
To add to what LWM already posted. 

It sounds to me like your project might have been created as a '.NET Standard' project instead of a '.NET Framework' project.  If your project's target framework is '.NET Standard 2.0', that's what happened.  The naming is confusing and its an easy mistake to make.  I think the simplest fix is to create a new .NET Framework project and copy your code there.

Graphene isn't available in ThingDefOf because Graphene isn't in the base game.  You can add your own ThingDefOf class for your mod like:

[DefOf]
public class AdvancedPrinter_ThingDefOf
{
    public static ThingDef Graphene;  //This needs to match the def Name in XML
    //Any other mod ThingDefs can be added to this class
    //...
}

Then in your code use that class instead of ThingDefOf to reference Graphene.

Thing thing = ThingMaker.MakeThing(AdvancedPrinter_ThingDefOf.Graphene);

There's some more about this on the wiki https://rimworldwiki.com/wiki/Modding_Tutorials/Linking_XML_and_C#Using_your_XML_from_C.23