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

#16
Quote from: Wishmaster on December 18, 2016, 04:27:15 PM
Can we have a non steam link to the new A16 mods please ? It seems like your onedrive link only has A15 stuff.

The files you instantly see when you open the link should be the Alpha 16 versions. The Alpha 15 versions were in a folder called 1.5, which I have renamed to Alpha15C.

Update JTExport: Support A16 version of Crafting Hysteresis.
#17
Updated JTMoreAreas: Adds an area manager/hub. Adds labels to separate colonist/human areas and animal areas as well as JTBetterHauling areas. Rename area dialog now auto highlights text so you can edit faster.

Updated JTZoneButtons: Supports other languages.

Updated JTExport: Fix exporting Crafting Hysteresis bills that don't use a unfinished item not actually exporting Crafting Hysteresis data (only vanilla bill data). Support (AC-)Enhanced Crafting by AlcoholV.

Updated JTReplaceWalls: Allow other mods to add their stuff as replaceable. Support scrap metal wall in Misc Stuff by Telkir. Change existing compatibility to use 2.0 system.

Updated JTReplaceWalls: Alpha 16 release.

Updated JTExport: Alpha 16 release.

Updated JTExport: Support A16 version of Enhanced Crafting and accommodate the changes. Add in missing vanilla faction check in Building.GetGizmos().
#18
Ideas / Re: Bills/storage micromanagement
December 02, 2016, 09:24:12 AM
JTExport was made when 14m1337 PM'ed me about this thread.

