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

#121
Help / Re: C# modding help with Rimworld structure
January 29, 2018, 10:09:05 AM
Thank you very much! The code for point 2. was exactly how I assumed, except for the one-product-output thing. Never realized there could be multiple outputs from crafting (though I cannot think of an in-game example right now).

I think it's enough to go on and take a closer look on what I want to do now. Later on I'll research how to get all available production tables (or types of production tables) on the map, provided there is an easy way to do it.

Thank you again! :)
#122
Help / Re: C# modding help with Rimworld structure
January 28, 2018, 04:59:59 AM
Unfortunately I'm not having much luck with this. Can anyone help with some answers to the questions from the first post? :(
#123
Help / Re: Optimizations of frequently called checks
January 27, 2018, 01:48:31 PM
You should ask the author of Harmony, but, as I understand it, every time a method like GetGizmo gets called, that has a post-execution harmony patch attached, this patch will always get called. And, most likely, that method gets called for every object (on the map?), or as you move the viewpoint.

Sorry for not really being of much help :) just barely started with Rimworld C# modding.
#124
Help / Re: Some traits don't have a TraitDef
January 26, 2018, 05:49:11 AM
Is it possible to avoid capitalization issues somehow? Like getting the XML value, converting it to uppercase, then comparing with this string?

I guess there should be an extension to TraitDef that provides/takes an uppercase output of the trait's name.
#125
Quote from: Walking Problem on January 25, 2018, 03:56:25 AM
Quote from: crusader2010 on January 25, 2018, 03:52:11 AM
Hi. A quick question: is it possible to add, for WildAnimalSex, an option to disable mating for boomrats and boomalopes? (i.e. they won't reproduce, at all, unless they are tamed).

So you want a "middle option" between this 2 mods? =x

Basically yes :) and I love having options (they are the best thing programming can offer to a "customer", in my opinion).
The ultimate goal is to have more animal diversity and not just "booms" all over the map.
#126
Help / Re: C# modding help with Rimworld structure
January 25, 2018, 04:16:25 AM
Thanks for the answer! I do have a plan for at least 60-70% of what I want to do, this is why I want to keep it to a bare minimum for now. I know starting efficiency is a common developer trap, but having a double FOR loop to search in two seemingly large lists is something that I don't really like from the start (and leads me to think that there might be a better way to do it) :D

Looking over the code again, it seems that IsWeapon and IsApparel are the right way to go (at least for now), as I don't really care whether the weapons are melee or ranged (I want to create something dynamic, as much as possible). Now I just need to figure out how to get to the recipes and the items themselves. Then, most likely, there will be a list of <something> that should contain all the stats... or a few such lists if there are stat categories involved.

Regarding the quality/material, I do not want to think about it for now (just to keep things simple enough). When I get a better understanding of the structure, it will probably be easy to modify the code accordingly.

I did find something of interest (but for later down the road) : the ApparelLayers and ApparelProperties classes that will provide some of the stats about an item that I want to show. Also, by looking at the way the trading window is created, I might be able to create a crude version of what I need (using rectangles and widgets it seems).

Well, gonna look further and see what I find. Any help is appreciated :)

PS: found some stats in the methods "DoTable_WeaponsRanged" and "DoTablesInternal_Apparel" and "DoTablesInternal_Melee". These seem to be the links to the XMLs.
#127
Hi. A quick question: is it possible to add, for WildAnimalSex, an option to disable mating for boomrats and boomalopes? (i.e. they won't reproduce, at all, unless they are tamed).
#128
Help / C# modding help with Rimworld structure
January 24, 2018, 12:37:54 PM
Hello,

I just started looking into how to mod Rimworld (decompiled the assembly, set up the programming environment + GIT, etc), but I need some help with understanding the inner structure of the code.

For now, my goal is the following: getting all the available buildable recipes for weapons and apparel (only), getting the stats of each of these items, then making a menu and displaying them there.

1. What mod do you suggest I take a look at that adds a new menu and is not very complicated?

2. How do I get a list of all the weapon&apparel recipes that are available to build at a certain point in the game (i.e. when the player clicks on the menu)?

Regarding this, I found a list that contains all of the Defs from the game, in the DefDatabase class:
DefDatabase<ThingDef>.AllDefsListForReading

In other methods I saw an iteration over each element of this list, and for that each element there seems to exist a list of recipes:

for (int i = 0; i < thingDefs.Count; i++)
{
    foreach (RecipeDef x in thingDefs[i].recipes)
    {
      //do something
    }
}


Questions: 

  • Is this the most efficient way to get all of the recipes?
  • How can you tell if a recipe is for a weapon/armor and not something else? There is a "IsWeapon" (also "IsApparel") property but it is under ThingDef. Should I first filter the defs using this property and then get the recipes?
  • In the DefDatabase class there is also a method called "AddAllInMods()" - do I need to call this method before checking for recipes, or is it called/cached when the game starts (or similar) ? I want to get all the recipes, not just the vanilla ones.
  • What does the property "AvailableNow" actually mean for instances of RecipeDef? Whether or not the recipe is suspended in the production table? If it's available to be built according to the technologies researched? Something else?

3. How do I get from a recipe to the item itself (even if not actually built), then to the item's stats (e.g. short accuracy, damage, burst shot count, blunt protection, social chat impact, etc ?

4. Is it possible to limit the recipes found above only to those that can be built (i.e. there are production tables on the map)?

Sorry for all the questions... just trying to understand the base structure of the code (and not being very successful)  :-X

Thanks
#129
Releases / Re: [B18] A RimWorld of Magic
January 21, 2018, 02:00:12 PM
Hello again :) it seems there is a very small bug with showing information in the Food tab of the minions.
Also, they have "Medicine" preselected instead of "herbal medicine" like other animals have.

