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

#1
TL;DR : Do you want to help me make a technology restriction mod for playing medieval/fantasy setting?

Hi,

I'm slowly getting back into Rimworld playing and modding after about 1.5 year hiatus. I love the idea of playing Rimworld in a medieval/fantasy setting but always get disappointed when suddenly a mechanoid cluster with inferno turrets arrives (HEY! DIDN'T I DISABLE THOSE??). Or when rewards from a quest include [SUPER HIGHTECH DOOMSDAY WEAPON], [LASER CUTTING MEGA BLASTER EYE BIONIC] etc. You know what I mean...
While there are a lot of magnificent mods that add content, few mods restrict futuristic events, rewards, gear and such. And none of those (I've tried) fix it all.

So, I'm looking for some collaborators in making a mod that restricts the world to medieval technologies, meant to be used in conjunction with mods that adds the content the player wants. While the intention is not to add a ton of new appropriate content, other mods can do that, my idea is to rewrite/retexture some vanilla aspects/items to fit in with this fantasy vibe. Some events and items will be cut out completely.

Still doing some def research and working on a to-do list, but here are some spontaneous ideas:
* Rewrite royalty faction to be medieval in technology level. This includes reworking some royalty specific gear to get more in line with the concept.
* Rewrite events (sometimes only changing texture and descriptive text), rework ancient dangers/shrines/temples whatever (undead guarding loot??).
* Remove all advanced items from faction pawns, traders and quest rewards. Add in medieval rewards from vanilla and patch in items from curated mods. Rewrite artifacts/high tier items/serums to be more fantasy-friendly ( healer mech serum -> healing serum)
* Remove mechanoids faction and events.
* Re-balance insect spawning (they can be pretty OP when trying to destroy 70 of them with clubs and swords), with alternative option to remove them altogether.
* Rewrite description of some world conditions (psychic drone for instance)

So, who's in?

Also any suggestions from the community are much appreciated. Share your experiences running medieval playthroughs. And any input from mod makers about approach and pitfalls is also golden.

Raise your sword, stand tall, destroy your enemies
//Distman (of Ministry Of MOM)

#2
I'm having problem with my colonists starting a party that never ends. While this is very realistic, it's devastating for the future of my colony.

It's most likely due to a mod bug. Getting a "Object reference not set to an instance of an object
" somewhere in Verse.AI.Group.Lord

Is there any way to force a party to stop using DEV tools? You can start one but...

Thanks in advance,
Distman
#3
Help / Apparel not ticking when worn
July 30, 2017, 08:13:10 PM
So, another ticking problem...

I have a piece of apparel with a custom comp. Ticking fine when it lays on the ground but stops when equipped. I guess the apparel thing is actually despawned when worn, therefor the ticker stops?

Any ideas how i can get the comp to keep ticking when worn? Also, as far as i see there's no way to add a comp to, for instance a pawn, on the fly (add same comp to pawn when worn, remove comp when apparel is de-equipped)?

Thanks for any input.
/Distman
#4
By default the mentalstate FireStartingSpree is something that only happens to your colonists (and your prisoners). This is set by the <colonistsOnly>true tag. I tried making a version of it with <colonistsOnly>false, but alas, hostiles still not starting any fires. The mentalstate itself is applied as it should on raiders (seen in the pawn info box in bottom left corner), but all they do is wander randomly.

I see no constricting lines of code in JobGiver_FireStartingSpree nor MentalState_FireStartingSpree. It's almost like nonplayers pawns have a variable that forbids them to start fires (which isn't true since they can ignite walls and stuff when raiding).

Any ideas?

/Distman
#5
Help / ThingComp not ticking
July 29, 2017, 05:43:03 PM
I have a custom ThingComp class with the CompTick() function overridden.
But it does not tick... Nor does CompTickRare()

public override void CompTick()
        {
            Messages.Message("Ticking...", MessageSound.Silent);
        }


Am i missing something? Any ideas?

Also, why do i see base.CompTick() or base.Tick() sometimes inside tick functions? What does it do?
#6
Adds gas traps and gas shells for mortars.
Mortar gas clouds are slightly larger.

Gas trap releases a cloud of gas when any pawn hostile to your faction walks too close. Severity builds up as long as a pawn is in the gas.

Gases types available:
Toxic
Sleep
Fear
Rage
Tear gas
Corrosive

