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

#1
Help / Re: Give a Hediff to a pawn on spawn
July 22, 2019, 07:12:46 PM
Well since nobody bothered to put down their two cents, here's the way I figured out how to do it:

You will need JecsTools as a dependency.

Now create your own HediffGiverSet, and in the hediff givers use this class:


<li Class="JecsTools.HediffGiver_StartWithHediff">
   <hediff>YourHediff</hediff>
</li>


There we go. There's probably more ways to do it this but this is as straightforward as I could figure out.

Have a fine day :D
#2
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!
#3
Ok cool. I found the one called Fluffy breakdowns, I'll take my chances with the Random breakdowns. But I'm looking forward for a Terminator to join in. Those guys can really take a pounding.
#4
Hey, I played this mod a bunch but I noticed everything breaks down really quickly, and the larger the base the more things need maintenance, even capsules which are designed to last hundreds of YEARS break down in a week...

Is a mod responsible for this? Which one is it, because its kinda insane having to assign 6-8 dudes fulltime repairmen. And there's no bots that you can craft that will do that for you. Last I checked at least.

Apart from that, It's a modpack that must be played like Dorf Fortress, which is quite entertaining. Love all the new factions!
#5
Help / Re: Bigger Item Graphics
April 23, 2017, 08:13:25 AM
Quote from: Shinzy on April 23, 2017, 07:58:38 AM
Heyoo Kelly! Cpt. Ohu has done a mod that allows weapon sizing
https://ludeon.com/forums/index.php?topic=27459.0
Quote from: Cpt.Ohu...Additionally I'm detouring DrawEquipmentAiming to alter the drawing mesh size.

Isn't this awesome...? Thanks so much! :D

Edit: I tried it, and it works great! There's a few other issues but I'm sure I can sort these out myself. Thanks :)
#6
Help / Re: Bigger Item Graphics
April 23, 2017, 05:51:03 AM
Quote from: RawCode on April 23, 2017, 12:00:25 AM
use dnspy with options enabled
tokens
compiler generated code
in case of emergency switch to IL layer

if code if present, it will be "visible".
(code is always visible, but decompiler trying to recover syntax sugar and mess things up, use IL layer in such cases)

dnspy is best tool around, ever surpassing commercial decompilers.

note:
game DLL do not have any rendering code, all rendering routines are implemented as natives inside unity engine, you can't modify real renderer without native level injections

protip
make invalid texture, that cannot be rendered and let game throw exception, it will allow you to see stacktrace and get information about codeflow almost instantly, without any need of debugger.

you can inject unconditional throw with code injection to get information about caller of specific method without performing tracing.

Ok, I'll take a look with DNSpy with "options enabled" whatever that means.

Also that protip with the invalid texture sounds like a great idea! I need to seriously try that and see if it works/helps. Also when I mentioned the rendering stuff, I mean the way the game scales it. The Rimworld code itself must be responsible for calling that rescale. What I want is to Override that method, not the actual Unity Internals. (That's just a bad idea).
#7
Help / Re: Bigger Item Graphics
April 22, 2017, 11:58:54 AM
I'm supposed to modify a class that not even IlSpy can find? Whoa, I'm really in a difficult position here, I think my problem is that the code base is pretty vast, and I simply didn't bump into that class. Would it even be possible? Or would I be overwriting the class for every other item in the game, that would be problematic... :S
#8
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! :)