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

#1
When work is being done that has no work bar (I don't know how you call it), i.e. shooting, taming an animal etc. it does not give the mood boost for having passion for their work.
#2
Bugs / Animals tend to stop moving and then starve.
September 01, 2018, 03:39:19 PM
Very often I see that one of my yorkies is starving, then I see that they are somewhere at the edge of the map and I have to give them a new restriced zone and then they start moving again.

They move in a small area, they are not stuck on one tile.

Happens randomly at some point.
Happened when the followed their master and when not.
Only happend so far with yorkshire terrier.
#3
When I start the game no errors occur and when I go into "Spawn Weapon..." I can't find PlagueGun when I then go to "Spawn item collection..." and Spawn Weapons I get at some point an error:

Exception drawing PG_Gun_Plague60985: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.Projectile.get_StartingTicksToImpact () [0x00000] in <filename unknown>:0
  at Verse.Projectile.get_ExactPosition () [0x00000] in <filename unknown>:0
  at Verse.Projectile.get_DrawPos () [0x00000] in <filename unknown>:0
  at Verse.Projectile.Draw () [0x00000] in <filename unknown>:0
  at Verse.DynamicDrawManager.DrawDynamicThings (Verse.DrawTargetDef drawTarget) [0x00000] in <filename unknown>:0
Verse.Log:Error(String)
Verse.DynamicDrawManager:DrawDynamicThings(DrawTargetDef)
Verse.Map:MapUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


Here is my Projectile_PlagueBullet.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
using Verse;

namespace Plague
{
    class Projectile_PlagueBullet : Bullet
    {
        #region Properties
        //
        public ThingDef_PlagueBullet Def
        {
            get
            {
                return this.def as ThingDef_PlagueBullet;

            }

        }


        #endregion Properties

        #region Overrides
        protected override void Impact(Thing hitThing)
        {
            base.Impact(hitThing);

            /*
             * Null checking is very important in RimWorld.
             * 99% of errors reported are from NullReferenceExceptions (NREs).
             * Make sure your code checks if things actually exist, before they
             * try to use the code that belongs to said things.
             */
            if (Def != null && hitThing != null && hitThing is Pawn hitPawn) //Fancy way to declare a variable inside an if statement. - Thanks Erdelf.
            {
                var rand = Rand.Value; // This is a random percentage between 0% and 100%
                if (rand <= Def.AddHediffChance) // If the percentage falls under the chance, success!
                {
                    /*
                     * Messages.Message flashes a message on the top of the screen.
                     * You may be familiar with this one when a colonist dies, because
                     * it makes a negative sound and mentioneds "So and so has died of _____".
                     *
                     * Here, we're using the "Translate" function. More on that later in
                     * the localization section.
                     */
                    Messages.Message("PG_PlagueBullet_SuccessMessage".Translate(new object[] {
                        this.launcher.Label, hitPawn.Label
                    }), MessageSound.Standard);

                    //This checks to see if the character has a heal differential, or hediff on them already.
                    var plagueOnPawn = hitPawn?.health?.hediffSet?.GetFirstHediffOfDef(Def.HediffToAdd);
                    var randomSeverity = Rand.Range(0.15f, 0.30f);
                    if (plagueOnPawn != null)
                    {
                        //If they already have plague, add a random range to its severity.
                        //If severity reaches 1.0f, or 100%, plague kills the target.
                        plagueOnPawn.Severity += randomSeverity;
                    }
                    else
                    {
                        //These three lines create a new health differential or Hediff,
                        //put them on the character, and increase its severity by a random amount.
                        Hediff hediff = HediffMaker.MakeHediff(Def.HediffToAdd, hitPawn, null);
                        hediff.Severity = randomSeverity;
                        hitPawn.health.AddHediff(hediff, null, null);
                    }
                }
                else //failure!
                {
                    /*
                     * Motes handle all the smaller visual effects in RimWorld.
                     * Dust plumes, symbol bubbles, and text messages floating next to characters.
                     * This mote makes a small text message next to the character.
                     */
                    MoteMaker.ThrowText(hitThing.PositionHeld.ToVector3(), hitThing.MapHeld, "PG_PlagueBullet_FailureMote".Translate(Def.AddHediffChance), 12f);
                }
            }
        }
        #endregion Overrides

    }
}

What have I done wrong?
#4
Thanks found it.
#5
When I use ILSpy to decompile Assembly-CSharp I only get:
// C:\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin_Data\Managed\Assembly-CSharp.dll
// Assembly-CSharp, Version=0.17.6362.34601, Culture=neutral, PublicKeyToken=null

// Global type: <Module>
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 2.0

using System;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("0.17.6362.34601")]
[assembly: AssemblyCompany("Ludeon Studios")]
[assembly: AssemblyCopyright("Copyright Ludeon Studios.")]
[assembly: AssemblyTrademark("RimWorld is a registered trademark of Ludeon Studios.")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]


Even when I press CTRL + F and search for "Projectile_" I get no results. I used the Link in the Post to download ILSpy. What am I doing wrong?