Requires IEDBomb research to build.

Non-steam download: https://www.dropbox.com/s/beqc32u3kypcwsw/GasTrap_v09.zip

V0.9
Updated for Beta 19. Also introducing my most horrible creation yet: the corrosive gas trap/shell... Let's barbeque!

V0.8
Gas shells for mortars. Fart at a distance, why not!? Insect traps removed.

V0.726
Updated for beta 18. Slight buff to gas severity and duration.

V0.725
Fear gas trap added, buffed toxic gain speed, chance to gain Dementia and Carcinoma from toxic gas halved, Gas Trap renamed to Gas Trap (Toxic). Don't Panic!

V0.7
Can trigger traps remotely, with switch for Manual/Proximity detonation. Traps no longer trigger by pawn walking on other side of walls. Balancing (buffed effects).

V0.65
Allies, neutrals and colonists never trigger the traps. No more explode in your face when constructing one!
Also requires IEDBomb research to build.

V0.6
Let's sleep and fight in our own vomit!
-Added Rage gas.
-Added Sleep gas.
-Added Tear gas.

V0.5
Gas is dangerous, Mkay.

Steam:
http://steamcommunity.com/sharedfiles/filedetails/?id=964388988

Non-Steam download:
https://www.dropbox.com/s/beqc32u3kypcwsw/GasTrap_v09.zip

/Distman
#7
Help / Notification when colonist/pawn dies?
July 01, 2017, 06:27:20 PM
I want to trigger a function when a pawn dies, any easy way to do that without writing a new pawn class?

And of course preferably not check IsDead on all pawns on map every tick...
#8
So i have a grenade weapon with the Verb_ShootOneUse tag, which means it is destroyed when thrown.

I want to either:
* Modify radius stat(or another value) on projectile from quality stat, or another float tag, on weapon. I can get equipmentdef from projectile but that doesn't give me those kind of weapon stats since they are generated when weapon is instanced/crafted. Sadly the Verb_ShootOneUse destroys the weapon when is thrown, so getting the instance of it seems out of reach.
* Add a stat value to projectile when launched from weapon. This seems the best way, since weapon won't exist when projectile hits target.
* I see there's something called ThingID, can i get a Thing instance from this ID somehow?

How can i highjack the launchweapon (or whatever it might be called) method? Or any other ideas?

Thanks,
Distman
#9
Help / Dynamic hangover class w input from xml
June 29, 2017, 04:04:13 PM
Hi

I want to make more dynamic hediffwithcomps & hangover classes. How and why? Well, i want to add different kinds of hangovers for different kinds of highs.

How it works now; If you take for instance how the beer -> drunk -> hangover works, as it is now the AlcoholHigh is part of the hediffClass Hediff_Alcohol and the Hangover is part of Hediff_Hangover.

* Hediff_Alcohol basically adds a hangover hediff if severity is more then 3 (having one beer usually don't give a pawn a hangover).
* Hediff_Hangover only makes the hangover hediff visible if not drunk anymore.
Both of these are coded so they point at each other.

Now, what i want to do is add a variable that i can set in the xml def for both of these classes, so i don't have to make 10s of variants of both classes in c#.

TL;DR I want to add a variable in a overidden HediffWithComps that i can set in xml def.

This is the simple code for Add_Hangover with an added variable (that i want to set in xml):
public class Hediff_Hangover : HediffWithComps
    {
        public string TinctureHediff;

        public override bool Visible
        {
            get
            {
                return !this.pawn.health.hediffSet.HasHediff(DefDatabase<HediffDef>.GetNamed(TinctureHediff)) && base.Visible;
            }
        }
    }

#10
So, let's see if i can explain this...

I have added statdefs to some custom ingredients, simulating something like purity/internal contents/super power in a specific ingredient category. Much like nutrition are calculated but more categories then just nutrition.
Let say i have these available ingredients:
IngredientA have statdef: RedPower 1.0
IngredientB have statdef: GreenPower 0.5.
IngredientC have statdef: BluePower 2.0
IngredientD have statdefs: RedPower 1.0 and GreenPower 1.5.

Every ingredient is part of a thingcategory depending on statdefs added. i.e IngredientC are part of Category_Blue and IngredientD is part of Category_Red AND Category_Green. This way i can set the ingredient list in the recipe after categories instead of specific items.

Now i want to craft two SuperItems, with recipe composed of RedPower 1.0, GreenPower 1.0 and BluePower 1.0; which would mean that a Pawn will craft this item from 1 IngredientA, 1 IngredientB, 1 IngredientC and 1 IngredientD, at least if it's being effective (might result in only IngredientB and IngredientD, but it doesn't matter).

