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

#16
Help / Re: Lots of errors, no idea where from
November 14, 2018, 06:58:53 PM
Hmm... is this from loading a modded save game? At least part of it looks like there was perhaps a species or faction mod that was removed/was changed, causing it to throw errors when it fails to load the info on the relationships between colonists and the pawns that no longer exist.
#18
Help / Turret Projectile DefOf Issue
November 02, 2018, 01:14:47 AM
So, I'm in the process of updating an abandoned A18 turret mod. It's currently at A18, but I was hoping to get it updated to 1.0 for others to use. I've got all the .xml side of things sorted out and there don't seem to be any issues there. However, it's currently throwing the following error when the mod is loaded:

Tried to use an uninitialized DefOf of type DamageDefOf. DefOfs are initialized right after all defs all loaded. Uninitialized DefOfs will return only nulls. (hint: don't use DefOfs as default field values in Defs, try to resolve them in ResolveReferences() instead) Debug info: DirectXmlToObject is currently instantiating an object of type TurretCollection.CompProperties_ProjectileExtraDamage
Verse.Log:Warning(String, Boolean)
RimWorld.DefOfHelper:EnsureInitializedInCtor(Type)
RimWorld.DamageDefOf:.cctor()


While the turrets can successfully load, aim, and fire, the projectiles pass through things (pawns, structures, mountains, etc.) without causing damage and the following error is thrown numerous times:

Exception ticking TC_Bullet_ChainGun46236 (at (105, 0, 137)): System.MissingMethodException: Method not found: 'Verse.Log.Error'.
  at Verse.Projectile.CheckForFreeIntercept (IntVec3 c) [0x00000] in <filename unknown>:0
  at Verse.Projectile.CheckForFreeInterceptBetween (Vector3 lastExactPos, Vector3 newExactPos) [0x00000] in <filename unknown>:0
  at Verse.Projectile.Tick () [0x00000] in <filename unknown>:0
  at TurretCollection.Projectile_Custom.Tick () [0x00000] in <filename unknown>:0
  at Verse.TickList.Tick () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


Digging through the mod's assembly, I've located the file I believe is responsible for the first (and I hope second) error. It reads:

using System;
using RimWorld;
using Verse;
using UnityEngine;

namespace TurretCollection {
    public class CompProperties_ProjectileExtraDamage : CompProperties {
        public string hitText = "TC_Hit";
        public Color hitTextColor = new Color32(255, 153, 102, 255);
        public int damageAmountBase = 1;
        public DamageDef damageDef = DamageDefOf.Bullet;

        public CompProperties_ProjectileExtraDamage() {
            base.compClass = typeof(CompProjectileExtraDamage);
        }
    }

    public class CompProjectileExtraDamage : ThingComp {
        public CompProperties_ProjectileExtraDamage Props => (CompProperties_ProjectileExtraDamage)base.props;


As I don't know any useful amount of C#, I'm hoping someone else can tell me how to best resolve the error. If you need any additional code, or the mod files and source to look at, just let me know.
#19
Releases / Re: [B19/1.0] Huntsman's Mods
October 29, 2018, 08:49:09 PM
I've added some stats for both Palisades and Defenses Expanded that will hopefully make the distinction between items clearer.
#20
Releases / Re: [B19/1.0] Huntsman's Mods
October 29, 2018, 12:31:55 PM
Bighead is correct--while Razor Wire is packaged in Defenses Expanded, Palisades is not, because I'm not the original author.

The benefit of palisades is that they're cheap to build and relatively strong (for walls made of wood). There are indeed lowered sections that can be fired out of and climbed by enemies.

For the wooden gabions, they're (both historically and in this mod) a precursor to sandbags. They offer slightly less cover and are made from wood instead of steel, but they otherwise function the same.

If you're referring to the modern gabions/H-barriers, they basically walls that are strong enough stand up to direct assaults (they also don't suffer the damage penalty against explosives that regular walls do) that you have to produce beforehand, but are otherwise portable and modular. Makes them good for fortified caravan camps and the like.
#21
Releases / Re: [B19/1.0] Huntsman's Mods
October 29, 2018, 12:09:15 AM
I've made my initial release of Defenses Expanded. Please inform me if you run into any issues with it.
#22
Help / Re: Tips for making textures
October 28, 2018, 02:27:45 PM
What is is exactly that you're making? A piece of furniture? Apparel?
#23
Help / Re: Core and mod xpatching
October 27, 2018, 07:12:08 PM
I guess I don't really see the point in having the workstation itself packaged entirely separate from the recipes if A. it serves no purpose alone and B. you don't want to see it. I'm not really certain if there's a particular tag like you're asking for, but why even bother having the mod turned on at all in that case?

Additionally, you don't need to xpatch the recipes in unless you really feel the need to--they'll work just fine as independent Defs.
#24
Help / Re: XML Patch issue with sound pitch
October 27, 2018, 05:42:28 PM
I'm not certain your xpatch is formatted correctly. Either way, you should just be able to roll it into one Operation, rather than two. Is it throwing any errors as is?

<Operation Class="PatchOperationReplace">
        <xpath>*/SoundDef[defName="Bow_Small"]/subSounds/li/pitchRange</xpath>
        <value>
            <max>1.1</max>
            <min>1.0</min>
        </value>
    </Operation>
#25
Help / Re: Adding Custom Values to a Def
October 27, 2018, 05:34:46 PM
I believe at least part of your issue is that thingClass is in the C# part of things, rather than .xml portion. Also, what variable are you trying to add?

Unfortunately, I don't know much of anything about C#, but I may suggest looking into the Combat Extended, which has shields--perhaps that'll give you some insights?
#26
Help / Re: Tips for making textures
October 27, 2018, 05:01:37 PM
Did you find your answer for this?

As far as the "unity2d.engine could not  load textures for..." in my experience that means you have a pathing problem.

Broadly speaking, all the textures in your mod should be contained within the 'Textures' folder of your mod, or one of the subfolders therein. Within your .xml, using the <texPath></texPath> tags, you'll then point the .xml to the texture (spelling and capitalization are important here).

So, if the texture I wanted was called, Table.png and the file path to it was: MyTableMod>Textures>Furniture, my texPath would be:

<texPath>Furniture/Table</texPath>
#27
Help / Re: Core and mod xpatching
October 27, 2018, 04:54:53 PM
Firstly, I'm afraid I don't entirely understand the modding structure you're going for, nor what the benefit of it is. By 'core' are you referring to Rimworld's Core folder as found under Mods, or are you talking about something you made?

And, more generally speaking, if you only want the workstation to appear when both 'core' and 'the mod itself' are active, why not just put the workstation "in the mod itself" either as a separate Def, or by xpatching it into the def of the 'core'?
#28
Help / Re: Trap Balancing Issues
October 27, 2018, 04:45:38 PM
Okay. Thank you, that's quite helpful.

While I understand conceptually what the code there does, I know exceedingly little about C# and how Rimworld packages/handles it. I believe Jecrell's got a modding tutorial floating around, so I suppose I'll work my way through that and see if I can poke around and figure it out from there--that's how I learned to mess with Rim's .xml side, at any rate.

Thanks again for the help.
#29
Help / Re: Trap Balancing Issues
October 27, 2018, 01:53:35 PM
Sorry, that's not really what I meant--I'm fairly familiar with the vanilla trap framework, but what I want to do is to allow the trap to spring multiple (but not unlimited) times before it is destroyed.
#30
Help / Trap Balancing Issues
October 27, 2018, 12:56:23 AM
To many a long story short, I've created a barbed wire mod based off of the framework of the vanilla Spike Trap. In short, the intent of the barbed wire is to slow down approaching raiders while also dealing some minor damage, as a bonus.

While it's perfectly serviceable as it stands, I'm working to balance it. I have a few ideas of how, but I'd need some coding input on how to pull it off.

The problem of balance is two-fold; performance and gameplay.

When a raider springs a trap is injured, they usually receive anywhere between 3 - 6 different injuries, be they cracks, stabs, cuts, etc. (if anyone knows how I can make the trap inflict only cuts, I'd be grateful). With some players arranging a dozen or more lines of wire, these accumulate to the point that they have 20+ injuries per body part, and it causes lag when you inspect them in the medical menu. Needless to say, this is generally enough to halt any impending raid.

What I'd like to do is to give each trap a percentage chance of being destroyed when it springs (or perhaps have them take a certain amount of damage when they spring) to simulate them being "trampled," thus opening up lines in the wire for raiders to exploit and demanding some planning and maintenance by the player.

While I could sort of accomplish this by drastically reducing the spring chance and having them be destroyed upon activation, it's not my ideal solution.

Below is the "business end" of the trap code--since it's based off the vanilla code, it's nothing crazy.

<!-- Main Stats -->
<researchPrerequisites>
<li>Smithing</li> <!-- This technology is required to build this item. Don't want the requirement? Delete this tag. -->
</researchPrerequisites>
<building>
<isTrap>true</isTrap>
<trapDestroyOnSpring>false</trapDestroyOnSpring> <!-- Does the obstacle disappear after being triggered? -->
<trapDamageCategory>Sharp</trapDamageCategory>
<trapPeacefulWildAnimalsSpringChanceFactor>0.15</trapPeacefulWildAnimalsSpringChanceFactor>  <!-- How likely non-colony animals are to trigger the trap.-->
<blueprintGraphicData>
<texPath>RazorWire_Blueprint_Atlas</texPath>
</blueprintGraphicData>
    <expandHomeArea>false</expandHomeArea>
<ai_chillDestination>false</ai_chillDestination>
</building>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded> <!-- What kind of terrain can the obstacle be placed on? -->
<fillPercent>0.1</fillPercent> <!-- How much cover it gives, value 0.0 to 1.0-->
<pathCost>200</pathCost> <!-- How difficult it is to cross the obstacle-->
<pathCostIgnoreRepeat>true</pathCostIgnoreRepeat>
<statBases>
<Mass>1.25</Mass>
<TrapSpringChance>0.55</TrapSpringChance> <!-- How likely hostile pawns are to trigger the trap.-->
<TrapMeleeDamage>5</TrapMeleeDamage> <!-- How much damage the trap does when triggered-->
<Beauty>-5</Beauty>
<MaxHitPoints>150</MaxHitPoints>
<WorkToBuild>180</WorkToBuild>
<Flammability>0</Flammability>
</statBases>
<damageMultipliers>
<li>
<damageDef>Bomb</damageDef>
<multiplier>2</multiplier>
</li>
<li>
<damageDef>Blunt</damageDef>
<multiplier>0.85</multiplier>
</li>
</damageMultipliers>