Ludeon Forums

Ludeon Forums

  • October 07, 2022, 01:02:56 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

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.

Topics - Fluffy (l2032)

Pages: 1 [2] 3
16
Help / [A13 and Assets loading]
« on: April 08, 2016, 03:43:53 AM »
The following is a breakdown from what others and I have found when trying to use textures in .dlls. This is by no means final information, as there's quite a few oddities going on that we don't understand. I'll try and keep this thread updated with new developments.

See also my bug report here.

Code: [Select]
definitely_not_fluffy [09:30]
ok so here's the breakdown

[09:30]
mods are loaded in a separate thread

[09:31]
which means any 'assets' (textures, sounds, materials, etc) won't load correctly

[09:31]
you get a vague 'couldn't find it' error, which is very misleading

[09:31]
there's theoretically two solutions

[09:32]
the first, and prefered solution is to put a [StaticConstructorOnStartup] attribute above any classes that have static resources defined in them

[09:32]
that ​_should_​ cause them to be loaded in hte main thread, before anything else

[09:32]
this doesn't actually appear to work however

[09:33]
the seond solution is to somehow defer loading of textures until after the main mod loading phase is complete

[09:33]
again, there's two ways

[09:33]
the first is to call LongEventHandler.ExecuteWhenFinished( Action ) in the constructor

[09:34]
if the mod is loaded in the asynchchronous thread, your action is then queued to be executed on the main thread after mod loading is complete

[09:34]
this works for me, but appears not to work for some others

[09:34]
the final solution is to not load textures at all until you need them

[09:34]
e.g. do an if (texture ==null) loadTexture kind of thing in the Draw() method (or something similar).

[09:35]
that's a bit risky, since if it fails, it'll keep failing very noisily

[09:35]
but the approach should work

And a little more background info from Ison through Skullywag on how it's supposed to work:
Code: [Select]
skullywag [11:59]
added a C# snippet
This happens because from now on mods are loaded in a different thread. This, combined with the fact that it's impossible to use Unity's functions like loading a texture in threads other than the main one, means that you get an error in such cases. Does your new class have any static resources like Texture, Material or Graphic? If so, it means that during loading the game, when an object of this class is loaded, its static constructor is called and the game tries to load a texture in a different thread. With StaticConstructorOnStartup attribute, class' static constructor is called in the main thread before loading everything else.
Add Comment
skullywag [12:00]
he also said this, which might mean something to you guys:
skullywag [12:00]
added a C# snippet
Making those Material fields non-static doesn't work, because they are instantiated from a different thread during loading an instance of Building_WindTurbineStuffed. You can also schedule a task to be executed from the main thread after the loading has finished like this: LongEventHandler.ExecuteWhenFinished(() => DoSomething()); but in your case you should just use static fields and [StaticConstructorOnStartup].
Add Comment
skullywag [12:01]
and heres the bit about the game laoding thingy
skullywag [12:01]
added a C# snippet
It's because static constructor is called only once when a class is first used, so it won't be called again until you restart the game. If a class is first used during gameplay (e.g. you build a wind turbine), then wind turbine's textures are loaded in the main thread so everything's fine, but if it's first used during loading (e.g. you try to load an instance of a wind turbine), then it throws errors because it tries to load a texture from a different thread.
Add Comment
definitely_not_fluffy [12:01]
that is actually an entrance point for bootstrapping right there, isn't it?
[12:02]
if we can set code to be run on main thread, we can get to gameobjects and everything
skullywag [12:02]
mebbe
[12:02]
like i said it might mean more to you guys than me (edited)
definitely_not_fluffy [12:02]
this is really good info to have, thanks!

17
Bugs / [StaticConstructorOnStartup] does not appear to work correctly
« on: April 07, 2016, 04:08:25 PM »
Steps to reproduce:
  • Create a mod with an assembly, add classes that contain static assets (textures, etc)
  • Add the [StaticConstructorOnStartup] tag
  • Try to use ContentFinder<>.Get() in the constructor
I've used the following snippet of code to obtain some test results; the rest of the class/mod can be found here: https://github.com/Karel-Kroeze/RW_Blueprints/

Code: [Select]
using RimWorld;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
using Verse;


namespace Blueprints
{
    [StaticConstructorOnStartup]
    public class Designator_CreateBlueprint : Designator
    {
        #region Public Constructors


