Horrors Mod - How do I...?

Started by Viceroy, February 27, 2015, 05:48:36 AM

Previous topic - Next topic

Viceroy

Hey guys I am working very hard on the Horrors mod, and I have all kinds of goodies lined up. However there are a few issues I am struggling with and I hope that maybe someone can help me figure it out.

Issue 1:
HOW TO ORDER PAWNS TO BUILD THINGS.

I have had moderate success, I can place blueprints down and I figured out how to set the blueprint faction. The issue however comes when I want pawns to build it. When I try to issue a job via thinktree using this code in the custom JobGiver_ I made:

return new Job(JobDefOf.PlaceNoCostFrame, new TargetInfo(pawn2.Position))
{
locomotionUrgency = LocomotionUrgency.Sprint
};

The pawns don't do anything. Same for JobDefOf.FinishFrame.
Any insights?

Issue 2:
HOW TO ROT A DEAD PAWN TO DESSICATED INSTANTLY.

I am having trouble getting this one to work. Trying to get a CompRottable on a human pawn seems to give me a null point reference. I can't see a RottingUtility or something like that. So I am kinda confused. Also I can't find where the debug menu rot tool is. If I can find that then I can reverse engineer it probably.

Issue 3:
HOW TO GENERATE AND ACCESS A PERLIN FUNCTION.

I need to generate a perlin for the map. But everytime I do:

Perlin horrorPerlin = new Perlin(10, 5, 2, 4, Find.Map.WorldCoords.GetHashCode(), QualityMode.Medium);

public getPerlinValue(IntVec3 Pos)
{
       Log.Warning(horrorPerlin.GetValue(pawn.Position));
}


If I do that and call to get the perlin from say a JobGiver_ then I don't get any errors, but all the values I get are 0...

Thanks for reading guys/gals. Hope you can throw the stick in the right direction for me and help me out. I have so many horrible things I still want my Horrors to do, and only YOU can help bring untold suffering to the Rimworlds.


Dog goes moo!

RemingtonRyder

Hey Viceroy, I think that like siegers, they need to have an entry in their thinktree which does construction. That is, if I'm assuming right that you want a non-colonist faction to build on the map. :)

If you've already done this, then I don't know what it could be.

Viceroy

Yeah they have the thinktree node for building inside the squadbrain, but how the fuck do I actually get the squadbrain to issue build orders (not the blueprint placement.). Because it seems that they are stuck in either defending behaviour or assaulting behaviour.

Maybe the canSiege race(I think) tag has something to do with it? I am a little clueless atm.
Dog goes moo!

Tynan

Issue 3: For your perlin, you may need to play with the frequency. Mine are usually like frequency=0.01. Decompile some code that uses the perlin and try copying it.

Issue 1: For the building, I can't say exactly what's wrong. But, you shouldn't imagine the squadbrain as giving pawns orders like an RTS commander. It's not designed like that. The squadbrain's only interaction with pawns is to assign their Duty. This is specifically designed so the SquadBrain can focus on high-level intent and group activity, while pawns handle their own moment-to-moment action. It's the pawn himself who should take the build job from one of his ThinkNodes in his ThinkTree.

Issue 2: You can't rot pawns; they're not rottable. Corpses are rottable.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Viceroy

#4
Thank you so much for the reply Tynan. I love the game and modding it is such a pleasure.

Issue 1: Perhaps the pawns are for some reason incapable of construction. Could it be a manipulation they are missing when it comes to how their bodies are defined. Or because they are technically mechanoid? Maybe I'm just missing something. I must figure it out though so I'll keep trying.

Issue 2: Ah... That explains my... Difficulties.

Issue 3: Thanks for the tips, I'll definitely do that. See if I can get it to work the way I need.

Hopefully after I solve these three things I'll have something awesome to show for it.
And again thank you for the help. You're pretty damn decent to your community and I respect that.

And while I am at it... Is there a way to for instance make a poison ingredient and then when that ingredient is used in a meal. That it gives a malady to the pawn eating it, like a hediff of some illness for example?

Why I am asking is because the Horrors aren't always outright aggressive and it occurred to me that poisoning them might be a good way to fight them.

If this is currently impossible, would you consider adding a poison or /buff/ system to some ingredients in the future?
Dog goes moo!