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

#1
When a surgery on a pawn fails, damage can be stopped/reduced by the apparel they are wearing rather than applying directly to their bodies. As a result, a pawn wearing heavy armor can suffer no damage from a failed surgery because their armor protects them.

This can be easily reproduced by equipping a pawn with completely new set of power armor and a power armor helmet and having a pawn with little/no medical skill attempt to remove an organ. A message will appear announcing a failed surgery and the metallic tink of armor taking damage can be heard. Inspecting the pawn's gear, you can see that the armor has taken damage from the failed surgery.

[attachment deleted due to age]
#2
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.
#3
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>


#4
Releases / [B19/1.0] Huntsman's Mods
September 04, 2018, 12:42:10 AM
What's this?
Just a place for me to compile my mods and help people keep track of things. I usually play with Combat Extended, so many of my mods are either patches, extensions, or otherwise compliment Combat Extended. Still, many are perfectly useful on their own--any that depend on CE will be noted.

My Mods:

[1.0] Concertina Wire (With Damage)


Description:
A long time ago, mankind realized the benefits of having pointy bits of rock, wood, and metal between them and the people trying to kill them. Eventually, they got pretty good at it.

An evolution of barbed wire, concertina wire, also called razor wire, is named for its helical shape and tendency to expand—resembling a musical instrument of the same name--was first developed during the First World War. A cheap, lightweight building material used to construct formidable anti-infantry obstacles and fortifications, it remains popular to this day with militaries and civilians alike.

Features:

  • Concertina wire, a new material made of steel that can be used to construct a variety of fortifications.
  • Wire Obstacles, lines of carefully arranged razor wire used to slow and injury your advancing foes.
  • Wire Barricades, cheap, quick-to-build barriers constructed from razor wire, useful for preventing enemy movement and corralling prisoners.

Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1501459305
Google Drive:
(1.0) https://drive.google.com/open?id=1fC7FeUS5giy9rlgGAAx8hsuTIO_8grHL
(B19) https://drive.google.com/open?id=1ODMidw_C1tt7ZNjg2edAVqz1j5IfGGQ7

[1.0] Palisades


Description:
Simple walls constructed of logs driven into the ground, the use of palisades dates back thousands of years. Built from local timber, they were useful for defending settlements or temporary camps. While far cheaper than a stone wall, palisades are weaker and vulnerable to fire.

Features:

  • Palisade Wall - Health: 290, Recipe: 6 x Wood.
  • Palisade Crenel (Lowered Wall) - Health: 290, Recipe: 4 x Wood.
  • Palisade Gate - Health: 225, Recipe: 25 x Wood.

Updated/maintained by N7Huntsman. The excellent original mod was created by Undereastern, and I have updated and uploaded this with his permission.


Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1547782284
Google Drive:
(1.0) https://drive.google.com/open?id=1iqZ9TZsfC6KS-2pu6ggpj84wPQlYFbGg
-----
[1.0] Defenses Expanded


Description:
A collection of fortifications from throughout history. Includes my [1.0] Razor Wire (With Damage) mod, built in. Additionally, while I have not packaged it with this mod because I am not the original creator, I also recommend the excellent Palisades mod, originally created by Undereastern and recently updated by me.

An evolution of barbed wire, concertina wire, also called razor wire, is named for its helical shape and tendency to expand—resembling a musical instrument of the same name--was first developed during the First World War. A cheap, lightweight building material used to construct formidable anti-infantry obstacles and fortifications, it remains popular to this day with militaries and civilians alike.


Features:

Gabions -
Recipe: 5 x Wood
Health: 250
Hollow, usually cylindrical structures constructed from wicker or wood. Though weaker than modern sandbags, when packed with earth or rocks they are capable of stopping incoming projectiles.

Hesco Barriers -
Recipe: 1 x H-Barrier Cell (2 x Steel, 4 x Chemfuel)
Health: 475
A modernized gabion consisting of a cubic structure made of steel wire and a heavy-duty liner, they were initially developed for the control of floodwaters, but soon found a military application. Packed with sand or soil, they make a strong barrier resistant to both direct fire and explosions. Portable and lightweight, they are widely used to construct both fortifications and structures in the field. Available in green and tan.

T-Wall -
Recipe: 8 x Steel
Health: 600
Modular barriers made of reinforced concrete, they offer a compromise between cheaper, weaker masonry walls, and walls made of strong, but extremely expensive reinforced concrete walls. Though they can't be used to support a roof, they are well-suited for perimeter walls or protected corridors.

Razor Wire -
An evolution of barbed wire, it is generally made of two wires, a stronger, un-barbed support wire and a length of razor tape with sharp, pointed barbs produced in several different lengths.


Mod Support -

This mod should have no incompatibilities with other mods. If you think you've found one, please tell me in the comments below. Additionally, this mod currently has built-in support for the following mods:
  • Medieval Times by Vindar - New research prerequisites added to gabions and vanilla sandbags.
  • [RF] Concrete by Rainbeau Flambe - New T-barrier recipe.
  • Rimefeller by Dubwise - New H-barrier recipe.
  • Concrete Walls by Poroh - New T-barrier recipe.

Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1550972678
Google Drive:
(1.0) https://drive.google.com/open?id=127K-ndJQx_9FL7FzCexdRw_vyL_Nf1LY

-----
[1.0] Combat Extended: Shields


Description:
Additional types of shields from a variety of eras. Designed by different cultures for different roles, they allow further specialization of colonists equipped with shields depending upon their role in combat and duty around the colony. Requires Combat Extended.

Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1586351220
GitHub:
(1.0) https://github.com/N7Huntsman/CombatExtendedShields
-----
[1.0] Rim Guns Extended


Description:
Adds an array of new guns and launchers to vanilla Rimworld from the Combat Extended Guns mod, with a variety of roles and tech levels

Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1587381007
GitHub:
(1.0) https://github.com/N7Huntsman/Rim-Guns-Extended
-----
[1.0] Combat Shields


Description:
Additional types of shields from a variety of eras, usable with melee and certain ranged weapons. Designed by different cultures for different roles, they allow further specialization of colonists equipped with shields depending upon their role in combat and duty around the colony. For vanilla Rimworld.

Download:
(1.0) Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1588616696
GitHub:
(1.0) https://github.com/N7Huntsman/Combat-Shields
-----
Licensing & Permissions:
Users are free to add my mods to collections, packs, etc. and may modify my content however they like. I ask that users do not re-upload or package my mods unless they have made significant and meaningful changes, or have gotten my permission.

Like my mods? Consider buying me a cup of coffee on Ko-fi!