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

#1
Help / Give a Hediff to a pawn on spawn
July 21, 2019, 07:07:23 PM
Greetings fine folks of the Ludeon Forums. I've worked hard behind the scenes developing a rather large mod, but one of the bits requires me to add a specific Hediff that I created to a pawn when it spawns.

It's rather necessary because it gives all sorts of nice things to it like pain immunity plus immunity to a ton of diseases, oh and it would last pretty much forever.

I got that bit to work, but the part that betrays me is the actual addition. I cannot reliably add the Hediff to that one race of pawns whenever they spawn, and I must admit that after much googling, I am stumped.


So I ask of you, more experienced mod developers to come to my aid and help bring this mod ever closer to release...!
...By telling me how to do it :)

TL DR: "Dude spawns" -> "Spawns with Hediff/Gets Hediff added instantly"

Have a fine day!
#2
Help / Bigger Item Graphics
April 21, 2017, 03:15:02 PM
So... I've been hammering at this issue for the past few days, I made some progress but it's still a little difficult. After slamming against way too many brick walls. I come to the forums for help, for I am currently lost...

The Issue: I want to make a bigger gun than 1x1. Since the game auto scales them down to 1x1, I have to make a DLL that overrides that behavior to give the gun the correct size.

What I did so far: I go the gun to have the correct size on the ground, however as soon as its hauled, it returns to the 1x1 size which then turns back to 3x3 once its placed back down. Holding and aiming also rescales it to 1x1.
I got a very off-the-shelf DLL making environment, it works tho. I also have ILSpy, dug through the code but can't find the Item rescaler class.

My Horrible, horrible code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using Verse;
using Verse.AI;
using Verse.Sound;
using RimWorld;

namespace projectNexusAssembliesCorp
{
    class BFGModifiers : Verse.ThingWithComps
    {
        public override void Draw()
        {
            Matrix4x4 matrix = default(Matrix4x4);
            Vector3 s = new Vector3(3f, 1f, 3f);
            matrix.SetTRS(DrawPos + Altitudes.AltIncVect, Quaternion.identity, s);
            Graphics.DrawMesh(MeshPool.plane10, matrix, this.Graphic.MatAt(this.Rotation, null), 0);
            Graphic.drawSize = new Vector2(3, 3);
        //    Graphic.
            //IntVec2.Two;
            //A.Size = new Vector2(3, 3);
        }

    }
}


And the XML for the weapon:

<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

  <ThingDef ParentName="BaseBullet">
    <defName>20Kg_MAG_SuperMagnum</defName>
    <label>SuperMagnum Blast</label>
    <graphicData>
      <texPath>Things/Projectile/Bullet_Shotgun</texPath>
      <graphicClass>Graphic_Single</graphicClass>
    </graphicData>
    <projectile>
      <damageDef>Bullet</damageDef>
      <damageAmountBase>52</damageAmountBase>
      <speed>55</speed>
    </projectile>
  </ThingDef>
  <ThingDef ParentName="BaseHumanGun">
    <defName>Mag_Mossberg_Five_Hundred</defName>
    <label>MAG Mossberg 500</label>
    <description>A Mag Sized Mossberg 500 pump shotgun. It is loaded with 20Kg SuperMagnum slugs, known to desintegrate any target it hits.</description>
    <thingClass>projectNexusAssembliesCorp.BFGModifiers</thingClass>
<graphicData>
      <texPath>Things/Items/Weapons/MAG_Shotgun</texPath>
      <graphicClass>Graphic_Single</graphicClass>
  <drawSize>3,3</drawSize>
    </graphicData>
    <soundInteract>InteractShotgun</soundInteract>
<equippedStatOffsets>
<MoveSpeed>-0.25</MoveSpeed>
</equippedStatOffsets>
<Size>(3,3)</Size>

<weaponTags>
<li>MAG_Gun</li>
</weaponTags>

    <statBases>
      <WorkToMake>30000</WorkToMake>
      <Mass>16</Mass>
      <AccuracyTouch>0.60</AccuracyTouch>
      <AccuracyShort>0.90</AccuracyShort>
      <AccuracyMedium>0.40</AccuracyMedium>
      <AccuracyLong>0.14</AccuracyLong>
      <RangedWeapon_Cooldown>1.8</RangedWeapon_Cooldown>
    </statBases>
    <costList>
      <Steel>60</Steel>
      <Component>3</Component>
    </costList>
    <verbs>
      <li>
    <burstShotCount>16</burstShotCount>
<ticksBetweenBurstShots>0</ticksBetweenBurstShots>
        <verbClass>Verb_Shoot</verbClass>
        <hasStandardCommand>true</hasStandardCommand>
        <projectileDef>20Kg_MAG_SuperMagnum</projectileDef>
        <warmupTime>1.8</warmupTime>
        <range>52</range>
        <soundCast>ShotShotgun</soundCast>
        <soundCastTail>GunTail_Heavy</soundCastTail>
        <muzzleFlashScale>20</muzzleFlashScale>
      </li>
    </verbs>
  </ThingDef>
</ThingDefs>


That about covers it, I don't know what else I can do. Thanks for reading! :)