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 - Spaceman

#1
Help / Plants producing two products (solved)
September 03, 2018, 04:37:31 AM
This is sort of a continuation of this thread about how to do this. However, it changed with the B19 update and I have hit a roadblock with making it work again.

I now receive this error when harvesting:
Exception in JobDriver tick for pawn Joe driver=JobDriver_PlantHarvest_Designated (toilIndex=5) driver.job=(HarvestDesignated (Job_290) A=Thing_WildAppletree37787) lastJobGiver=RimWorld.JobGiver_Work
System.MissingMethodException: Method not found: 'Verse.GenPlace.TryPlaceThing'.
  at RimWorld.JobDriver_PlantWork+<MakeNewToils>c__Iterator0+<MakeNewToils>c__AnonStorey1.<>m__1 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.DriverTick () [0x00000] in <filename unknown>:0


This is what used to work prior to B19:
public class Apple : Plant
{
public override void PlantCollected()
{
float arg_40_0 = this.def.plant.harvestYield;
float num = Mathf.InverseLerp(this.def.plant.harvestMinGrowth, 1f, this.growthInt);
num = 0.5f + num * 0.5f;
int num2 = GenMath.RoundRandom(arg_40_0 * num * Mathf.Lerp(0.5f, 1f, (float)this.HitPoints / (float)base.MaxHitPoints) * Find.Storyteller.difficulty.cropYieldFactor);
Thing expr_86 = ThingMaker.MakeThing(ThingDef.Named("WoodLog_Apple"), null);
expr_86.stackCount = (int)((float)num2 * 0.5f);
GenPlace.TryPlaceThing(expr_86, base.Position, base.Map, ThingPlaceMode.Near, null);
base.PlantCollected();
}
}


I noticed this change regarding GenPlace.TryPlaceThing within Rimworld's JobDriver_PlantWork using dnSpy:
GenPlace.TryPlaceThing(thing, actor.Position, this.Map, ThingPlaceMode.Near, null)
to
GenPlace.TryPlaceThing(thing, actor.Position, this.Map, ThingPlaceMode.Near, null, null)

I noticed the changes within Verse's GenPlace for TryPlaceThing as well. I thought maybe adding the second null would fix the problem, but Visual Studio gives the error of cannot convert from '<null>' to 'out Thing'. This where I am stuck and am not sure how to proceed in editing what I have for this to work again in B19. I tried a few ideas of my own, but they proved fruitless and resulted in the same error when harvesting as shown above in the beginning.

Any ideas on how to make this work again?
#2



     

The spirit of Qwynn's Expanded Woodworking risen and updated from the depths of the forums to the land of the active!

The days of the 'WoodLog' are gone. Awaken that inner lumberjack as you become surprised that each tree (and cactus too) produces a different type of wood and color!

Let that designer and carpenter in you sprout as you decide which wood type to use!

     

     

Expanded Woodworking is an updated fork of ItchyFlea's Extended Woodworking.

This is more of an upgrade given about 60% of it contains restructuring, editing, added and removed content, better compatibility, and balancing since Qwynn's release for A16.

Kind of ironically and as result of having been inspired by the original, this is also the first time I have worked with XML and C#.

I'd be happy to return this should Qwynn return and request it back.

     







FEATURES

  • Trees, Saguaro, and bamboo have their own unique wood.
  • Every wood type (except Saguaro) has a corresponding lumber!
  • Process logs into lumber at the woodworking tables!
  • Lumber is used in both construction and in crafting.
  • Supports any starting scenario through using the crafting spot.
  • Raw logs are used as fuel!
  • Realistic wood colours!
  • Support for other mods!
  • ModSync RW and Fluffy's Mod Manager support!
  • Compatibility with any mod using wood as a fuel item.

COMPATIBILITY
Mods given extended functionality with included patches:

Expanded Woodworking (EW) overwrites the following vanilla definition:

  • Wood Log
Patches edit the following vanilla definitions:

  • Trees
  • Brewery and barrels
  • Butcher table
  • Torch lamp
  • Campfire
  • Any other wood-fueled items (incl. from other mods)
  • Passive cooler
  • Spike trap
  • Joy and art objects
  • War mask
  • Peg leg and wooden foot
  • Weapons made of wood
  • Marble blocks

Separate Vegetable Garden Project (VGP) patch overwrites:

  • Bamboo and ironwood
And patches edit the following from VGP:

  • Fruit trees from Vegetable Garden and More Veggies
  • Trees from Xtra Trees and Flowers
  • Compost starter
  • Drinks table
  • Ironwood floors
  • Loom

                                                               
DOWNLOADS


  Expanded Woodworking           Expanded Woodworking for VGP*




         
                                                     



       
                             
       


                 


   
                   
   


                                                            
* requires Expanded Woodworking and Vegetable Garden

I recommend Fluffy's Stuffed Floors in addition for the awesome and fancy flooring you'll be able to make with Expanded Woodworking!

CREDITS

  • ItchyFlea - The original mod.
  • Qwynn - The original Expanded Woodworking and core code of the mod.
  • Fluffy - Several random, helpful forum posts.
  • dismar - Forum posts and Vegetable Garden.
  • A talking dolphin - The lumber graphic.
  • Thirite - Fruit tree coding and troubleshooting.
  • lex1975 & DiamondGrace - Russian language localisation.
  • Azarashi - Castellano Spanish language localisation.
  • XeoNovaDan - Realistic Planets patch.
  • KennethSamael - ReGrowth: Biomes of The Rim patches.
  • Chowder - Woodworking table graphics.
  • Dr_Zhivago - Dead Goat's and RT's Weapon Packs patches, miscellaneous patches, and woodworking table graphics.
  • cuproPanda, Dingo, jecrell, minimurgle, skullywag - A variety of helpful forum posts, graphics, tools, and tutorials.




ISSUES



Reporting:
If you find any bugs or vanilla wood items that are not properly stuffed (capable of being built with all lumber types), please let me know! When making a bug report, please make sure you have developer mode enabled in your Rimworld settings. You may then create your report either on this forum post or at the GitHub repositories. A link to your exported HugsLib log would be greatly appreciated as well.
                                                                          
Scenarios:
Attempting to use the scenario editor on any custom scenario which references items made from vanilla wood logs will not work and flood the debug log with errors. Attempting to select a scenario that references items made from EW wood types without EW installed will have the same effect. As a workaround to this problem, you may disable EW, create a blank scenario from the one you wish to edit (such as Lost Tribe), save it, and re-enable EW. You will then be able to edit the blank scenario template.