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

#1
Unfinished / Re: (WIP) Gradual Romance
March 07, 2020, 04:35:48 PM
QuoteJust a heads up there is an unofficial 1.1 version of psychology on the steam workshop now.
Yes I know I uploaded it originally. It looks like Kemper is taking over maintaining it.
I'm a little dissatisfied with Psychology, so I think I'm going to start a similar mod with my own changes.
I'll eventually merge GR's features with the new mod's.
#2
Fixed... kinda. I have to load Prepare Carefully, and apparently this issue is idiosyncratic to my build. So I'm not sure if anyone could help me anyway.
#3
When I try to open the debug menu with my manually updated version of Psychology, I receive the following error.

Exception filling window for Verse.ImmediateWindow: System.TypeLoadException: Could not resolve type with token 010000de (from typeref, class/assembly EdB.PrepareCarefully.CustomPawn, EdBPrepareCarefully, Version=1.0.16.0, Culture=neutral, PublicKeyToken=null)
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info(intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) [0x00000] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00002] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.MonoCustomAttrs.GetPseudoCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType) [0x0000a] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x0001f] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in <567df3e0919241ba98db88bec4c6696f>:0
  at System.Reflection.MonoMethod.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in <567df3e0919241ba98db88bec4c6696f>:0
  at Verse.GenAttribute.TryGetAttribute[T] (System.Reflection.MemberInfo memberInfo, T& customAttribute) [0x00000] in <df50c46ef3c74cec81344c2206c0de6f>:0
  at Verse.Dialog_DebugActionsMenu..ctor () [0x0003e] in <df50c46ef3c74cec81344c2206c0de6f>:0
  at Verse.DebugWindowsOpener.ToggleDebugActionsMenu () [0x0001c] in <df50c46ef3c74cec81344c2206c0de6f>:0
  at (wrapper dynamic-method) Verse.DebugWindowsOpener.DMD<DMD<DrawButtons_Patch0>?-810289920::DrawButtons_Patch0>(Verse.DebugWindowsOpener)
  at Verse.ImmediateWindow.DoWindowContents (UnityEngine.Rect inRect) [0x00000] in <df50c46ef3c74cec81344c2206c0de6f>:0
  at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x00165] in <df50c46ef3c74cec81344c2206c0de6f>:0
Verse.Log:Error(String, Boolean)
Verse.Window:InnerWindowOnGUI(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)


The only mods I have loaded are Hugslib and the version of Psychology I am currently updating, not Prepare Carefully. So it seems there is something strange going on.
Attached is a copy of the mod.
I have deleted any reference to EdBPrepareCarefully in Psychology, but still it seems to want to load a reference to it.

You can download a copy of the mod in question from my google drive: https://drive.google.com/file/d/1WhDUvcU9dFr-v9zBScODb5F5f3bkKJlw/view?usp=sharing
#4
Help / Harmony transpiler plus GUI, need help!
February 21, 2020, 06:50:59 PM
Hi, I'm trying to update Psychology to 1.1. I'm getting better at C#, but I'm still not comfortable with either GUI coding or using Harmony's transpilers. Unfortunately, the issue I have currently relates to both. Here is the relevant code:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RimWorld;
using Verse;
using Verse.Sound;
using HarmonyLib;
using UnityEngine;
using System.Reflection;
using System.Reflection.Emit;