Can this be fixed?

[attachment deleted by admin: too old]
#130
DefensivePositions does a bit of what you want  (will remember pawns manning mortars/guns). The changing apparel task is cumbersome and that's why I only keep them in military gear :) also, I always keep animals out of the way of kill-zones/raiders/similar stuff.
#131
How would you merge tailoring and smithing? If I have 2 smelters and 3 tailoring benches, which should go first? Based on what (what is more important for me as a player)?

PS: just saw there are some jobs related to animals under "Doctor", even feeding an animal. Probably they should get moved to handling.
#132
Releases / Re: [B18] A RimWorld of Magic
January 21, 2018, 07:22:01 AM
@Torann: thank you for the info :)
#133
Hello,

I'm looking for a mod that allows for keeping visitors in your medical beds until they get properly healed, plus allowing you to feed them wherever they are on the map. Should be compatible with Hospitality.

Here's what happened: a visitor came that had an addiction problem. While moving around the colony he collapsed from withdrawl. I rescued him and tried to cure his addiction, but the moment he could move (even if extremely slowly), the visitor wanted to exit the map. Of course he collapsed again somewhere away from my base and died from malnutrition (didn't care to rescue him again).

This is what I want a mod for: prevent visitors from leaving medical beds until they get cured of possible illnesses that can cause loss of motor functions. Also, the ability to feed a collapsed visitor no matter where he is on the map.

Thanks
#134
Hi,

There are three QOL features I would really like to have:

1. Make it clear, for each clothing item, also from any of the crafting benches (by mousing over the recipe), what layer it covers (OnSkin, Middle, Shell, Overhead, FullHead etc). There is a mod that did it for the tailoring bench (it categorized the clothing items into the body parts they cover and, on mousing over a recipe, it showed all of the stats - %armors, layer, body parts covered, stats). I would very much like a way to generalize this and make it mod-independent (i.e. to show this information no matter what items are added to your game, regardless of the crafting bench).

2. Similar to 1., but for weapons. For example, showing only stats like [range, damage, number of shots, cooldown, warmup, accuracies] is enough. They should show up for every crafting station and all weapons.

3. An item comparison tool. This is going to be rather complex, but extremely useful. As a general guideline:
Clothing:

  • - Clothing can be firstly filtered by the quality (just like in vanilla Rimworld - using a slider);
  • - Clothing can be secondly filtered by the body parts they cover (multiple checkboxes);
  • - Clothing can be thirdly filtered by the layer of skin it covers (multiple checkboxes);
  • - Should have added support for mods like "Infused" - a simple checkbox to include/exclude infused items;
  • - "Infused" items should have all of their stats counted in;
  • - Each stat an item can have should be able to be ticked on/off of the comparison list, thus including/excluding items that have that stat;
  • - The comparison list should allow for multiple column ordering.

Weapons:

  • - Weapons can be firstly filtered by the quality (using a slider);
  • - Weapons can be secondly filtered by their range (melee, short, medium, long) - by 4 checkboxes (maybe even allow players to configure these ranges, except melee);
  • - Weapons can be thirdly filtered by shooting multiple bullets with one burst or only one (by two checkboxes);
  • - Should have added support for mods like "Infused" - a simple checkbox to include/exclude infused items;
  • - "Infused" items should have all of their stats counted in;
  • - The comparison list should allow for multiple column ordering.

Special feature:

  • - The comparison tool should allow for the selection of a pawn in one side of the window, then allow you to preview the values of the pawn's stats by simply clicking on gear items. Basically a preview window where you can see how the pawn will look like and what stats he/she is going to have with the selected gear.
  • - Must definitely include information about which [body parts + layers] remained unprotected by the selected gear.

If someone wants to begin this project, I can draft a picture of how the comparison window could look like (if needed).

Thanks!
#135
Mods / Re: [Mod Request] Finish what you started.
January 20, 2018, 05:42:22 PM
+10000 :)

Pawn stupidity remover mod is a must.