        public Designator_CreateBlueprint()
        {
            Log.Error( "INSTANTIATING NOW:\n" + System.Environment.StackTrace );
            Log.Message( "Types with static constructors:" );
            foreach ( var type in GenTypes.AllTypesWithAttribute<StaticConstructorOnStartup>() )
            {
                Log.Message( "\t" + type.FullName );
            }


            LongEventHandler.ExecuteWhenFinished( delegate
            {
                Resources.Icon_AddBlueprint = ContentFinder<Texture2D>.Get( "Icons/AddBlueprint", true );
                Resources.Icon_Blueprint = ContentFinder<Texture2D>.Get( "Icons/Blueprint", true );
                Resources.Icon_Edit = ContentFinder<Texture2D>.Get( "Icons/Edit", true );


                icon = Resources.Icon_AddBlueprint;
            } );


            defaultLabel = "Fluffy.Blueprints.Create".Translate();
            defaultDesc = "Fluffy.Blueprints.CreateHelp".Translate();
            useMouseIcon = true;
        }


        #endregion Public Constructors


// more code.
}
}
Note that the LongEventHandler.ExecuteWhenFinished call does work, and circumvents the issue.


The attached output log highlights the issue. The game is clearly aware that this type (and a few others) should have a static constructor, yet the stack trace shows that it is still instantiated from a secondary thread.

[attachment deleted by admin - too old]

18
Off-Topic / Shellfish Advertising!
« on: February 23, 2016, 02:09:40 AM »
clams! oysters! Get them here straight outta the sea!  Shrimp, lobster, crayfish, and crabs! Fresh as can be!

19
Bugs / Float menu option dropped on multi column
« on: February 16, 2016, 06:33:38 PM »
When the float menu options get wrapped over multiple columns, there is one too many option rendered in each column, resulting in an option being drawn outside of the floatmenu rect, and thus dropped.

The following line in Verse.FloatMenu.DoWindowContents( Rect ) ;

Code: [Select]
if ((double) num1 > (double) this.ColumnMaxOptionCount)Where num1 is the current y or row index (decompilation artifact) should instead read;
Code: [Select]
if ((double) num1 >= (double) this.ColumnMaxOptionCount)
Also, why are two ints geting cast to doubles for a comparison? That seems like a recipe for trouble in and of itself.


