Various modding questions and answers

Started by ItchyFlea, February 19, 2014, 07:40:33 PM

Previous topic - Next topic

ItchyFlea

Could you post the <ThingDef> code you've used for the simple door you added on Feb 25th?
Or is this something that won't be available until Alpha 3?

My attempts at an unpowered wood door break the colonists when they try to use it.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Rokiyo

How openly can we talk about the contents of Assembly-CSharp.dll and techniques to read it?

Architect

Marvelous, in that case I think I'll wait until alpha 3 and some of the people who know what they're doing have started making a crack at proper mods before I dive in and maybe ask for a bit of advice :) In the mean time I'll stick to the basic modding support that's in now.
Check out BetterPower+ and all its derivatives by clicking the picture below.

It adds many new methods of power generation and uses for it, as well as other things such as incidents.


Tynan

You won't be able to make simple doors until A3; I had to modify some core code to do it.

Quote from: Rokiyo on February 27, 2014, 06:11:53 PM
How openly can we talk about the contents of Assembly-CSharp.dll and techniques to read it?

Completely.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Rokiyo

Awesome, thanks. Might post something about it when I get home then.

In the meantime, for anyone keen to get stuck in, you might want to Google "ILSpy"

Hexxagon

Hey Tynan, just a little modding question; what code-editing program do you use?

Tynan

Quote from: Hexxagon on February 28, 2014, 02:59:55 PM
Hey Tynan, just a little modding question; what code-editing program do you use?

Visual Studio 2012.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Haplo

Is it possible to add a new resource to the standard traders without copying the full trader definition?
I ask because I'd like to add some metal bars as a resource to the traders, but don't want them to be overwritten with some other mod and I'd also like to prevent an update when the standard traders are changed in future versions.
Is what I want even possible right now?

Tynan

No; I'll need to refactor the way traders choose what they carry so they don't explicitly list each item.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Haplo

Ok, thanks for the fast answer.
That means that there will not be a trader for my stuff anytime soon.
Good enough. :)

harpo99999

tynan, any idea when the traders will be able to buy/sell the berrys and agave foods as well as the potatos?

zngga

I am trying to add cooking stove recipes that only use specific types of raw meat, like a muffalo burger for example, what I have doesn't give any errors, but when I select it in game only potatoes are in the ingredients list.

here is what I have so far:

        <RecipeDef>
<defName>CookMealMuffaBurger</defName>
<label>Cook Muffalo Burgers</label>
<description>Cooks a Muffalo Burger between Potato bread buns.</description>
<jobString>Cooking MuffaBurgers.</jobString>
<workAmount>100</workAmount>
<workTimeSkillNeed>CookTime</workTimeSkillNeed>
<ingredients>
<li>
<filter>
<thingDefs>
<li>Muffalo_Meat</li>
</thingDefs>
</filter>
<count>1</count>
<filter>
<thingDefs>
<li>RawPotatoes</li>
</thingDefs>
</filter>
<count>3</count>
</li>
</ingredients>
<products>
<li>
<thingDef>MealMuffaBurger</thingDef>
<count>1</count>
</li>
</products>
<parentIngredientFilter>
<thingDefs>
<li>Muffalo_Meat</li>
<li>RawPotatoes</li>
</thingDefs>
</parentIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Muffalo_Meat</li>
<li>RawPotatoes</li>
</thingDefs>
</defaultIngredientFilter>
<skillRequirements>
<li>
<skill>Cooking</skill>
<minLevel>3</minLevel>
</li>
</skillRequirements>
</RecipeDef>


Is it possible to reference specific meats at this time, or just the meat category?

Architect

Quote from: harpo99999 on February 28, 2014, 05:04:08 PM
tynan, any idea when the traders will be able to buy/sell the berrys and agave foods as well as the potatos?
I've got a mod for that for my own personal use if you want me to PM you with it?
Check out BetterPower+ and all its derivatives by clicking the picture below.

It adds many new methods of power generation and uses for it, as well as other things such as incidents.


Tynan

One <li> is one list item, but you've got two filters in one, so the second is overriding the first.

Try this:


<ingredients>
<li>
<filter>
<thingDefs>
<li>Muffalo_Meat</li>
</thingDefs>
</filter>
<count>1</count>
</li><li>
<filter>
<thingDefs>
<li>RawPotatoes</li>
</thingDefs>
</filter>
<count>3</count>
</li>
</ingredients>
Tynan Sylvester - @TynanSylvester - Tynan's Blog

zngga

Thanks for the quick reply Tynan. I tried what you suggested, and no change. On other recipes I am able to have two filters in one <li> and it works fine (agave & potatoes, potatoes & berries, etc) but I changed them all to one filter per list.

Here is the updated:
                <ingredients>
<li>
<filter>
<thingDefs>
<li>Muffalo_Meat</li>
</thingDefs>
</filter>
<count>1</count>
</li>
<li>
<filter>
<thingDefs>
<li>RawPotatoes</li>
</thingDefs>
</filter>
<count>3</count>
</li>
</ingredients>
<products>
<li>
<thingDef>MealMuffaBurger</thingDef>
<count>1</count>
</li>
</products>
<parentIngredientFilter>
<thingDefs>
<li>Muffalo_Meat</li>
<li>RawPotatoes</li>
</thingDefs>
</parentIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Muffalo_Meat</li>
<li>RawPotatoes</li>
</thingDefs>
</defaultIngredientFilter>

but it still doesn't work. All I see in game is potatoes as an available ingredient.