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

#31
Help / Re: Detour tutorial?
August 21, 2016, 12:06:03 PM
Thanks, either of those codes seems to work. I assume these correspond to an enumeration from BindingFlags?
#32
Help / Re: Detour tutorial?
August 21, 2016, 11:31:22 AM
Right, I meant a method. Here's the code I have:


using System;
using System.Collections.Generic;
using CommunityCoreLibrary;
using RimWorld;
using UnityEngine;
using System.Reflection;
using Verse;
using Object = UnityEngine.Object;

namespace RationControl
{
public class ModInitializer : ITab
{
protected GameObject _modInitializerControllerObject;

        public ModInitializer()
        {
            _modInitializerControllerObject = new GameObject("ModInitializer");
            _modInitializerControllerObject.AddComponent<ModInitializerBehaviour>();
            Object.DontDestroyOnLoad(_modInitializerControllerObject);
        }

        protected override void FillTab() { }

}

class ModInitializerBehaviour : MonoBehaviour
    {
        protected bool _reinjectNeeded;
        protected float _reinjectTime;

        public void OnLevelWasLoaded(int level)
        {
            _reinjectNeeded = true;
            if (level >= 0)
                _reinjectTime = 1;
            else
                _reinjectTime = 0;
        }

        public void FixedUpdate()
        {
        }

        public void Start()
        {
            MethodInfo coreMethod = typeof(ITab_Pawn_Health).GetMethod("FillTab", BindingFlags.CreateInstance | BindingFlags.Public);
            MethodInfo modMethod = typeof(ITab_Pawn_Health_Modded).GetMethod("FillTab", BindingFlags.CreateInstance | BindingFlags.Public);
     
            if (coreMethod == null) {
            Log.Error("core method is null");
            }
           
            if (modMethod == null) {
            Log.Error("mod method is null");
            }
     
            try
            {
                Detours.TryDetourFromTo(coreMethod, modMethod);
            }
            catch (Exception)
            {
                Log.Error("Could not Detour Ration Control.");
                throw;
            }
     
            OnLevelWasLoaded(-1);
        }
    }
}


