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

Topics - Timber

#1
Hello!

I've got a mod from A7 that I can't load in the alpha 9 client and I can't figure out what's wrong with it.

Could maybe one of you modder wizards take a look?
http://www.mediafire.com/download/6xxwpb2y4dyp9wc/SimpleMedicineCraft.rar
#2
Help / Checking if a hopper has X resourses.
November 01, 2014, 10:09:43 PM
Hello,

I'm trying to make a building consume resources from a nearby hopper. I plan to butcher some of the nutrient dispenser code for this, specifically:


public Thing DispenseFood()
{
if (!this.CanDispenseNow)
{
return null;
}
int num = this.def.building.foodCostPerDispense;
if (Find.ResearchManager.IsFinished(ResearchProjectDef.Named("NutrientResynthesis")))
{
num--;
}
int num2 = 0;
List<ThingDef> list = new List<ThingDef>();
Thing foodInHopper = this.FoodInHopper;
do
{
int num3 = Mathf.Min(foodInHopper.stackCount, num);
num2 += num3;
list.Add(foodInHopper.def);
foodInHopper.SplitOff(num3);
if (num2 >= num)
{
break;
}
foodInHopper = this.FoodInHopper;
}
while (foodInHopper != null);
this.def.building.soundDispense.PlayOneShot(base.Position);
Meal meal = (Meal)ThingMaker.MakeThing(ThingDef.Named("MealNutrientPaste"), null);
foreach (ThingDef current in list)
{
meal.RegisterIngredient(current);
}
return meal;
}
while (foodInHopper != null);
this.def.building.soundDispense.PlayOneShot(base.Position);
Meal meal = (Meal)ThingMaker.MakeThing(ThingDef.Named("MealNutrientPaste"), null);
foreach (ThingDef current in list)
{
meal.RegisterIngredient(current);
}
return meal;

I'm just starting to learn C# (coming from Java) so I don't understand everything fully. Could someone walk me through what this bit does?


do
{
int num3 = Mathf.Min(foodInHopper.stackCount, num);
num2 += num3;
list.Add(foodInHopper.def);
foodInHopper.SplitOff(num3);
if (num2 >= num)
{
break;
}
foodInHopper = this.FoodInHopper;
}


Which will obviously require a method to check if there is food:


private Thing FoodInHopper
{
get
{
ThingDef thingDef = ThingDef.Named("Hopper");
foreach (IntVec3 current in GenAdj.AdjacentSquaresCardinal(this))
{
Thing thing = null;
Thing thing2 = null;
foreach (Thing current2 in Find.ThingGrid.ThingsAt(current))
{
if (current2.def.IsFood)
{
thing = current2;
}
if (current2.def == thingDef)
{
thing2 = current2;
}
}
if (thing != null && thing2 != null)
{
return thing;
}
}
return null;
}
}


My question is: how do I make the method look for specific resources like wood or cloth instead of food?
#3
General Discussion / What happened to wooden logs?
October 16, 2014, 09:30:58 PM
I seem to remember being able to craft walls out of wooden logs - no power and very flammable, but cheap as hell.
Now I can't seem to find it in the structure tab. Was it a mod I've installed and forgot about or was it removed from the game?
#4
Ideas / [UI] Trade window overhaul.
August 20, 2014, 03:58:01 PM
If you haven't seen it already here's the new trade UI Tynan has been working on:
http://www.reddit.com/r/RimWorld/comments/2dy7rl/traders_now_deal_in_and_carry_apparel_body_parts/cjuj0v8

Don't know about you but I'm a little disappointed. (Also not digging the dollar signs. Maybe use a unique symbol?)
I really dislike having to drag my mouse 5 - 15 times when trading just to select wanted quantity of goods.

I was hoping the new UI would alleviate that but it looks like we are stuck with same old line based layout.
What I would love to see is something akin Morrowind trading UI:
http://i.imgur.com/wXZrjoC.jpg

I understand that a lot of work has already been done on current system and a line based window is probably easier to code but I'll post my idea anyway:
http://i.imgur.com/5MfkAye.jpg
#5
General Discussion / Lets talk happiness modifiers!
March 29, 2014, 07:44:47 PM
Alpha 2 was released some time ago and with it came a period of great mental instability among colonists. Early game seems to be the hardest to get through in my experience. There has been lots of talk about what can be done to keep colonists happy and how it can be achieved in the most efficient way.

There seems to be lots of confusion about what the perfect bedroom should look like, what modifiers stack, what works on colonists during sleep, what a good kitchen layout should look like and so on.

If you have questions about how happiness works - drop a line! With this thread I would like to encourage you all to share your stories, designs and findings (with pictures) ! I know you efficiency maniacs are out there.
#6
General Discussion / Z-Index. Will it ever happen?
February 26, 2014, 07:38:38 PM
Some people around here don't think it's a terribly good idea and has no place in the game.
Personally I think it would add a whole new dimension of gameplay (pun totally intended).

I'd like to hear your thoughts and opinions.

Obviously an extra dimension would mean new technical challenges so if Tynan could shed some light on that subject that would be great.
#7
Mods / [REQUEST] Tools
February 26, 2014, 02:42:41 PM
Would be nice to have a mod that would allow crafting tools. Basically weapon replicas that boost certain skills:

Examples:
-drill, improves mining skill
-sheers, improve plant cutting skill