namespace Psychology.Harmony
{
    [HarmonyPatch(typeof(CharacterCardUtility), nameof(CharacterCardUtility.DrawCharacterCard))]
    public static class CharacterCardUtility_ButtonPatch
    {
        [HarmonyTranspiler]
        public static IEnumerable<CodeInstruction> AddPsycheDisplay(IEnumerable<CodeInstruction> instr, ILGenerator gen)
        {
            int doNames = 0;
            foreach(CodeInstruction itr in instr)
            {
                yield return itr;
                if (itr.opcode == OpCodes.Call && itr.operand == typeof(CharacterCardUtility).GetMethod(nameof(CharacterCardUtility.DoNameInputRect)))
                {
                    doNames++;
                    if (doNames == 3)
                    {
                        yield return new CodeInstruction(OpCodes.Ldloc_S, 6);
                        yield return new CodeInstruction(OpCodes.Ldarg_1);
                        yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(CharacterCardUtility_ButtonPatch), "PsycheCardButton", new Type[] { typeof(Rect), typeof(Pawn) }));
                       
                    }
                   
                }
            }
        }

        [LogPerformance]
        public static void PsycheCardButton(Rect panelRect, Pawn pawn)
        {
            if(PsycheHelper.PsychologyEnabled(pawn))
            {
                Rect rect = new Rect(panelRect.xMax + 5f, 3f, 22f, 22f);
                Color old = GUI.color;
                if (rect.Contains(Event.current.mousePosition))
                {
                    GUI.color = new Color(0.97647f, 0.97647f, 0.97647f);
                }
                else
                {
                    GUI.color = new Color(0.623529f, 0.623529f, 0.623529f);
                }
                GUI.DrawTexture(rect, ContentFinder<Texture2D>.Get("Buttons/ButtonPsyche", true));
                if (Widgets.ButtonInvisible(rect, false))
                {
                    SoundDefOf.Tick_Low.PlayOneShotOnCamera(null);
                    Find.WindowStack.Add(new Dialog_ViewPsyche(pawn));
                }
                GUI.color = old;
            }
        }
    }
}


