A10 modders stuff

Started by skullywag, March 27, 2015, 08:28:44 AM

Previous topic - Next topic

skullywag

Might as well start this as ive updated all my mods but only found 1 major change to hediffs.

To set an injury as treated with medicine you have to do something like:


private static readonly ThingDef medicine = ThingDef.Named("Medicine");
HediffComp_Treatable hediffComp_Treatable = current.TryGetComp<HediffComp_Treatable>();
hediffComp_Treatable.NewlyTreated(0.8f, (medicine == null) ? null : medicine);


little bit more to it but thats the general gist.

Some other minor bits:

Etypes have been removed so remove them from all your defs. You may need a new category as some of these have changed for example I used to use ethereal for anything droppod related (meteors and razorrain for example) i now use "skyfaller".

powerOutput on CompPowerTraders is now capitalised, as are some other methods and stuff, just keep this in mind when updating.

GetFloatMenuOptionsFor is now FloatMenuOptions.

InteractionSquareOffset is now InteractionCellOffset in your xml defs.

Thats all ive hit so far.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

#1
Has how we load extra xml changed, ive put a class="" in my def but the game never finds it so my new xml stuff is not found. Any modders updated a mod and done this yet?

edit - class != Class ..... I Hate myself.  *hangs head in shame*
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RemingtonRyder

For meals, taste has changed to preferability, nutrition is a decimal value, and joy is added.

Animals (pawnkinds) have a new tag which is inherited from AnimalBase, psychoOnDamageChance.

skullywag

Why when i try to reference a things health like:


            List<Thing> list = Find.ThingGrid.ThingsListAt(Position);
            if (list.Count > 0)
            {
                //Loop over things
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].def.category == EntityCategory.Item)
                    {
                        Log.Error("health = " + list[i].Health);
                    }
                 }
              }


I get:

exception ticking CompostBin228785: System.MissingMethodException: Method not found: 'Verse.Thing.get_Health'.

  at Verse.TickList.SingleTick () [0x0018b] in C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickList.cs:109


Any ideas? is this due to the hitpoint rename or something?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Gaesatae

I've just checked the assembly, looks like it has changed. Try list[i].HitPoints instead of list[i].Health

skullywag

Yeah i remembered last night i forgot to update my source files so autocomplete is picking up health from the earlier a10 release. I.e. im a derp again....
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

#6
Anyone know what would cause:


System.ArgumentNullException: Argument cannot be null.

