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

Topics - yadaptor

#1
Okay, so I'm working on this addon for a mod, and this addon uses Alien Races to render the extra bodyparts on the pawns. But I had an idea that could make it far more interesting, by making those bodyparts change based on what the pawn is doing, like sleeping, or certain jobs. Alien races already changes graphics based on heddifs or backstory, so I guess it's possible...?
But I really don't know what I'm doing, my C# knowledge is very low, and I'd be glad if someone could help me with this.

link to alien races's body render on github: https://github.com/RimWorld-CCL-Reborn/AlienRaces/blob/master/Source/AlienRace/AlienRace/AlienPartGenerator.BodyAddon.cs
#2
Ok, I wanted to get into C# for some time, and decided to add one of those fermenting things to my mod. It turns pollen (Raw plant, considered desperate only food) into honey (can be a joy source, gives positive mood), but I can't figure out what am I doing wrong here. I'm using the core and fertile fields mod as reference, I added the barrel building class, Jobdriver and WorkGiver classes for both jobs (fill the barrel, and take honey out), but whatever a pawn is idle, and decide to get this job, it gives exceptions.
At first where Exceptions on Verse.AI.ThinkNodePrioritySorter TryIssueJobPackage "cannot cast from source type to destination type".
Now I changed the way the code calls for defs, to instead of using DefDatabases, to use the shorter ThingDefOf/JobDefOf, but it gives another error "exception on verse.ai tryjobpackage "value does not fall within the expected range"" and something related to drug policies?

I really need some guidance here.

Edit 1:I cannot believe I forgot to include the logs in the archive -3-
But basically,it shows this:
Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.InvalidCastException: Cannot cast from source type to destination type.
  at Arthropods.WorkGiver_FillHoneyBarrel.JobOnThing (Verse.Pawn pawn, Verse.Thing t, Boolean forced) [0x00000] in <filename unknown>:0
  at RimWorld.JobGiver_Work.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0
  at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0

When pawns are idle and the only job is to fill the barrel, and this:
Root level exception in OnGUI(): System.InvalidCastException: Cannot cast from source type to destination type.
  at Arthropods.WorkGiver_FillHoneyBarrel.JobOnThing (Verse.Pawn pawn, Verse.Thing t, Boolean forced) [0x00000] in <filename unknown>:0
  at RimWorld.FloatMenuMakerMap.AddJobGiverWorkOrders (IntVec3 clickCell, Verse.Pawn pawn, System.Collections.Generic.List`1 opts, Boolean drafted) [0x00000] in <filename unknown>:0
  at RimWorld.FloatMenuMakerMap.AddUndraftedOrders (Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List`1 opts) [0x00000] in <filename unknown>:0
  at RimWorld.FloatMenuMakerMap.ChoicesAtFor (Vector3 clickPos, Verse.Pawn pawn) [0x00000] in <filename unknown>:0
  at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x00000] in <filename unknown>:0
  at RimWorld.Selector.HandleMapClicks () [0x00000] in <filename unknown>:0
  at RimWorld.Selector.SelectorOnGUI () [0x00000] in <filename unknown>:0
  at RimWorld.MapInterface.HandleLowPriorityInput () [0x00000] in <filename unknown>:0
  at RimWorld.UIRoot_Play.UIRootOnGUI () [0x00000] in <filename unknown>:0
  at Verse.Root.OnGUI () [0x00000] in <filename unknown>:0

when I right click a barrel to force a pawn to do the job.

[attachment deleted due to age]
#3
Hey, I require some assistance (this might not be the right place tho, pretty new to the forum :v)
I've been trying to patch a thingdef from the Core, to instead of being a normal thingdef, it instead be the Custom def from a mod (more specifically, Core humans, to alienrace.thingdef_alienrace, I want to make the humans an alien race so I can use the mod's functionality), but after a lot of attempts, I wasn't able to figure out how to do this.
Someone I know told me to instead of xml, make C# assembly to redirect humans to the custom alienrace.thingdef, but my C# knowledge is almost null, so I'm trying to get this working some other way.
Is it possible with patching operations? If so, how could I minimize compatibility problems? If C# is really the best option...could you help me with some code? im noob  :-[