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

#16
In the first patch you mispelled the def name durign the declaration:

[defname = "SmokeleafJoint"]

instead of

[defName = "SmokeleafJoint"]

#17
ok, now i see, UsedThisTick() is also a method from Building_workTable. I guess is called every time someone use it, even if i can't find when this happen.

QuoteIf you can define the ThingClass for the workbench, you can make a derived class that does something like this:

I should define a new class and the thingclass of the workbench, yes, i can do that, but i prefer to have something a bit more reusable.

Quotethen adding a Harmony Postfix() should work:

ok, now i found the wiki page about that, sound interesting, but, since i would add a flag every time someone use a building and that flag come from a mod, would that be a heavy hit for performance?

EDIT: I'm really new to programming, i'm not truly aware of what i'm doing
#18
public virtual void UsedThisTick()
{
if (this.refuelableComp != null)
{
this.refuelableComp.Notify_UsedThisTick();
}
}


it's work just with workbench with refuleable component i guess from here
#19
If I recal it correctly (i'm on my phone rigjt now) usedThisTick () require that the building is flickable and mine isn't  :-\
#20
To be totaly honest, it would better if there is a way to determine exactly when a building is used, and not just reserved. It kind of get lit all alone like is haunted or something.

but for the time being i will fine with it
#21
 ;D ;D ;D

it's worked, thank you
#22
Help / Re: Check if a building is scheduled to be on
September 19, 2019, 01:26:34 PM
Thank You  ;D
#23
I'm new to modding and to c# and i find my self quite overwhelmed. I think it is a simple problem in reality but i wasn't able to figure it out and i'm quite ashamed from it, please be merciful, i'm new.

I tried a bit but i can't find how to define if the building is currently used for bill production or not. Can someone please help me?
#24
Help / Re: Check if a building is scheduled to be on
September 19, 2019, 07:14:44 AM
this.parent.getComp<CompSchedule>().intAllowed ?

I have just begin to modding rimworld, or i'm tring at least, and i'm stuck on find a way to define if a production building is currently used or not
#25
I wrote this for "We're all mad here", but i'm a dummy goat in coding...

Rainbeau, can you please tell me if it is fine?

using System;
using RimWorld;
using Verse;

namespace WAMH_Code
{
// Token: 0x02000005 RID: 5
public class ThoughtWorker_WAMH2 : ThoughtWorker
{
// Token: 0x06000005 RID: 5 RVA: 0x00002538 File Offset: 0x00001538
protected override ThoughtState CurrentStateInternal(Pawn p)
{
bool flag = p.story.traits.HasTrait(TraitDef.Named("Cannibal"));
ThoughtState result;
if (flag)
{
result = false;
}
else
{
bool flag2 = p.story.traits.HasTrait(TraitDef.Named("Kind"));
if (flag2)
{
result = false;
}
else
{
bool flag3 = p.story.traits.HasTrait(TraitDef.Named("BleedingHeart"));
if (flag3)
{
result = false;
}
else
{
bool flag4 = p.story.traits.HasTrait(TraitDef.Named("Psychopath"));
if (flag4)
{
result = true;
}
else
{
bool flag5 = !p.story.childhood.DisallowsTrait(TraitDef.Named("Cannibal"), 0) && (p.story.adulthood == null || !p.story.adulthood.DisallowsTrait(TraitDef.Named("Cannibal"), 0));
if (flag5)
{
float num = 1E-05f;
int level = p.skills.GetSkill(SkillDefOf.Social).Level;
num -= (float)level * 5E-07f;
bool starving = p.needs.food.Starving;
int num2 = 0;
bool flag6 = starving;
if (flag6)
{
num2 += 2;
}
bool flag7 = !starving;
if (flag7)
{
num2 += 10;
}
float statValue = StatExtension.GetStatValue(p, StatDefOf.MentalBreakThreshold, true);
bool flag8 = (float)num2 < statValue;
if (flag8)
{
num += 1E-05f;
}
else
{
bool flag9 = (float)num2 < statValue + 0.05f;
if (flag9)
{
num += 5E-06f;
}
else
{
bool flag10 = (float)num2 < 0.35f;
if (flag10)
{
num += 2.5E-06f;
}
else
{
bool flag11 = (float)num2 >= 0.65f;
if (flag11)
{
bool flag12 = (float)num2 < 0.9f;
if (flag12)
{
num -= 5E-06f;
}
else
{
num -= 1E-05f;
}
}
}
}
}
bool flag13 = p.story.traits.HasTrait(TraitDef.Named("Abrasive"));
if (flag13)
{
num += 2.5E-06f;
}
bool flag14 = p.story.traits.HasTrait(TraitDef.Named("Bloodlust"));
if (flag14)
{
num += 5E-06f;
}
bool flag15 = Rand.Value < num;
if (flag15)
{
string text = GenText.CapitalizeFirst(p.Name.ToStringShort) + Translator.Translate("WAMH.NewCannibal.Text");
Find.LetterStack.ReceiveLetter(Translator.Translate("WAMH.NewCannibal.Label"), text, LetterDefOf.NeutralEvent, p, null);
p.story.traits.GainTrait(new Trait(TraitDef.Named("Cannibal"), 0, true));
}
}
result = false;
}
}
}
}
return result;
}
}
}
#26
Excuse me, but is the WAMH mod still in development?
I would be very interested if the function that allows pawns to even become cannibals was added.
it's possible? is it scheduled?