I've updated JTMoreAreas to try to make editing areas easier; I've added the edit buttons, which leads to a sort of area management hub.
#19
Help / Finding vanilla allow sowing gizmo
November 26, 2016, 11:54:27 PM
When I detour Zone_Growing.GetGizmos(), the allow sowing button disappears. Even when I use the exact code from decompiled source, the button is not there: vanilla code (using Zhentar's ILSpy):

[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
IEnumerator<Gizmo> enumerator = base.GetGizmos().GetEnumerator();
while (enumerator.MoveNext())
{
Gizmo current = enumerator.Current;
yield return current;
}
yield return PlantToGrowSettableUtility.SetPlantToGrowCommand(this);
yield break;
}


I investigated whether Zone_Growing.GetGizmos() should return the allow sowing button and it does;
I commented out the Zone_Growing.GetGizmos() detour and detoured Zone_Growing.SetPlantDefToGrow() with this:

        public void SetPlantDefToGrow(ThingDef plantDef)
        {
            plantDefToGrow = plantDef;


            MethodInfo method = GetType().GetMethod("GetGizmos", BindingFlags.Instance | BindingFlags.Public);
            if (method != null)
            {
                foreach (Gizmo g in (IEnumerable<Gizmo>)method.Invoke(this, null))
                {
                    if (g == null)
                    {
                        Log.Message("Test: gizmo was null");
                        continue;
                    }
                    if (g.ToString() != null)
                    {
                        Log.Message("ToString: " + g.ToString());
                    }
                    if (g.GetType() != null)
                    {
                        Log.Message("GetType: " + g.GetType());
                    }
                }

            }
            else
            {
                Log.Message("Test: can't get method");
            }
            Log.Message("Test: Only SetPlantToGrowCommand");
            Command_SetPlantToGrow but = PlantToGrowSettableUtility.SetPlantToGrowCommand(this);
            if (but.ToString() != null)
            {
                Log.Message("ToString: " + but.ToString());
            }
            if (but.GetType() != null)
            {
                Log.Message("GetType: " + but.GetType());
            }
        }

Which gave this:

ToString: Command(label=Rename, defaultDesc=Rename this zone.)
GetType: Verse.Command_Action
ToString: Command(label=Hide, defaultDesc=Hide/unhide this zone.)
GetType: Verse.Command_Toggle
ToString: Command(label=Delete, defaultDesc=Delete this zone.)
GetType: Verse.Command_Action
ToString: Command(label=Plant: rice plant, defaultDesc=Determine which plant should be sown here.)
GetType: Verse.Command_SetPlantToGrow
ToString: Command(label=Allow sowing, defaultDesc=When disabled, colonists will never sow plants in this zone. They will still harvest.)
GetType: Verse.Command_Toggle
Test: Only SetPlantToGrowCommand
ToString: Command(label=Plant: rice plant, defaultDesc=Determine which plant should be sown here.)
GetType: Verse.Command_SetPlantToGrow


Searching RimWorld's language translations for "allow sowing" gives:

  <CommandAllowSow>Allow sowing</CommandAllowSow>
  <CommandAllowSowDesc>When disabled, colonists will never sow plants in this zone. They will still harvest.</CommandAllowSowDesc>

But searching for CommandAllowSow or allow sowing in Core/Defs or decompiled Assembly-CSharp.dll gives nothing.
Interestingly when you analyse Zone_Growing.allowSow with ILSpy and expand Read By or Assigned By, it does list RimWorld.Zone_Growing.GetGizmos(), but when you look at RimWorld.Zone_Growing.GetGizmos(), it doesn't use Zone_Growing.allowSow as far as I can tell.

I tried JetBrains dotPeek, which gave this:

    [DebuggerHidden]
    public override IEnumerable<Gizmo> GetGizmos()
    {
      // ISSUE: object of a compiler-generated type is created
      // ISSUE: variable of a compiler-generated type
      Zone_Growing.\u003CGetGizmos\u003Ec__IteratorAC gizmosCIteratorAc = new Zone_Growing.\u003CGetGizmos\u003Ec__IteratorAC()
      {
        \u003C\u003Ef__this = this
      };
      // ISSUE: reference to a compiler-generated field
      gizmosCIteratorAc.\u0024PC = -2;
      return (IEnumerable<Gizmo>) gizmosCIteratorAc;
    }

Telerik JustDecompile, which gave this XD:

        [DebuggerHidden]
        public override IEnumerable<Gizmo> GetGizmos()
        {
            Zone_Growing.<GetGizmos>c__IteratorAC variable = null;
            return variable;
        }

ILSpy Version 2.4

[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
Zone_Growing.<GetGizmos>c__IteratorAC <GetGizmos>c__IteratorAC = new Zone_Growing.<GetGizmos>c__IteratorAC();
<GetGizmos>c__IteratorAC.<>f__this = this;
Zone_Growing.<GetGizmos>c__IteratorAC expr_0E = <GetGizmos>c__IteratorAC;
expr_0E.$PC = -2;
return expr_0E;
}



Is the decompiler just missing the code for the button or is the button magicked in somewhere else?
#20
Quote from: pinguin42 on November 26, 2016, 03:59:16 PM
It seems that JTZoneButtons removes the "Allow sowing" button from grow zones. Is this a bug or could it be a modconflict (running 30ish mods)?

It's a bug, I've added the button in the newest release, Version 1.1 (Version 1.2 now; removes some debug statements).
#21
Quote from: Snarbly on November 19, 2016, 09:23:40 PM
How do you copy surgery bills?  I can't seem to find the icon to copy as with workbenches.

Also, would it be possible to replace doors as well as walls?  You can currently replace doors with other doors and walls with other walls, but it would be nice to be able to cross between them.

It should look like this when you select a colonist:


If not, try moving the mod all the way to the bottom; if it works when the mod is at the bottom, that means another mod is replacing the same getGizmo as my mod and compatibility will need to be made.

The problem with replacing doors with walls is that the mod's purpose is to make upgrading walls easier (wood --> stone); if you were able to replace doors with walls, the player would have to cancel individual wall blueprints where the doors are, otherwise you will have a place with no doors.


Edit:
New mod JTExport; Export and import worktable bills. Support for exporting and importing stockpiles to come.

Edit 2:
Update JTExport; Fix some missing ThingFilter values. You should update to this version (1.1) and re-export the original bills since the exports from the initial release are missing some values.

Edit 3:
Update JTExport; support stockpiles.

Edit4:
New mod JTZoneButtons; Adds buttons for creating/expanding and deleting/shrinking stockpiles and growing zones when selecting a stockpile or growing zone.
Update JTCopyBills; Better compatiblity with my mods that replace Building.getGizmos().
Update JTExport; Better compatibility with my mods that replace Building.getGizmos() and Zone_Stockpile.getGizmos().
Update JTReplaceWalls; Replaced a lot of detours with a better way.
#22
Help / Re: Need some help from experienced modders :)
November 07, 2016, 11:49:06 PM
You can look at vanilla code using ILSpy, I suggest using Zhentar's version
https://github.com/Zhentar/ILSpy/releases/
The file you want to open is at
RimWorld\RimWorldWin_Data\Managed\Assembly-CSharp.dll

There is a tutorial that shows XML -> C#
https://ludeon.com/forums/index.php?topic=16405.0

And there is a Visual Studio template to help you get the mod file structure right
https://ludeon.com/forums/index.php?topic=26831

For number 2, you can't add surgery bills to corpses. The only way I can think of doing this is replacing Verse.Corpse.ButcherProducts(). You can replace methods by using CCL (which should be updated to alpha 15 soon), steal relevant code from CCL, look at other mods that used to use CCL/modify methods or look at RawCode's posts
https://ludeon.com/forums/index.php?action=profile;area=showposts;sa=topics;u=9788

For number 3, Medical training is the mod you can look at to see how they achieve the thing you're describing.
#23
Help / Re: Need help getting custom trait working
November 06, 2016, 09:13:01 AM
You don't have a closing XML tag for both of the files.

NEW.xml needs </TraitDefs> at the end.
new 2.xml needs </Defs> at the end.
#24
How about editing the scenario to have a stat multiplier Work speed factor of 10%?
#25
Quote from: Cthonia on November 06, 2016, 05:53:04 AM
I'm somewhat familiar with programming so I can write the parts and the skill penalties/improvements but for the love of god I can't change faction with installing the ports.