20
Bugs / Alpacas cannot reproduce [ nevermind, I didn't dig deep enough ]
« on: January 31, 2016, 02:40:33 PM »
Alpacas are missing the <litterSize> tag, and hence cannot reproduce.

21
Bugs / Modded keybindings are not re-bindable
« on: January 23, 2016, 03:51:11 PM »
Keybindings added through keybindingdefs in mods can not be changed from their default - the old key is de-registered, but the new key is not registered, options do show the correct key but they do not work in-game. If the keybinding is changed back to the original keybinding (manually or with the reset button) it works again.






22
New KeyBindingDefs using a vanilla KeyBindingCategoryDef create their own 'tab' in the keybinding options.

This def:
Code: [Select]
<?xml version="1.0" encoding="utf-8" ?>

<KeyBindingDefs>

  <!-- In-game camera -->
 
  <KeyBindingDef Name="GameKeyBinding" Abstract="true">
    <category>Game</category>
  </KeyBindingDef>

  <KeyBindingDef ParentName="GameKeyBinding">
    <defName>FollowSelected</defName>
    <label>follow</label>
    <defaultKeyCodeA>ScrollLock</defaultKeyCodeA>
  </KeyBindingDef>

</KeyBindingDefs>

Gives this result in the option screen;



23
Outdated / [A14] Colony Manager
« on: November 18, 2015, 06:20:55 PM »

Production Jobs

  • Assign 'global' bills, that will be assigned to workstations by your manager(s).
  • Set start/stop conditions with the aid of a trigger.
  • Select which workstations bills should be assigned to by area and/or count, or select specific workstations.
  • Quickly add jobs for ingredients in complex production chains
Hunting jobs

Set a target for meat, and never worry about designating hunting manually again!


Forestry jobs

Set a target for wood, and never worry about designating lumber manually again!


Livestock jobs
(I had a fancy gif prepared, but I seem to have lost it. Really.)

Set a target for animals (for four separate age/sex combinations), and pawns will auto-butcher and/or tame to manage your herd.
Restrict animals to specific areas (for example to separate male/female animals and prevent breeding).
Auto-butcher, tame and train according to your specifications.


Overview

  • Clear overview of all jobs
  • Show stock levels for the last day, month and year
  • Show pawns capable of a job, and set work status
  • Prioritize jobs, the manager will handle prioritizing jobs on worktables

Import & Export

Import & export jobs between colonies, or share them with others!
Will likely throw at least a few errors when different mods are loaded - always back up your save before importing jobs from another world


How does it work?
  • You can manually set bills in the new Manager tab on the bottom of the screen. Once set, a colonist with the manager skill and worktype enabled will go to a manager station to figure out the best way to hand out jobs to individual workstations
  • Periodically, the manager will check if the assigned bills are still up-to-date, and make changes or delete bills where required
  • The manager will not touch bills that are set manually
  • In theory there is no real limit to the number of global bills that can be set.


  • Requires a new save. Adds a worktype, which in my tests gave errors on old savegames.
  • Should work perfectly fine with other mods that add bills, assuming they do nothing too fancy/weird. (I've tested, and the screengrabs were taken, with the Mod Variety Pack which adds a good number of recipes.)


  • Skills display on the colonist info pane gets cut off when using EdB Interface. This is an issue with EdB interface.


Latest release | all releases | GitHub repository



  • Power/Electricity tab
    • At a glance overview of current/past power consumption and battery efficiency.[\li]
      • Order pawns to shut down services when power is dangerously low
    • More interactions and jobs for manager work type.
      • Inspirational speeches
      • Stern talking to for a job poorly done
      • More ideas? (the goal is to add more social options, where appropriate with good/bad thought modifiers, or work speed modifiers if I can make that work.
    • Open to suggestions!

Code: [Select]
0.14.0.0 - Initial release for A14
0.13.0.1 - Initial release for A13
A12.3.6 - added foraging tab, clear area option, and fixed a few bugs - should be save compatible.
A12.3.5 - small tweaks to training and forestry jobs.
A12.3.1 - Power tab, AI manager, new History scribe format. Version bump, NOT SAVE COMPATIBLE.
A12d.2a - Livestock tab, multi-resource graphs, fixed greater than triggers, allow switching recipes on production jobs, and many small tweaks.
A12d.2 - Massive overhaul!
A12d.1a - resource count fixed, added max skill toggle for minWorkSkill option of bill
A12d.1 - initial release


The license for all my mods can be found here.

24
Outdated / [A12d] Colony Manager
« on: October 04, 2015, 09:20:29 AM »


  • Assign 'global' bills, that will be assigned to workstations by your manager(s).
  • Set start/stop conditions with the aid of a trigger.
  • Select which workstations bills should be assigned to by area and/or count, or select specific workstations.

How does it work?
  • You can manually set bills in the new Manager tab on the bottom of the screen. Once set, a colonist with the manager skill and worktype enabled will go to a manager station to figure out the best way to hand out jobs to individual workstations
  • Periodically, the manager will check if the assigned bills are still up-to-date, and make changes or delete bills where required
  • The manager will not touch bills that are set manually
  • In theory there is no real limit to the number of global bills that can be set, but there is still a limit per workstation.


  • Regard this as an advanced beta version. I've spent over a week ironing out bugs from the first working version. I feel it's ready for a public release, but at the same time I know there's probably bugs that I won't catch without user feedback and many different playthroughs/playstyles.
  • Requires a new save. Adds a worktype, which in my tests gave errors on old savegames.
  • Should work perfectly fine with other mods that add bills, assuming they do nothing too fancy/weird.



  • Skills display on the colonist info pane gets cut off when using EdB Interface. This is an issue with EdB interface.
  • I'm not sure what happens when the manager assigns bills to a workstation that can take no more bills, expect better handling of such cases in future updates.
  • No 'load balancing' is currently done, the manager does not care how many bills a workstation has. Expect better load balancing in future updates.



Latest release | all releases | GitHub repository



  • Enhanced AI on bill assignment, load balancing, edge cases.
  • More interactions and jobs for manager work type.
    • Inspirational speeches
    • Stern talking to for a job poorly done
    • More ideas? (the goal is to add more social options, where appropriate with good/bad thought modifiers, or work speed modifiers if I can make that work.
  • AutoHuntBeacon functionality integrated as a new manager 'module' (i.e. the button in the top left of the tab will let you switch).
  • 'Behaviour' as a new manager module;
    • Set recruit/medical care settings on prisoners based on their attributes
    • Assign colonists to specific areas under certain conditions (raids, events)
  • Open to suggestions!



Code: [Select]
A12d.1a - resource count fixed, added max skill toggle for minWorkSkill option of bill
A12d.1 - initial release


The license for all my mods can be found here.

25
Releases / [1.0][MODLIST] Fluffy's Mods - New mini-mod: Power Cleaner [BETA]
« on: September 14, 2015, 06:16:45 AM »
Fluffy's Mods
[1.0]Animal Tab v4.7 (Aug 8th) Adds extra functionality to the Animals tab
[1.0]Area Unlocker v3.14 (Aug 8th) Removes the (arbitrary) limit to the number of areas you can create
[1.0]Backup Power v1.10 (Aug 8th) add control units to generators to automatically switch them on and off when needed
[1.0]The Birds and the Bees v3.8 (Aug 10th) Adds reproductive organs to the animals
[1.0]Blueprints v2.17 (Aug 10th) Blueprints allow the quick construction of repetitive rooms/areas
[1.0]Colony Manager v4.32 (Aug 28th) Colony Manager allows you to make colonists do the more tedious parts of managing a colony
[1.0]Command Palette v1.8 (Aug 9th) all your commands in one place
[1.0]Desire Paths v0.8 (Aug 24th) Creates packed dirt paths when colonists frequently take the same path
[1.0]Fluffy Breakdowns v4.4 (Aug 10th) Replaces random breakdowns with a maintenance requirement
[1.0]Follow Me v4.8 (Aug 10th) Gives the camera tracking capabilities
[1.0]Medical Tab v3.4 (Aug 10th) Adds a comprehensive medical overview tab
[1.0]Mod Manager v3.8 (Sep 5th) Managing mods should be easy!
[1.0]Pharmacist v2.9 (Aug 10th) Not all injuries are equal
[1.0]Relations Tab v2.6 (Aug 10th) Replaces the faction tab with a relations tab
[1.0]Research Tree v3.17 (Jun 9th) A better research tree
[1.0]Shit Rimworld Says v2.3 (Aug 10th) adds quotes from /r/ShitRimWorldSays to RimWorld loading screens
[1.0]Stuffed Floors v2.7 (Aug 10th) Allows building floors out of stuff*
[1.0]Work Tab v3.21 (Aug 10th) Provides a vastly more customizable work tab

Legend:
: Steam Workshop page
: All old & new versions
: Bugs & Suggestions

You can find my outdated & obsolete mods, as well as my other projects, on GitHub

Changenotes:
Code: [Select]
2020-09-05 22:09 :: ModManager :: Fluffy :: fix requirements showing as unment when mod manager was closed and re-opened
2020-09-05 22:09 :: ModManager :: Fluffy :: fix warning about static texture loading in FluffyUI
2020-09-05 21:09 :: ModManager :: Fluffy :: fix error on non-xml files in modlist dir
2020-09-05 21:09 :: ModManager :: Fluffy :: remove survey popup
2020-08-31 09:08 :: ModManager :: Han Yaodong :: Update Chinese translation for v3.7.1004 (1.2.2723) (#128)
2020-08-30 23:08 :: ModManager :: Proxyer :: Update Japanese Translation for v3.5.996 (#127)
2020-08-30 11:08 :: ModManager :: Fluffy :: minor refactor of filename sanitizing, add more debug info
2020-08-19 00:08 :: ModManager :: Fluffy :: re-implement updating local copies from steam source
2020-08-19 00:08 :: ModManager :: Fluffy :: add steam links for original mod & author to local copies
2020-08-18 22:08 :: ModManager :: Fluffy :: check if userdata exists before trying to copy it
2020-08-18 21:08 :: ModManager :: Fluffy :: fix possible nullref in Incompatible.get_Resolvers
2020-08-18 21:08 :: ModManager :: Fluffy :: fix key error in auto-sort
2020-08-18 20:08 :: ModManager :: Proxyer :: Update Japanese Translation for v3.4.966 (#123)
2020-08-16 00:08 :: ModManager :: Fluffy :: properly cache Dependency.Target
2020-08-16 00:08 :: ModManager :: Fluffy :: cache relevant issue list
2020-08-15 22:08 :: ModManager :: Fluffy :: copy user data when copying/moving mod
2020-08-15 00:08 :: ModManager :: Fluffy :: fix user data storage
2020-08-14 22:08 :: ModManager :: Fluffy :: give local copies unique packageId's, handle comparing them
2020-08-11 22:08 :: ModManager :: Fluffy :: fix nullref in manifest.notify_recache
2020-08-09 12:08 :: CommandPalette :: Fluffy :: allow changing amount of recent widgets displayed
2020-08-09 12:08 :: CommandPalette :: Fluffy :: close palette when keybinding is pressed while open
2020-08-09 12:08 :: CommandPalette :: Fluffy :: update for 1.2
2020-08-09 12:08 :: CommandPalette :: Fluffy :: allow opening with selection with setting. closes #6
2020-08-08 11:08 :: BackupPower :: Fluffy :: add 1.2 updates into 1.1
2020-08-08 11:08 :: BackupPower :: Fluffy :: add run on batteries toggle
2020-08-08 00:08 :: BackupPower :: Fluffy :: build last release for 1.1
2020-08-08 00:08 :: BackupPower :: Fluffy :: lower research cost change prerequisite to electricity
2020-08-07 21:08 :: AnimalTab :: Fluffy :: update .gitignore
2020-08-05 23:08 :: DesirePaths :: Fluffy :: add path width growth
2020-08-05 22:08 :: DesirePaths :: Fluffy :: add defModExtension for changing desirePath settings per terrain
2020-08-05 21:08 :: DesirePaths :: Fluffy :: add old news to vcs
2020-08-04 20:08 :: DesirePaths :: Proxyer :: Japanese Translation
2020-05-23 11:05 :: BackupPower :: Fluffy :: additional nullcheck in PowerNet.StorageLevel
2020-05-22 23:05 :: ColonyManager :: Fluffy :: create read-only list for enumerating in ManagerJob_Livestock.DoFollowSettings
2020-05-22 22:05 :: ColonyManager :: Fluffy :: ignore borrowed animals
2020-05-22 22:05 :: ColonyManager :: Fluffy :: fix 'ew job'
2020-05-22 21:05 :: ColonyManager :: Fluffy :: add support for animals without gender by treating everything non-male as female.
2020-05-22 21:05 :: ColonyManager :: Fluffy :: make history labels translatable
2020-05-22 21:05 :: ColonyManager :: Fluffy :: add some null checks for possible weird modded plants
2020-05-22 15:05 :: BackupPower :: Fluffy :: allow turning backups off when excess would be zero
2020-05-22 14:05 :: BackupPower :: Fluffy :: add battery widget
2020-05-18 23:05 :: WorkTab :: Fluffy :: add priority labels for all priorities
2020-05-18 23:05 :: ModManager :: Han Yaodong :: Update Chinese Translation for v2.11.893 (#91)
2020-05-18 23:05 :: FollowMe :: Proxyer :: Pull request: Update Japanese Translation for v4.5.90 (#29)
2020-05-18 23:05 :: Blueprints :: Proxyer :: Update Japanese Translation for v2.15.128 (#30)
2020-05-18 22:05 :: WorkTab :: Fluffy :: add a bunch of checks for pawns without mood need
2020-05-15 22:05 :: CommandPalette :: Fluffy :: another attempt at fixing duped key errors in designator by category caching
2020-05-14 20:05 :: CommandPalette :: Fluffy :: fix duplicate key error in designator init
2020-05-05 22:05 :: ShitRimWorldSays :: Fluffy :: add tips on main menu
2020-05-05 14:05 :: ShitRimWorldSays :: Fluffy :: update preview image
2020-05-05 10:05 :: BackupPower :: Fluffy :: fix: building control box no longer removes generator (doh)
2020-05-05 10:05 :: BackupPower :: Fluffy :: fix reinitializing control boxes on game load
2020-05-05 10:05 :: BackupPower :: Fluffy :: fix: building control box no longer removes generator (doh)
2020-05-04 22:05 :: BackupPower :: Fluffy :: try to recover more gracefully from failure state
2020-05-04 20:05 :: CommandPalette :: Fluffy :: update preview
2020-05-04 19:05 :: MedicalTab :: Fluffy :: new preview image
2020-05-04 14:05 :: BackupPower :: Fluffy :: remove last traces of Harmony requirement
2020-05-04 11:05 :: BackupPower :: Fluffy :: add minimum on time to stop flickering
2020-05-02 08:05 :: DesirePaths :: Fluffy :: fix: turn paths overlay off by default
2020-05-02 01:05 :: DesirePaths :: Fluffy :: add path density overlay
2020-05-01 22:05 :: DesirePaths :: Fluffy :: tweak snow clearance rate, add stone smoothing
2020-04-30 23:04 :: Blueprints :: Fluffy :: add new files to source. doh
2020-04-30 22:04 :: Blueprints :: Fluffy :: add quick copy blueprint
2020-04-29 00:04 :: CommandPalette :: Fluffy :: make number of rows/columns configurable
2020-04-28 23:04 :: AreaUnlocker :: Fluffy :: fix: copy area now works again
2020-04-28 23:04 :: AnimalTab :: Han Yaodong :: Add Chinese translation (#53)
2020-04-28 11:04 :: FollowMe :: Fluffy :: switch to using better keybinding widget
2020-04-28 11:04 :: FollowMe :: Fluffy :: add configurable keybind for cinematic camera
2020-04-28 10:04 :: CommandPalette :: Fluffy :: deps: update BetterKeybinding dependency
2020-04-27 23:04 :: ModManager :: Fluffy :: fix crosspromotion preview path
2020-04-27 22:04 :: AnimalTab :: Fluffy :: fix sorting by handler
2020-04-27 22:04 :: AnimalTab :: Fluffy :: fix follow checkboxes not registering
2020-04-27 :: AnimalTab :: Fluffy :: remove duplicate age column
2020-04-27 :: CommandPalette :: Fluffy :: remove focus from search when selection is made
2020-04-27 :: AnimalTab :: Fluffy :: allow checkbox dragging
2020-04-27 :: CommandPalette :: Fluffy :: add configurable keybinding
2020-04-27 :: AnimalTab :: Fluffy :: add toggle for higher contrast checkboxes
2020-04-25 :: CommandPalette :: Fluffy :: add toggle for opening architect, hide disallowed commands from recent list, set default scale to 100%
2020-04-25 :: CommandPalette :: Fluffy :: add null check for similarity
2020-04-25 :: CommandPalette :: Fluffy :: update desciption, fix nullref in equality comparer
2020-04-24 :: DesirePaths :: Fluffy :: remove debug cell flashing, pawns standing still don't trample earth (almost), remove snow where pawns walk
2020-04-24 :: DesirePaths :: Fluffy :: more frequent smaller updates to dirt paths
2020-04-24 :: DesirePaths :: Fluffy :: actuall set default values for settings
2020-04-23 :: StuffedFloors :: Fluffy :: Add German translation (thanks to Erdnussbrot)'
2020-04-23 :: BirdsAndBees :: Han Yaodong :: Update Chinese translation for v3.6.55 (#28)'
2020-04-23 :: WorkTab :: Téo Bouttier :: French translation (#135)'
2020-04-23 :: BirdsAndBees :: gast :: Traditional Chinese (#27)'


26
Outdated / [A12d][GUI] ResearchInfo
« on: September 13, 2015, 07:31:05 PM »
    Adds a little clarity to the research tab, mostly for those who use lots of mods. Example with Ultimate Overhaul loaded;


Features
  • Adds an "All" tab to research window, does what it says on the tin. (A little bit too well - it shows a dirty trick modders use, I'll fix that asap).
  • Adds prerequisties and leads to overview to research description.

(Compatibility) issues
  • No compatibility issues.
  • Doesn't add or store anything other than GUI, completely save compatible.
  • "All" tab can show researches it shouldn't (These are intentionally unobtainable to hide buildings, a modder trick), will get rid of these tomorrow.

License

Attribution 4.0 International (CC BY 4.0)

Made specifically for modpacks, feel free to grab and use it!

P.S. Dear mods, I'll create a "Fluffy's small mods" thread tomorrow and get rid of some of the clutter, sorry :P.[/list]

27
Help / accessing an internal / private method / field.
« on: September 13, 2015, 05:19:44 PM »
I would like to access a pawn (animals) currently completed training steps. The code used in core is in Pawn_TrainingTracker.GetSteps(TrainableDef), however this method is marked internal, the steps field used to track training is marked private.

Any ideas on how to access these? I've fiddled with reflection but can't get it to work (probably my lack of expertise), and I'ld like to avoid using a custom Pawn class and rewriting and overriding all the training code...

P.S. Tynan, why is this method marked internal to begin with? All the other methods in the class are public...

28
Outdated / [A12d] Animal ranged verb unlocker
« on: September 13, 2015, 10:23:14 AM »
Opens the door to animals using ranged weapons.

This is a demo mod, it adds a shotgun attack to the Thrumbo. I'm sure someone can use it to make a lovely laser-shooting raptor: https://ludeon.com/forums/index.php?topic=16037.msg170766#msg170766

I've tested briefly, and it seems to work. I have not tried Combat Realisms' verbs.

Get it here;
https://github.com/Karel-Kroeze/RW_AnimalRangedVerbsUnlocker

License

Attribution 4.0 International (CC BY 4.0)

29
Outdated / [A13] [GUI] Enhanced Tabs || NEW WORK TAB BETA!
« on: September 07, 2015, 07:15:05 PM »

Work Tab

  • Sorting by average skill for a job. Select the best Pawn for the job!
  • Copy/Paste functionality for priorities.
  • Increase/decrease priority of a job for all colonists.
  • Drag jobs on/off in the simplified view.
  • Change overall priority of worktypes (e.g. cooking, animal handling) and workgivers (e.g. shearing, milking, taming).

Animals Tab

  • Gender and lifestage icons on the animals tab. Easily keep track of your chickenfarm!
  • Butchery and training designation right from the animals tab.
  • Filter animals by race, gender, reproductive ability, training, milkable, shearable, pregnacy and old age.
  • Sort by name, gender, lifestage/age, and bodysize (meat).
  • Rename (named) pets. Don't like the name Buttercup for your Warg? Change it!
How does it work?
  • Everything has a tooltip, and should hopefully be a smooth enhancement of the core experience.
  • Click on column headers to sort by that column, click again to reverse order.
  • Headers on designator columns (butchery and training) can be shift-clicked to (un)designate all animals in the list.
  • Race filters are a simple toggle, either show a race or not. Attribute have three states, ignore the attribute, select only animals with this attribute, or exclude animals with this attribute. All filters can be mixed and matched.
  • Work priority copy button copies the pawn's work priorities, ignoring jobs he's incapable of. Clicking the paste button on another pawn pastes the original pawns settings over, leaving priorities that the original pawn was incapable of untouched.
  • Shift-clicking job headers increments priorities by one (left click), or decrements them (right click). In the simple view, repeated clicks toggle the jobs.
  • In the simple view, you can now drag over jobs to enable them (left mouse button), or disable them (right mouse button).
  • The priorities detail window (found in the work tab) allows you to reorder priorities. These global priorities are still affected by pawn specific work priorities, and some jobs always take precedence ("emergency" jobs, e.g. fire extinguishing).


  • Entirely save compatible, although you may get a single warning when adding to an ongoing game. This does not affect the mod or the save game.
  • Incompatible with other mods that change the work or animals tab (e.g. EdB's Interface and Wivex's Work Presets) - in so far as only one can be shown. If you prefer another mod's tab, simply load it after this one. As long as it respects namespaces (it should!), both should work fine.
    • For example, if you prefer Wivex's Work Presets work view, but also want to have my animals tab, load my mod first, and then Wivex's.
    • If you want the Pawnbar that EdB's interface provides, but want my tabs, load EdB first, then my mod. I intend to allow filtering by Squad for people who have EdB's interface enabled so that you can seamlessly use my tabs with squadron support, once that mod hits a stable state.
  • Will likely break with mods that introduce genders other than male, female or other. (I'm not aware of any, which is - quite frankly - a sad state of affairs.)
  • I've tried to gracefully fail with animals that have more than three life stages (will show a questionmark, but again, not aware of any core or modded animals that have more than three.)


  • External changes to the pawn list aren't immediately reflected - the pawn list will update every 5 seconds.
  • I've only had very little time to test - expect some obscure bugs, and please report them through the github issue tracker.


Latest release | all releases | GitHub repository

There's also a BETA version available of the next version of the work tab;
download | overview (youtube)



Latta - Help with reflection to make the training progress indicators work, translation support, Korean translation.



Code: [Select]
0.13.0.1 - Updated for A13.
A12d.5e - Slightly improved tooltips in priority changer window.
A12d.5d - Fixed some outstanding issues; periodic updates of the pawn list to track external changes, allow clicking to work in the simple view.
A12d.5c - Settings are now properly saved when the mod is enabled/updated in existing games.
A12d.5b - Tooltip for priority reset button.
A12d.5a - Change worktype and workgiver priorities.
A12d.4h - Added old and pregnant filters, general refactoring and code cleanup.
A12d.4g - Added vanilla sort option. Right click the name column header to sort the work tab in the same way as the restrictions and outfit tabs.
A12d.4f - Added sticky filter dialog option, when enabled the filter window will always open with the animals tab, and remember it's location.
A12d.4e - Training progress indicators (yay!), translatable strings, translation to Korean. All credits got to Latta.
A12d.4d - Correct fix for mass training designator.
A12d.4c - Faulty fix for mass training designator.
A12d.4b - Training designator, milk and wool filters.
A12d.4a - Mass slaughter, quick filter.
A12d.4 - Filter functionality.
A12d.3a - New (core) icons for copy/paste, sort by gender now sorts by pawnkind first.
A12d.3 - Work tab stuff (order, copy/paste, column ops)
A12d.2 - added slaughter (and rename? can't remember)
A12d.1 - initial release


The license for all my mods can be found here.

30


    Domestic Cats
    • Maine Coon, and the miniature version based of my own lovely kitten, Cara.
    • European Shorthair, Tuxedo variety, thanks to AshbornK9, Lokidemon and Gallows.
    • British Shorthair, suggested by Batpeter.
    • Norwegian Forest Cat, thanks to Merlin, and her owner LadyAth.
    • Siamese, inspired by RolandDeschain's kitten, https://instagram.com/meowcifer_kaleidoscope/, and based on textures kindly donated by Lokidemon

    Wild Cats
    • Lion, textures kindly provided by Lokidemon
    • Tiger

    Legendary Cats
    • Feenix, legendary feline-Phoenix hybrid that needs fire to survive. Appears with an incident, very much like a Thrumbo. He survives by burning matter for sustenance, and is likely to start fires. Can be tamed, but be prepared to deal with his unique life cycle. Textures by Lokidemon
    • Icicat, legendary cat icicle that radiates cold wherever it goes. Appears with an incident, and is slightly more docile than the Feenix. Textures by Lokidemon

    Other Stuff
    • Cat BehaviourTM; cats will need to sharpen their claws, will sleep wherever they please (any surface/bed - does not interfere with pawns/normal colony work), and from time to time will go absolute bonkers and run around like crazy.
    • Cat Food, a processed food source for carnivorous animals. 20 catfood can be made from 10 meat and 10 plant material, due to an exorbitant amount of artificial additives the result is more nutritious than the input. Colonists will hate eating it, your meat supply will thank you!
    • Feeding bowl, a small bowl for providing your cats with strategically placed food supplies.
    • Scratching pole, a place for your cats to sharpen their claws. Build one or more to stop your catch scratching up the furniture.



    • Lokidemon - Textures on the Lion, Siamese, Feenix and Icicat.
    • Also a huge thanks to everyone on the RimWorld modding slack for valuable feedback, support, and pointing out my obvious mistakes.



    More wild cats, definitely no more legendary cats - you reading this loki?, crude cat hunting behaviour.



    Mods that modify the base Cooker and Butchery station will likely remove the recipe for cat food. Let me know if/when this occurs and I'll look into it!



    Lion sounds are a bit sparse and rough around the edges.
    Feenix will cause lag if enclosed in a space without any reachable fires or flammable things.
    Cats are unaware of other cats when they decide where to sleep, if two cats choose the same spot, they will overlap. I call it a feature, because it's kindof cute.



    Latest release | All releases | GitHub repository



    The license for all of my mods can be found here.



    [/list]
    Code: [Select]
    A12d_9c - Feenix and Icicat are now a lot tougher (double the health, added armor). Lowered volume of cat calls (hurt, angry and death sounds are unaffected).
    A12d_9b - Lions and Tigers now spawn in the wild (Arid shrubland and Tropical rainforests respectively).
    A12d_9a - Fixed Icicat to no longer die of hypothermia.
    v12d_9 - Icicat, slight tweaks to cat sleeping AI, new naming scheme.
    v0.8 - Cat Behaviour[sup][size=6pt]TM[/size][/sup]
    v0.7 - Feenix!
    v0.6 - Tigers added, female lion texture added. Feeding bowls and scratching poles added.
    v0.5 - Cat food added. Lions spawn in the wild.
    v0.4 - Siamese and Lion added.
    v0.3 - British Shorthair and Norwegian Forest Cat added, verified working with 12c (not that anything changed).
    v0.2 - European Shorthair added. Tweaked purring sound, slightly increased move speed and wildness, slightly reduced petness for all cats.
    v0.1 - initial release[/list]

    Pages: 1 [2] 3