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

#1
Outdated / Re: [A17] FuckFriendlyFire
July 26, 2017, 07:50:29 AM
Quote from: stigma on July 23, 2017, 12:01:09 PM
Is this safe to add/remove in an ongoing save?
It kind of sounds like it would be - but I'd rather ask than run into trouble later :)

-Stigma

Yeah, it's completely safe to add/remove in an ongoing save.
#2
Outdated / Re: [A17] FuckFriendlyFire
July 21, 2017, 04:55:01 AM
Quote from: Schwartz on July 20, 2017, 08:06:41 AM
Ran into a problem with this coupled with the Hospitality mod. A berserking visitor was impervious to bullets. I'm pretty sure he was punching my guys to death just fine though.

Yeah - the mod only affects bullets. I don't think that's related to the Hospitality mod though as berserks are vanilla. Will fix.
#3
Outdated / Re: [A17] FuckFriendlyFire
July 19, 2017, 09:00:46 PM
Quote from: Oblitus on July 19, 2017, 04:45:29 PM
Making friendly fire less likely for skilled shooters would make perfect sense.

BTW, what about turrets?

Turrets will be coming in the update I'm about to push.

#4
Outdated / Re: [A17] FuckFriendlyFire
July 19, 2017, 08:07:28 PM
Quote from: moonra on July 19, 2017, 03:19:48 PM
What do you think would be the best way to configure this to make a skilled shooter be unlikely to shoot a friend without making this an OP mod?

I've just updated the mod to have support for this.

Here's the mod settings menu:







That should give you an idea of how it works.
#5
Outdated / Re: [A17] NoFriendlyFire
July 14, 2017, 10:32:30 PM
Quote from: lorebot on July 14, 2017, 10:29:37 PM
I only asked cause I once annihilated a group of friendlies totally by accident when they showed up to 'help' me with an infestation...the bugs killed about half of them, but I killed the rest cause I couldn't stop them from going into the room with the bugs even tho I had embrasures to shoot through....

Yup. One of the many things that angered me frequently during my time playing. I hope this mod prevents a lot of that in the future :D

edit: updated on GitHub, Workshop and Nexus Mods (v1.1)
#6
Outdated / Re: [A17] NoFriendlyFire
July 14, 2017, 10:18:04 PM
Quote from: lorebot on July 14, 2017, 09:56:31 PM
Does it remove friendly fire from other factions as well?

Meaning that Raiders won't shoot each other while shooting at your colonists?

Will it stop you from shooting friendly visitors or traders if they're at your colony during a raid?

It will stop raiders from shooting each other while shooting at your colonists. That's fair, right?

And thanks for bringing that up. I will update it to stop your colonists from shooting friendly visitors/traders during a raid accidentally.
#7
Outdated / [A17] FuckFriendlyFire
July 14, 2017, 09:19:44 PM

(This mod has no requirements)

Don't you just hate it when a colonist shoots another accidentally?
With this mod, you can change the chance of pawns' and turrets' bullets from hitting each other accidentally.
You can change this in a 0-99% chance in the Mod Settings. 0% disables friendly fire completely.

It can stop bullets from hitting:


  • Your colonists
  • Your animals
  • Friendly factions

It doesn't stop bullets from hitting:


  • Enemies
  • Anything you specifically target

Downloads:
#8
Hi all,

I'm trying to replace ImpactSomething in Verse.Projectile with my own method. I'm using Harmony. Here's my code:

using Verse;
using Harmony;
using RimWorld;
using System.Linq;
using System;
using System.Reflection;
using UnityEngine;
using System.Collections.Generic;

namespace NoFriendlyFire
{
    [StaticConstructorOnStartup]
    class Main
    {
        static Main()
        {
            Log.Message("Patching");
            var harmony = HarmonyInstance.Create("venner.io.nofriendlyfire");
            harmony.PatchAll(Assembly.GetExecutingAssembly());
        }
    }

    [HarmonyPatch(typeof(Verse.Projectile), "ImpactSomething")]
    public static class NoFriendlyFirePatch
    {
       
        // Harmony stuff

        static void Prefix()
        {
            Log.Message("This works for some reason, but it's not what I need.");
        }

        static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
        {
            Log.Message("Replacing method");
            MethodBase from = typeof(Verse.Projectile).GetMethod("ImpactSomething", AccessTools.all);
            MethodBase to = typeof(NoFriendlyFirePatch).GetMethod("ImpactSomethingElse", AccessTools.all);
            return instructions.MethodReplacer(from, to);
        }

        // NoFriendlyFire method

        static void ImpactSomethingElse()
        {
            Log.Message("I would appreciate it if you actually worked");
        }

    }

}


It does not work. There's no errors. The "Patching" and "Replacing method" appear in console when the game is opened. "This works for some reason, but it's not what I need." appears when a projectile hits a pawn. "I would appreciate it if you actually worked" does not appear at all. Why is this? I've searched all over GitHub for a solution to this problem with no avail.