Currently, the character card draws the psyche button over the third name input rectangle, making it unclickable.
I think that the psyche button is being drawn before the third name input rectangle, though I'm very new to how GUIs and transpilers work.
#5
Unfinished / Re: (WIP) Gradual Romance
February 21, 2020, 04:35:02 PM
Quote from: PM_ME_NAKED_SINGULARITIES on February 21, 2020, 10:39:55 AM
Quote from: Nationality on February 21, 2020, 10:16:38 AM
A note to everyone: Because of the impending update to 1.1, a release is delayed until Psychology is updated. I've taken it upon myself to make an unofficial Psychology update to 1.1, and then I have to update GR to 1.1 after that.  :'(

Given how long it can take the author of Psychology to up date that could be a while :o

But I hope making your own patch isn't too difficult. Fortunately 1.1 seems to be the easiest version to update mods for in while. Well for most mods at least.

Also do you know what aspects conflict with RJW? I might take a stab at a patch. Although I'm still learning C and C#.
I've never tested RJW with GR, so I'm not sure.
There is some conceptual overlap between RJW and GR, especially in the internal builds, so making them work together will probably be quite a challenge.
#6
Unfinished / Re: (WIP) Gradual Romance
February 21, 2020, 10:16:38 AM
A note to everyone: Because of the impending update to 1.1, a release is delayed until Psychology is updated. I've taken it upon myself to make an unofficial Psychology update to 1.1, and then I have to update GR to 1.1 after that.  :'(
#7
Unfinished / Re: (WIP) Gradual Romance
February 21, 2020, 10:14:09 AM
Quote from: PM_ME_NAKED_SINGULARITIES on February 19, 2020, 07:12:59 PM
Also there is a similar message when highlighting bonded animals. Where GR spams an error log about trying to find the animals...uh.."attractiveness." Just a heads up. Also are you considering adding support for RJW? ;D
I've never gotten such a message, so I think that might be a mod compatibility thing. Are you using RJW? I know they do some hacky stuff with animals to get them to work... the way they want them to. That might explain it. Anyway, there's a brute-force fix but I don't think RJW users will like it.

As for supporting RJW... probably not. GR is partly born from my dissatisfaction with RJW, which I find to be silly and weird. That said, I don't object to people patching GR to support RJW. It just isn't worth the time for me.
#8
Unfinished / Re: (WIP) Gradual Romance
February 17, 2020, 02:42:14 AM
Quote from: PM_ME_NAKED_SINGULARITIES on February 16, 2020, 02:48:49 PM
Just heads up, the mod seems to be incompatible with android tiers. It throws these kinds of errors every tick: Exception while recalculating Pretty thought state for pawn Sean: System.NullReferenceException: Object reference not set to an instance of an object
at Gradual_Romance.Harmony.GRThoughtWorker_PrettyPatch.GRPrettyPatch (RimWorld.ThoughtState&,Verse.Pawn,Verse.Pawn) <0x000ff>
at (wrapper dynamic-method) RimWorld.ThoughtWorker_Pretty.CurrentSocialStateInternal_Patch2 (object,Verse.Pawn,Verse.Pawn) <0x00263>
at RimWorld.ThoughtWorker.CurrentSocialState (Verse.Pawn,Verse.Pawn) <0x00037>
at RimWorld.SituationalThoughtHandler.TryCreateSocialThought (RimWorld.ThoughtDef,Verse.Pawn) <0x000bd>

I don't know if that would be hard to patch. I hope not, and if there is a quick patch I can make locally any advice would be greatly appreciated! Super excited to see where this mod goes!

Thanks.
I think I know what the issue is, and it should be fixed for next version (which is taking a while!). That said, though I'd like androids to eventually be compatible, for right now, I don't think GR is compatible with any mod that adds androids. That's partly because Psychology natively has compatibility issues with androids, and you need to go into Psychology's source code to fix it.
#9
Unfinished / Re: (WIP) Gradual Romance
February 08, 2020, 11:27:25 AM
QuoteWill this mod include polyamory?

Polyamory is already included in Psychology, so yes.
#10
Unfinished / Re: (WIP) Gradual Romance
January 23, 2020, 04:49:03 AM
Quote from: ShadowRun on January 23, 2020, 02:09:26 AM
Just suggestion, how about make certain trait affect cheating chance. For example, kind and loyal trait has 100% chance will not cheating their partner (unrelated to mod: loyal also make the pawn won't leave the colony even under heavy mental break), easy-going trait that make the pawn won't mind their partner cheating but they also like to cheat or switch partner. Sorry for my bad english.

Yes, I agree. For example, the "Codependent" trait already reduces the chance of cheating to 0, and the new version will have a trait called "Traditional" which does the same thing but slightly differently. There is already a Polygamous trait which makes the pawn tolerate cheating, and "Adventurous", "Lecherous" and "Psychopathic" pawns are more likely to cheat to varying degrees.

Eventually, I'd also like Jealous pawns to react particularly poorly to cheating. They already do to some extent, I believe Polygamous and Jealous pawns still get jealousy thoughts if their lovers flirt with other people, though this has never actually happened in any of my test games so I'm not sure if it actually works.
#11
Unfinished / Re: (WIP) Gradual Romance
January 20, 2020, 09:59:50 PM
Quote from: MengDe on January 19, 2020, 06:30:10 PM
I've been using this mod and so far conceptually is *chef kiss*, I'm eagerly waiting for the still-missing features.
Sometimes I see small things like "Sent debug label: blah blah blah"

I've been wondering, is there any specific behaviour you'd like people to report?

Appreciate it. For right now, I just want to make sure things are working okay and nothing absurd happens. I don't really much time right now for long-term testing, and because GR really excels for long playthroughs, I appreciate hearing that it's stable long-term.

The next update is relatively complex, and I had to learn a lot of new programming concepts and internal Rimworld mechanics, which is why things are taking a while. I should be able to release something relatively soon.
#12
Unfinished / Re: (WIP) Gradual Romance
December 23, 2019, 01:55:27 AM
QuoteSince not all people use Birds and Bees mod, does this mean that if it is dependency, then this mod cannot be used? Is it possible to make just an add-on to the mod that uses this dependency, then at least we can play with the main mod without Birds and Bees mod?

I mean, yes, I would like that, but it would require a pretty complicated patch, and I'm not sure I'm good enough a programmer to do that. It would be much easier just to start off with Birds and Bees, and I already have Psychology as a dependency, so why not?

I will give it the old college try to not require Birds and Bees, but we'll see.
#13
Unfinished / Re: (WIP) Gradual Romance
December 21, 2019, 10:43:48 PM
New Update. Most of the changes are internal. You probably won't notice much - Attraction values are now precalculated and stored, recalculating after a certain amount of time has passed. This might result in some odd behavior once in a while, but I think the eventual performance boost is worth it. It will definitely come in handy if people start making GR submods with ridiculously complicated attraction factors.
The chances of a memory leak are definitely real, however, so let me know if you experience slowdown after a long gameplay session.

Another thing: I've been thinking about making Birds and Bees a dependency. I think a lot of people who would use this mod would also use Birds and Bees, and there's a lot of interesting things I could do with Birds and Bees. It would certainly save me from writing an overly complicated compatibility patch. What do you guys think?
#14
Unfinished / Re: (WIP) Gradual Romance
December 17, 2019, 03:57:58 PM
Updated with caveat that I probably broke something - unfortunately a lot of the new features are hard to arrange without a long gameplay session. So a lot of things haven't been tested properly... I'll have to do this over time. Please back up your saves -- and probably back up the mod -- before loading.

CHANGELOG
-- New relationship types: Steady, Suitor, Flame, and Darling.
  -- Steady is the first level of the logical tension type.
  -- Suitor is the second level of the logical tension type.
  -- Flame is like Paramour, except that there's only sexual tension.
  -- Darling is like Paramour, except that there's only romantic tension.
-- Informal relationships can now decay. If two pawns have not flirted in a while, there is a base 25% chance per day that it will decay, eroding into nothing. The decay chance can be defined in the settings.
-- If two pawns are in a formal relationship and haven't flirted in a while, they can start "feeling neglected". Pawns that feel neglected are much more likely to break up with their partners.
-- If a pawn sees their significant other flirting with someone else, they can get jealous. Jealous pawns are much more likely to break up with their partners.
-- There is no longer a 100% chance that pawns will give up their informal relationships after getting a new partner.
-- Revised age attraction calculations. There is no longer an "age difference" factor. Pawns are either too young or too old.
-- Attraction by age curves have been replaced with maturity curves. Pawns have a "maturity rating" between 0 and 3. Pawns prefer partners who are slightly younger or the same maturity as they are, and their tolerance of maturity difference grows with... maturity. This automatically scales with xeno humanoid races.
-- Revised how xenos are auto-patched. This should result in more accurate maturity curves, provided the mod author has defined logical life stages.
-- The kinsey formula can now be set by gender. You can make most men gay and most women straight, if you wanted, or women bisexual and men lean straight, or whatever.
-- Similarly, you can define a kinsey formula for xeno races.
-- You can define how common xeno romance is - making it impossible, restricting it only to xenophiles, restricting it only from xenophobes, or setting it to "Captain Kirk" (which gets rid of attraction penalties due to alien races)
-- Homophobic pawns now hate gay people... and hate themselves too if they are gay.
-- Superficial people hate themselves if they are ugly or disfigured.
-- Blind people are not affected by beauty or scars (which aren't implemented yet anyway). Deaf people don't care about someone's voice or creepy breathing.
-- Melodic voice is a new trait. It is the opposite of Annoying voice.
-- The base disfigured opinion penalty has been dramatically reduced.
-- The facial attractiveness feature has been permanently withdrawn.

NEXT MAJOR UPDATE
-- Seduction, lovin' outside of bed, cheating.
-- Full implementation of Aromantic, Hopeless, Shy, and Seductive traits.
#15
Unfinished / Re: (WIP) Gradual Romance
December 07, 2019, 12:42:47 PM
Quote from: Kori on December 07, 2019, 07:06:45 AM
That sounds interesting!
Can you put it on the workshop, please?
Eventually!
I'd like it to reach a stable state before I do that. There is too great a chance for me to break save compatibility with each new update.
As soon as I'm confident that I won't break saves, I'll upload it.