You can do this by adding something like
<workerClass>Recipe_ImplantLobotomize</workerClass>
to your surgery/medical RecipeDef, then make the class Recipe_ImplantLobotomize : Recipe_MedicalOperation and do your faction changing in the ApplyOnPawn method.
An example where workerClass is used in vanilla for surgery is the RecipeDef for RemoveMechanoidBodyPart and the workerClass Recipe_RemoveBodyPart.

You should ask for modding help in Mods > Help though.
#26
Quote from: lc-soz on November 04, 2016, 01:17:57 PM
It would be possible to add a feature to copy surgery bills? I use EPOE so it's boring to click one-by-one.

Updated JTCopyBills; Copy and paste surgery bills.
I've only tested with vanilla bills, but I think it should work fine with EPOE bills.

Update JTReplaceWalls; different stuffDef workaround for linux compatibility.
#27
Updated JTCopyBills; fixes converting vanilla bill with unfinished to Crafting Hysteresis bill with unfinished. Bills that don't make unfinished items were converted correctly in previous versions, so if you have converted vanilla bills to Crafting Hysteresis bills, you "only" need to redo the bills that can have an unfinished item; maybe copy bills from previous save, then paste in current save.
Updating recommended if you are picking up Crafting Hysteresis mid-game and you're using this mod to convert vanilla bills to Crafting Hysteresis bills.
#28
Quote from: Plasmatic on October 22, 2016, 05:00:35 AM
JTExtendedPowerArmor
I updated (version 1.2) to include invisible texture that I missed. The line that adds the light is at JTExtendedPowerArmor\Defs\ThingDefs_Misc\Apparel_Hats_JT.xml , line 86:

<thingClass>JTExtendedPowerArmor.Apparel_SuperArmorHelmet_JT</thingClass>



Quote from: lashtear on October 22, 2016, 05:22:06 AM
JTReplaceWalls
Since the crash happens after the methods are replaced using CCL/RawCode's code, I think it could be my use of Reflection.
I've attached a special version which doesn't use Reflection and thus cannot compare the stuff of two things (marble walls can replace marble walls for no reason). Try using this version and please report whether it works or not.
In my recent attempt at another mod (JTBuildDiagonally), I did come across hanging when using Reflection, but the hang happened when I close the game or go to menu.

[attachment deleted by admin due to age]
#29
Quote from: OnlyMarvellous on October 20, 2016, 08:10:43 AM
Hey, Jamestec. I use a few of your mods and they are all well done. However, I did notice, in your Savage Prisoners (Psychology Compat), that you have Bleeding Heart as a nullifying trait for all of the thoughtdefs.
That was just for compatibility for Psychology, since when you use JTSavagePrisoners, it overrides ThoughDefs that Psychology has also made edits in; the BleedingHeart entry is the same entry made by Psychology.
The reason why Psychology put that as a nullifying trait is that there is an additional entry for BleedingHeart which makes it worse as shown in KnowGuestExecutedBleedingHeart:

  <ThoughtDef ParentName="DeathMemory">
    <defName>KnowGuestExecuted</defName>
    <durationDays>7.5</durationDays>
    <nullifyingTraits>
      <li>Psychopath</li>
      <li>Bloodlust</li>
      <li>BleedingHeart</li>
    </nullifyingTraits>
-snip-
 
  <ThoughtDef ParentName="DeathMemory">
    <defName>KnowGuestExecutedBleedingHeart</defName>
    <durationDays>9</durationDays>
    <requiredTraits>
      <li>BleedingHeart</li>
    </requiredTraits>
-snip-

If you were to remove BleedingHeart as a nullifying trait, you would get 2 different debuffs for the same thing.


Quote from: sulusdacor on October 20, 2016, 08:36:42 AM
hey looooove the copy bills mod. one of the small must have vanilla improvements =) thx for making this.

just wanted to ask do you plan on making it compatible with crafting hysteries mod?
Version 1.1 should already be compatible, Version 1.3 should convert vanilla bills into Crafting Hysteresis bills when pasting to help ease players into Crafting Hysteresis if adding that mod mid-way. I recommend getting at least Version 1.4 since that version fixes ingredients list pastes being linked together. The latest version is 1.5.
#30
Quote from: masterpain on October 19, 2016, 08:30:23 PM
I posted my output_log a few days ago and realized you probably didn't receive it because site wont let me post attachements.  So I'll post it here

Ok, so the problem is that you're using Crafting Hysteresis version 1.3 or lower and I compiled JTCopyBills with version 1.5. So if you update Crafting Hysteresis to 1.5, JTCopyBills will work fine; I checked whether updating Crafting Hysteresis from 1.3 to 1.5 is ok, and it is.
Don't forget to remove JTCopyBillsDebug and use the normal one.


Quote from: Wacoede on October 19, 2016, 10:04:32 PM
Any chance of getting Helmets added for the Powered power armor and Super armor with similar (improved) stats, maybe some psychic drone protection and a light for when they are in dark places

Yea sure, I can do that. I'll be copying the light stuff from Rikiki's MiningCo.: Mining helmet, which is available here: https://ludeon.com/forums/index.php?topic=14711.0

Edit: JTExtendedPowerArmor is updated to have helmets.