How can i code a revised IngredientValueGetter_nutrition that checks for the current statdef needs/ingredient contents? I tried looking at gold and silver code (which needs more ingredients then say wood when crafting something, but that seems to be pretty much hardcoded with a constant). Is this even possible? Am i missing something? Am i doing it overly complicated?

Vanilla code for calculating nutrition values in a recipe looks like this:
public class IngredientValueGetter_Nutrition : IngredientValueGetter
{
public override float ValuePerUnitOf(ThingDef t)
{
if (!t.IsNutritionGivingIngestible)
{
return 0f;
}
return t.ingestible.nutrition;
}

public override string BillRequirementsDescription(RecipeDef r, IngredientCount ing)
{
return "BillRequiresNutrition".Translate(new object[]
{
ing.GetBaseCount()
}) + " (" + ing.filter.Summary + ")";
}
}


All tips and ideas most welcome!
/Distman
#11
So, let's see if i can explain this...

I have added statdefs to some custom ingredients, simulating something like purity/internal contents/super power in a specific ingredient category. Much like nutrition are calculated but more categories then just nutrition.
Let say i have these available ingredients:
IngredientA have statdef: RedPower 1.0
IngredientB have statdef: GreenPower 0.5.
IngredientC have statdef: BluePower 2.0
IngredientD have statdefs: RedPower 1.0 and GreenPower 1.5.

Every ingredient is part of a thingcategory depending on statdefs added. i.e IngredientC are part of Category_Blue and IngredientD is part of Category_Red AND Category_Green. This way i can set the ingredient list in the recipe after categories instead of specific items.

Now i want to craft two SuperItems, with recipe composed of RedPower 1.0, GreenPower 1.0 and BluePower 1.0; which would mean that a Pawn will craft this item from 1 IngredientA, 1 IngredientB, 1 IngredientC and 1 IngredientD, at least if it's being effective (might result in only IngredientB and IngredientD, but it doesn't matter).

How can i code a revised IngredientValueGetter_nutrition that checks for the current statdef needs/ingredient contents? I tried looking at gold and silver code (which needs more ingredients then say wood when crafting something, but that seems to be pretty much hardcoded with a constant). Is this even possible? Am i missing something? Am i doing it overly complicated?

Vanilla code for calculating nutrition values in a recipe looks like this:
public class IngredientValueGetter_Nutrition : IngredientValueGetter
{
public override float ValuePerUnitOf(ThingDef t)
{
if (!t.IsNutritionGivingIngestible)
{
return 0f;
}
return t.ingestible.nutrition;
}

public override string BillRequirementsDescription(RecipeDef r, IngredientCount ing)
{
return "BillRequiresNutrition".Translate(new object[]
{
ing.GetBaseCount()
}) + " (" + ing.filter.Summary + ")";
}
}


All tips and ideas most welcome!
/Distman
#12
I'm doing an expansion to the world of the tribals. The idea is to enhance and spice up the gameplay when playing tribals (or medieval societies) by introducing alchemy, enchantments and astral powers (i.e magic). The plan is to make the experience immersive and original. Since many of the effects will be both powerful to you and devastating for your foes, finding balance in the production by having several steps and needing rare, dangerous and expensive ingredients, as well as having side effects for overusing particular effects is a nice way to go. Researh are also necessary for most categories of production.

