[1.0] RIMMSqol - IG Modding, Pawn editing, Search, Pathfinding, Food rules, ...

Started by Razuhl, November 16, 2018, 09:51:53 PM

Previous topic - Next topic

PhantomFav

Quote from: Razuhl on December 17, 2019, 01:45:06 AM
What can be done depends on your actual goal. One meal a day should be a simple change to the human hunger rate(edit the human race's "race properties"). There is no need to exploit the bandaid(lower hunger at lower nutrition) that the developer put in to prevent people from starving even though food is available.

If that doesn't work you can activate the rule to "prevent people from eating better than simple meals unless they are starving or need a mood boost". Then restrict them to only fine or lavish meals and place some fine meals. That way you can test if the suggested rule would acomplish what you want.

The loss of nutrition by eating too early is not easily moddable. Changing the body size has to many unintended implications and changing the lifestage would affect multiple races. Might be ok for humans but isn't a solution for things like chicken.

Thank you my friend, that was exactly what I was looking for!

PhantomFav

Quote from: PhantomFav on January 15, 2020, 01:31:34 PM
Thank you my friend, that was exactly what I was looking for!

Nope sorry it doesn't work. There should be a new option called "prevent people from eating unless they are starving or need a mood boost"

Razuhl

Have you tested with the latest version where you can configure the threshold for starving in the rules? Because if that doesn't work a new rule won't either.

tile7

Hi.
Using your MOD mostly for patches and modifying Architect tab.
"Path avoid" lost submenus. I tried turning on Avoid designator refresh, and it works for some other mods submenus but still no submenu in path avoid.
Tried moving in the mod list both mod's, top, bottom, one after the other... nothing.
Any ideas?

Razuhl

Moin,

Path Avoid buttons won't work, no matter what you do. The mod has to change it's buttons to vanilla buttons and then they can be modded(via xml or rimmsqol).

tile7

Hi.
Contacted path avoid author.

"I'm creating buttons from Defs on a new DesignatorCategory. Can't get much more vanilla than that."

Tried both mods on 1.1.
Still the same. No submenu buttons for path avoid.

Razuhl

Path Avoid's author Vendan creates his designators in a custom designator category. However he does so using an argument in the designators constructor. That's not allowed in vanilla which is why he used a custom category. By defining multiple classes of the designator class, each hardwired with the attribute values that are used in the constructor, you create designators that are valid and can be used in the xml API. Making the custom code that is spawning buttons obsolete.

Kiame


Razuhl

I would make the class Designator_PathAvoid abstract since it doesn't function if initialized with just the empty constructor. The call to Initialize would be missing if it is used in the vanilla fashion. Then I would define classes for each designator like this:


public class Designator_PathAvoid_Normal extends Designator_PathAvoid {
    public Designator_PathAvoid_Normal() {
        Initialize(DefDatabase<PathAvoidDef>.GetNamed("PathAvoidNormal"));
    }
}

public class Designator_PathAvoid_Dislike extends Designator_PathAvoid {
    public Designator_PathAvoid_Dislike() {
        Initialize(DefDatabase<PathAvoidDef>.GetNamed("PathAvoidDislike"));
    }
}

...


Now your buttons can be used without a custom category in xml, which allows modding them(both through patching or rimmsqol).


<DesignationCategoryDef>
    <defName>Pathing</defName>
    <label>pathing</label>
    <description>Allows you to customize pathing</description>
    <order>0</order>
    <showPowerGrid>false</showPowerGrid>
    <specialDesignatorClasses>
      <li>PathAvoid.Designator_PathAvoid_Normal</li>
      <li>PathAvoid.Designator_PathAvoid_Dislike</li>
      ...
    </specialDesignatorClasses>
</DesignationCategoryDef>


The only thing missing from the custom category is the visibility of the preferred designator which is handled through GameRules.SetAllowDesignator(typeof(PathAvoid.Designator_PathAvoid_Preferred), false).

Kiame


Multistream

Exception in Verse.Window.InnerWindowOnGUI: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.MeditationFocusDef.EnablingThingsExplanation (Verse.Pawn pawn) [0x001fd] in <d243303f714d4dc48680ccaecd2f594e>:0
  at RimWorld.MeditationUtility.FocusTypeAvailableExplanation (Verse.Pawn pawn) [0x0004e] in <d243303f714d4dc48680ccaecd2f594e>:0
  at Verse.Pawn+<SpecialDisplayStats>d__237.MoveNext () [0x00212] in <d243303f714d4dc48680ccaecd2f594e>:0
  at RimWorld.StatsReportUtility+<StatsToDraw>d__24.MoveNext () [0x002e0] in <d243303f714d4dc48680ccaecd2f594e>:0
  at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () [0x0004e] in <351e49e2a5bf4fd6beabb458ce2255f3>:0
  at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x000db] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at RimWorld.StatsReportUtility.DrawStatsReport (UnityEngine.Rect rect, Verse.Thing thing) [0x00083] in <d243303f714d4dc48680ccaecd2f594e>:0
     - prefix RIMMSqol: Boolean RIMMSqol.DrawStatsReport_EditShortcut:Prefix(Rect rect, Thing thing)
  at Verse.Dialog_InfoCard.FillCard (UnityEngine.Rect cardRect) [0x00064] in <d243303f714d4dc48680ccaecd2f594e>:0
     - prefix OskarPotocki.VFECore: Boolean AnimalBehaviours.VanillaExpandedFramework_Dialog_InfoCard_FillCard_Patch:Prefix(Rect cardRect, Dialog_InfoCard __instance, Thing ___thing, InfoCardTab ___tab)
  at Verse.Dialog_InfoCard.DoWindowContents (UnityEngine.Rect inRect) [0x00288] in <d243303f714d4dc48680ccaecd2f594e>:0
  at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001f8] in <d243303f714d4dc48680ccaecd2f594e>:0
     - transpiler net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.RunloopExceptionHandler:Transpiler(IEnumerable`1 instructions)

nothing bad seems to happen though in game but I wanted to share the thing anyway. https://gist.github.com/idkman2021/c419ca8c548750d8a80616aa78a2cd0d
(the log file is truncated)

YoungMan

I am trying to found found a city but the button is not showing when clicking on my settlement in the world view
i have updated Rimmsqol to the latest version and i am only using that mod