Parameter name: source

  at System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate) [0x00000] in <filename unknown>:0

  at System.Linq.Enumerable.Where[PawnGroupMaker] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0

  at RimWorld.PawnGroupMakerUtility+<GenerateArrivingPawns>c__Iterator7C.MoveNext () [0x0014b] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Incidents\Workers\PawnsArrive\PawnGroupMakerUtility.cs:44

  at System.Collections.Generic.List`1[Verse.Pawn].AddEnumerable (IEnumerable`1 enumerable) [0x0001a] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:128

  at System.Collections.Generic.List`1[Verse.Pawn]..ctor (IEnumerable`1 collection) [0x00025] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:65

  at System.Linq.Enumerable.ToList[Pawn] (IEnumerable`1 source) [0x00000] in <filename unknown>:0

  at RimWorld.IncidentWorker_NeutralGroup.SpawnPawns (RimWorld.IncidentParms parms) [0x00000] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Incidents\Workers\PawnsArrive\IncidentWorker_NeutralGroup.cs:51

  at RimWorld.IncidentWorker_TravelerGroup.TryExecute (RimWorld.IncidentParms parms) [0x00041] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Incidents\Workers\PawnsArrive\IncidentWorker_TravelerGroup.cs:26

  at RimWorld.IncidentQueue.IncidentManagerTick () [0x00039] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Incidents\IncidentQueue.cs:76

  at RimWorld.Storyteller.StorytellerTick () [0x00000] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Storyteller.cs:86

  at Verse.TickManager.DoSingleTick () [0x00191] in C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:255
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Verse.Log:Error(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:46)
Verse.TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:257)
Verse.TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:175)
Verse.Map:MapUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Map\Map.cs:202)
Verse.RootMap:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\RootMap.cs:51)

(Filename: C Line: 0)

Incidents left over after a queue interval:

UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Verse.Log:Error(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:46)
RimWorld.IncidentMaker:IncidentMakerTick() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\IncidentMakers\IncidentMaker.cs:56)
RimWorld.Storyteller:StorytellerTick() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Storyteller.cs:88)
Verse.TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:255)
Verse.TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:175)
Verse.Map:MapUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Map\Map.cs:202)
Verse.RootMap:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\RootMap.cs:51)

(Filename: C Line: 0)

    36.5d: TravelerGroup     (points=2.254858E+09 )
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Verse.Log:Message(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:29)
RimWorld.IncidentMaker:IncidentMakerTick() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\IncidentMakers\IncidentMaker.cs:59)
RimWorld.Storyteller:StorytellerTick() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Storyteller.cs:88)
Verse.TickManager:DoSingleTick() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:255)
Verse.TickManager:TickManagerUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Ticking\TickManager.cs:175)
Verse.Map:MapUpdate() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Map\Map.cs:202)
Verse.RootMap:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\RootMap.cs:51)

(Filename: C Line: 0)



Im guessing ive done something wrong in my pawnkinds or my faction (I do have a mod active which plays in that area) but cant spot it and the errors arent that helpful. oh and this happens when the storyteller tries to spawn groups.

EDIT - AHH never mind, had a faction for a trader that doesnt have any pawnkinds in it but wasnt hidden.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Haplo

Did update my mods a bit and found this changes:


Pawn-Health:
pawn.healthTracker.activities.GetEfficiency(PawnActivityDefOf.Eating)
=> pawn.health.capacities.GetEfficiency(PawnCapacityDefOf.Eating)

JobDrivers:
public TEMPLATE_JobDriver_GotoCellAndDoX(Pawn myPawn) : base(myPawn) { }
=> public TEMPLATE_JobDriver_GotoCellAndDoX() { }

ThinkNodes returns now a ThinkResult:
public override ThinkResult TryIssueJobPackage(Pawn pawn)

also it doesn't accept null anymore. New: return ThinkResult.NoJob;

skullywag

#8
Latest RC seems to have stopped non humanlike pawns using the berserk thinktree. I have my centipedes in my purple ivy mod set to use it and they spawn completely docile...this was working in 757 im sure...wonder if I have to now set them to berserk on spawn or something...

edit - actually i dont think my faction is working anymore....wont generate with new worlds...huh???

edit2 - i lied faction is there, confirmed by spawning raid from in the dev menu. Sooo confused.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

skullywag

#9
So does anyone know whats needed to make an enemy faction that isnt humanlike or mechanoid? im thinking theres some config that wont work due to my pawns being non mechanoid and non humanlike....maybe...

Edit - lol turns out i screwed up my thinktree...not having a good week...
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

RawCode

Due no no obfuscation modding is extremely easy, also nothing stop you from assembling version with additional debug hooks and use it in development.

System.ArgumentNullException: Argument cannot be null.
reason is simple, one of methods below have sanity check on input and trigger exception if check is failed.

You must follow entire stacktrace and detect place, where your data is injected into base codeflow.

spoiler:
  at RimWorld.IncidentWorker_TravelerGroup.TryExecute (RimWorld.IncidentParms parms) [0x00041] in C:\Dev\RimWorld\Assets\Scripts\RimWorld\Storyteller\Incidents\Workers\PawnsArrive\IncidentWorker_TravelerGroup.cs:26

Faction type defined by enum type, you can make new instance of enum at runtime but loading saved game will fail as long as this not done on early stage (pregame GUI)

justarandomgeek

#11
I had to find/replace IntRot to Rot4 and ThingWithComponents to ThingWithComps. Also, I was able to replace my extension ThingWithComps.GetComps() (which used reflection to read the private comps field) with the ThingWithComps.AllComps property. I'm sure I'll find more things that need fixing, but those got me compiling again...

Also had to rename shaderType to graphicShaderType in my XML, and MaxHealth to MaxHitPoints. (Along with the previously mentioned removal of eType.)

mrofa

Quote from: skullywag on April 13, 2015, 05:33:19 PM
So does anyone know whats needed to make an enemy faction that isnt humanlike or mechanoid? im thinking theres some config that wont work due to my pawns being non mechanoid and non humanlike....maybe...

Edit - lol turns out i screwed up my thinktree...not having a good week...

Im not sure if its in a10 but in a9 i did find somewhere formula of IsAnima.
which stated something like:

if(!pawn.humanoid && pawn.isFlesh)
{
pawn.isAnimal;
}
Writing that from memory :p
So im not sure if you an do that.
All i do is clutter all around.

ItchyFlea

Just thought I'd throw in what I found (and remembered) while updating my mods:

in WorkGivers, <requiredActivities> was changed to <requiredCapacities>
in ThingDefs, <useStandardHealth> was changed to <useHitPoints>
in ThingDefs, <SunShadowInfo> was changed to <graphicSunShadowInfo>
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Famous Shoes

What I've come across in A10 "Gratuitous Renaming Battles"  ;)


  • Equipment has, I think, become ThingWithComps.
  • Reservations.ReserverOf is gone, presumable supplanted by either FirstReserverOf or IsReserved
  • JobDriver's pawn constructor is gone, not sure yet what the workaround there is to be. Maybe the pawn is now target A?  :(
  • ReservationType is gone, appears we're not supposed to use anything in its stead, but unsure.
  • Toils_Reserve's Unreserve has become Release, I think.
  • ThingFilterGui is now ThingFilterUI.
  • Pawn.healthTracker is now Pawn.health.
  • RaceProps.Humanoid is now Humanlike.  ::)