The idea is to divide the mod into four modules (so players can pick what they want to use, as well as making updating the mod more feasible); Alchemy, Enchantment, Astral Powers and World & Culture.

  • Alchemy will include tincture production, brews, cures, skill enhancement potions, drugs and poisons. Offensive and defensive capabilites, as well as help when getting rare/powerful ingredients (for example, when making exploding tinctures and weapons you will need a Boom Organ (from Boomrat or Boomalope), but to be able to harvest that organ you first need to put said animal to sleep. Having a tame animal is of course much easier... An interesting side effects of this organ harvest is that the animal will no longer explode on death, which is a prefered property for a tame animal)
  • Enchantment will be all about enhancing weapons and apparel with powerful effects, as well as production of staffs and wands (enabling Astral Powers to pawns that can't use Astral Powers by default). This will also enable crafting of art items that gives mental boosts to your fellow tribe people, or mental disabilites to your enemies. Adding protective markers and fear inducing totems.
  • Astral Powers is the knowledge to draw power from the Astral plane. It will include but is not limited to; offensive spells, defensive spells, summoning of temporary allies from the Astral Plane, diseases and cures, possesion, soul gathering procedure, terrain deformation... This is a skill and knowledge that pawns are either born with or not. Making it a rare and powerful ability.
  • World & Culture will add factions, events, unique creatues, mythical artifacts, religions(?), lore and hopefully make the world more living and fantastical by using the newly introduced quest system.

Work has begun on Alchemy. Atm i'm mostly focused on functions in dll assemblies and trying out various effects that can be achieved. How about an exploding tincture that summons a horde of manhunting rats with infectios plague, that should make the raids a bit more interesting? Or an exploding tincture that spawns a field of thorned vines, be careful though, the vines spread and can turn into a problem for your colony if taken care of properly. Or how about a field of psychotropic fungi that infect pawn that move through it with hallucinogenic spores, driving them mad. The ideas are plenty...

If you find this idea interesting and would like to contribute, let me know. I'm looking for collaborators.
I'm an artist by trade, have intermediate programming skills but only a couple of days of experience modding Rimworld. So more advanced modders and programmers would be nice, but also people with ideas and experienced Rimworld players, people knowing what they are missing in Rimworld and what they would like to see. This post will of course be open for suggestions from the community. Also i will probably open up a discord chat for people of interest in the progress of the mod, and a platform for testers and contributors.

Stay safe out there, the world is not what it seems.
/Distman
#13
Help / Hediff severity from StatDef on potion
June 15, 2017, 04:38:29 PM
Hey! I'm back!  :o

Made a sleep potion that gives a hediff when consumed (outcomeDoers). The potion has a custom StatDef "Potency" that goes up and down depending on quality and item health. How can i multiply the severity based on potency?
#14
So... I've created a new BodyPart (and a thingdef for the harvested organ) for the Boomrat, updated the Body, added surgery recipe and added that to recipes under animal def.

Basically what i want to do is be able to harvest said organ, remove it from pawn, spawn organ thing on ground and add a hediff to the animal.

I'm having problem with the workerclass. First of all, you don't seem to be able to RemoveBodypart/Harvest Organs on animals as a default.
So i can't use Recipe_RemoveBodyPart.

So i pieced together a workerclass in assemblies, with inspiration from Fluffy's The Birds and The Bees mod... Which throws me an error when a pawn is trying to harvest this new organ:
JobDriver threw exception in initAction. Pawn=Lilith, Job=DoBill A=Thing_Boomrat5328, Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Bill_Medical.Notify_DoBillStarted (Verse.Pawn billDoer) [0x00000] in <filename unknown>:0
  at Verse.AI.Toils_Recipe+<DoRecipeWork>c__AnonStorey4A6.<>m__77B () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=DoBill, curDriver=Verse.AI.JobDriver_DoBill


What am i missing? All help greatly appreciated!!  :-*

Here's code for my workerclass:

public class Recipe_HarvestBoomOrgan : Recipe_Surgery
    {
        public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            if (!pawn.health.hediffSet.HasHediff(HediffDefOf.Neutralized) && !pawn.health.hediffSet.PartIsMissing(pawn.BoomratOrgan()))
                yield return pawn.BoomratOrgan();
        }

        public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients)
        {
            if (billDoer != null)
            {
                if (CheckSurgeryFail(billDoer, pawn, ingredients, pawn.BoomratOrgan()))
                    return;
                TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
            }
            pawn.health.AddHediff(recipe.addsHediff, part, null);
            GenSpawn.Spawn(part.def.spawnThingOnRemoved, pawn.Position, pawn.Map);
        }
    }
#15
I want to add a custom job bill to crafting spot that let's you harvest organs from Boomrat corpses - is it possible?`
All i find is Animalcorpses... But nothing specific to animal race.

Question 2: is it possible to add an animal corpse in a crafting recipe? Had no luck, don't know if i reference it wrong... "Materials needed" blah blah