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

#1
Help / Re: How to have a different out of fuel icon
July 28, 2017, 04:10:00 AM
After a few days of trying, not sure if I am getting this, please enlighten me a bit more.
I am a total newbie, probably some more details a long the way.

I suppose it was creating 3 dictionaries, the if statement is checking whether a predefined OverlayTypes enum is in there or not, else it would add a new Thing paring OverlayTypes.
So, the goal here is to pass Thing(Chemfuel) and a new OverlayTypes(OutOfChemfuel) into the dictionary from else statement, Correct?

Bitwise | would result the enum name and the matching OverlayTypes called overlayType.
However, I still don't understand how the actual graphics should be path linked in here.
I saw there's the MaterialPool class that would source graphics from the ShaderDatabase.
The next step is to add a new line in static OverlayDrawer() ?

Should I create an entire OverlayDrawer Class if that's the case?

besides the custom compRefuel, a compProperty is also needed to use in XML correct?

thx for the help.

#2
Great guide! totally, good for newbies like me.

btw, the example file still hasn't been fixed, that missing "/".

Also, for this guide particularly, I did all this on a Mac.
Just to try out how the recently ported VS works.
Didn't encounter any problem so far, I even used the built-in decompiler to inspect assembly.
Visual Studio for Mac requires Mono 5.0 and higher, so no .NET3.5.
#3
Help / Re: How to have a different out of fuel icon
July 24, 2017, 12:52:00 AM
Hi, I know this is a old thread, but as I am trying to learn how to do the exact same thing, I suppose there's no point to start a new topic.

Since I cloned the original CompRefuelable and change all names to CompRefuelableChem while creating a new method in this class with everything identical to DrawOverlay.

I don't understand how vanilla graphics are bind to this method and the way to adjust it.
        public void DrawOverlay(Thing t, OverlayTypes overlayType)
        {
            if (OverlayDrawer.overlaysToDraw.ContainsKey(t))
            {
                Dictionary<Thing, OverlayTypes> dictionary;
                Dictionary<Thing, OverlayTypes> expr_17 = dictionary = OverlayDrawer.overlaysToDraw;
                OverlayTypes overlayTypes = dictionary[t];
                expr_17[t] = (overlayTypes | overlayType);

            }
            else
            {
                OverlayDrawer.overlaysToDraw.Add(t, overlayType);
            }
        }

Could anyone possibly explain it more into details to me.
particularly why it is using a bitwise operator?
Thank you.
#4
Outdated / Re: [A17] Vegetable Garden [7/3/17]
July 22, 2017, 08:49:07 AM
Hi, I recently came across your mod and made a few short runs out of it.
Thank you very much for the effort.

Just want to report sort of a bug I found.
The item Bread has two spoil time.
I think that's because in Items_meals.xml, Bread is inheriting VG_MealRottable which already uses class CompProperties_Rottable for allowing rotten , but adding another will simply add one more line of spoil time.

[attachment deleted by admin due to age]
#5
I misunderstood the use of <specialFiltersToDisallow>
To disallow certain ingredients or categories of ingredients, simply add <exceptedThingDefs> or <exceptedCategories> within <fixedIngredientFilter>
To learn what categories are available, look into ThingCategories.xml in the Core folder.

Hi all,
I am new to Rimworld modding and coding.
While I was trying to create a practice mod which goal is to add a vegan meal has all similar characteristics of simple meal, I couldn't find a way to get rid of the Allowed Ingredients Menu Categories.(not sure if that's the name)

<fixedIngredientFilter>
  <specialFiltersToDisallow>
    <li>AllowRotten</li>
  </specialFiltersToDisallow>
</fixedIngredientFilter>

This will get rid of the Allow rotten option in the menu.
I know the recipe after is defined in the <ingredients> tag, but I would still like to remove Meat listing.
I tried <li>AllowMeatRaw</li> but doesn't work.

[attachment deleted by admin due to age]