This is based on Killface's AutoEquip mod. I can edit his mod and everything works, but when I try to do the same for my own mod, the coreMethod and modMethod variables are null, so the TryDetourFromTo call fails. I'm trying to edit the methods of the ITab_Pawn_Health class.
#33
Help / Detour tutorial?
August 21, 2016, 11:11:49 AM
Trying to learn how to use detours using CCL. I've looked at a couple mods that rely on them, but they do a lot more than I'm looking for, and it's hard to figure out what exactly do I need to detour just one given class. Are there any tutorials or very simple mods, that I could follow to learn the basics?
#34
General Discussion / Re: Hives/Insect Meat
August 19, 2016, 01:26:23 PM
Unless I have a very large supply of meat, I use insect meat to feed prisoners. (as nutrient paste, so cooks don't have to waste time on it) If I run out of regular meat, then I'll start incorporating insect in fine meals, as the fine meal thought more than nullifies the cooked insect meat one.
#35
Quick question regarding the favorites feature of the Work Tab mod:

I'm trying to make a favorite that includes all the 'everyone-does-this' work priorities (firefighting, flicking switches, hauling, etc). The idea is to, whenever I get a new recruit, I assign them that favorite to set their priorities right, then I add additional jobs like construction or art depending on that colonist's specific skills. (adding the specific skills causes the colonist to no longer be assigned to that favorite, but that doesn't matter to me, it has already made the changes I want)

Problem is, this only seems to work if there's already someone else with the favorite assigned when I try to set a new recruit right. If no one has it at the time, then assigning it to someone seems to have no effect. This leads me to believe favorites aren't meant to store priority presets, but rather keep colonist priorities synchronized. Is this the case, or am I using it wrong?
#36
Good to know! Looking forward to it. :)
#38
Getting an error and several warnings with the High Caliber CR patch:



#39
Outdated / Re: [A14] Community Core Library v0.14.1
August 07, 2016, 11:01:55 AM
Sure, added it just now.
#40
Quote from: Szara on August 07, 2016, 07:53:00 AM
I was only recently introduced to Rimworld, and in that short time I have found that Combat Realism is a wonderful addition, and I'd like to thank NoImageAvailable for developing and Skyarkhangel for continuing development on the mod. Though there's one thing that bugs me, and that's the bulk/weight penalties to move/work. Not saying it isn't realistic, or that it doesn't make sense during an attack, but when there aren't raiders at the gates, you can either micromanage your pawns picking up their gear every time they go somewhere possibly dangerous or hunting, or take an annoying hit to your efficiency. Who the heck holds onto a LMG while they're stonecutting? Just set it down, pawn! Though I'm assuming that setting it to only have an effect while a raid is in progress would be overly complicated.

I've spent about three hours trying to tweak it, but the whole thing is hidden in the DLL, and the closest I've come to unpacking that has thrown errors on several portions of the library (looking at you CompProperties_ExplosiveCR), so recompiling it would just break the whole thing. That was using Telerik JustDecompile, which got me the furthest along. I tried using the Microsoft Visual Studios but it just gave me some strange error when trying to install.

Skyarkhangel, I can see that you've not left the DLL alone, so could you tell me what tools you are using to update it? I'd much appreciate it, and gladly dive back in and mess around with it without breaking it before I've touched a thing.

You shouldn't have to decompile CR, Github includes the entire source project that you can open with Visual Studio or whatever.

You can kinda fix what you want with just XML editing, though. Rather than remove the movement/work speed modifiers entirely, just increase the effectiveness of backpacks/tac-vests/etc and the base weight/bulk capacity of colonists, so you can effortlessly carry that LMG around with no noticeable penalties. More info
#41
Quote from: Jalordon on August 06, 2016, 11:33:16 PM
-Forced fire functionality is possibly bugged; after setting a target for force fire for either a turret or mortar, the firing entity will not respond to cancel force fire to cancel the shot or to a second force fire action for a different target until the firing piece shoots (The turret/mortar has to shoot before it will respond to canceling or for a different target to force fire at).

-Also noticed that mortar shell's speed varies based on distance, is this intended to simulate a steeper arc for more air time or should mortar shells have a consistent speed? Firing at minimum range has a really slow shell while shooting with a mortar at one corner of the map to the other corner has a much faster shell. (Feels REALLY slow though at short range so even if that is the case it probably should go faster)

Both of those were present in A13 if I recall correctly. I'd certainly prefer if Cancel Force-Fire actually got auto-turrets/mortars to stop their current firing cycle, though!
#42
Outdated / Re: [A14] Community Core Library v0.14.1
August 06, 2016, 11:07:11 PM
Quote from: 1000101 on August 05, 2016, 03:40:17 PM
CCL uses C#6 features, if your compiler can't compile C#6 then you will get errors.

Currently, only VS and XS 6+ can compile C#6.

Thanks, I switched over to VS and was able to compile the project.


From what I understand, the issue with the minimap color settings being ignored lies with a few specific calls of the Scribe_Values.LookValue method. I used the MiniMapOverlay_Colonists class for the purposes of debugging, but all MiniMapOverlay subclasses likely suffer from the same issue, as their colors reset too.

For the test, I used this XML (setting colonists to show as orange in the minimap) and changed the ExposeData method of MiniMapOverlay_Colonists to look like this. The resulting console output makes it clear the intended color is not loaded from the XML. However, there are some instances where the XML scribing is working as intended, such as when fetching the ccl_version or visible elements, so it's definitely not an access problem to the XML file itself, or the use of the Scribe_Values.LookValue method. Rather, the problem seems to be that the scribe mode is set to ResolvingCrossRefs at the time ExposeData is called, which makes the LookValue method calls not do anything, because they only run any code at all if the mode is LoadSaveMode.Saving or LoadSaveMode.LoadingVars.

If you have any ideas on how to identify the root cause for this, I'll gladly try them out.
#43
Quote from: Lem Wright on August 06, 2016, 07:40:10 PM
Is Combat Realism Defense updated?
Is the EPOE and Rimfire patch currently working?

I updated CR Defense for A14 a few days ago: http://www.mediafire.com/download/vkd574a4z7cwanz/CombatRealism+Defence.zip
It should be compatible with all future versions of CR for A14, unless features are changed that impact the added turrets.

The CR-EPOE patch from A13 should still be valid for A14 from what I can see, but I'm not 100% sure.
#44
Quote from: RetPaladinlol on August 06, 2016, 06:31:11 PM
Has anyone else encountered a bug where you can't reload even though you have the right ammo type? I made a LMG and at first it was shooting fine then when it went to reload it said "Out of ammo", even though I had 300 rounds of the 7.62mm equipped. I even tried equipping all other ammo types I had on hand thinking the LMG is bugged but nothing works.

There are two types of 7.62mm ammo: 7.62x51mm NATO, and 7.62x54mmR. The former is used for sniper rifles, the latter for LMGs; ensure your colonist has the correct one in their inventory.
#45
Outdated / Re: [A14] Community Core Library v0.14.1
August 05, 2016, 12:31:36 PM
I grabbed the source code in order to troubleshoot that problem I have with minimap settings resetting to default after a game restart, but I'm having issues generating the library DLL: compiler throws an error every time the => operator is used.

Am I missing a step to get the library to compile, or something?