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

#1
From the main mod







*this mod is not Old Save friendly. Please a start a new game for this mod!


animal Husbandry allows taming of wild Animals. These Domesticated animals follow their tamer and breed, complete with pregnancy period and a animal-Kid aging process.

o Research Animal Husbandry to enable the taming of all RimWorld animals

  • Just look for a wild Animal and a button should be available on next to its description panel. *on the lower left side.
o Taming is dependent on the level of the 'Social' skill of a colonist, and needs to be a [Warden] worker to be able to tame.

o Tamed animals follow their tamer around so you should switch it off when you're done with them.

o Has a Pasture Marker building that can call animals to go this marker and makes domesticated animals not wander off too much from this building. You can choose what animal can pasture near a particular marker.


Should be compatible with any mod. Post here if you have problems.



Installation:
- After downloading the .rar file, just Extract its contents to your RimWorld/Mods folder and enable TTM[animalHusbandry] in the mods panel within RimWorld.

How to Update:
- Delete the old TTM[animalHusbandry] folder and replace it with the new update file.

Compatibility:
Not compatible on Old Saves, please start a new game for this mod.

It should work with anything that doesn't change any Animal type of Defs.




Download:

Alpha7 animalHusbandry v.1.1a:



TTM[animalHusbandry] v1.1 Mediafire Link

Alpha6:
TTM[animalHusbandry] v1 Mediafire Link

TTM[animalHusbandry] v0.1 Mediafire Link

Changelog:
Changelog:
v1.1a
Fixed Error on log.
Removed AnimalKid Leather spawn to fix 0 amount leather error when butchering animal kids.
corrected the research cost.

v1.1
Alpha 7 Compatibility
New:
made Alpha7 animals tamable and breed.

New Building:
Pasture Marker - can call animals to go this marker and makes domesticated animals not wander off too much from this building.
You can choose what animal can pasture near a particular marker.

Changes:
Made domesticated animals able to open doors.


License:
Please ask for permission to use for integration, dissection, and whatnot. Please do not redistribute individual parts as your own. Give credits please, thankyou!
#2
Help / [Tutorial] Creating Ticker-Based Events
July 09, 2014, 04:58:55 AM
Hi guys.
Today I'm sharing on How I made the Time or Ticker(RimWorld code Lingo) Based Events in my CustomEvents Mod

Today I'm sharing how I made one of my Favorite Event which is the

Mysterious Transmission Event

First you need to create the IncidentWorker Class so that you can Put it in the IncidentDefs XML.
The XML has the chance of this event happening we'll go into that later.

Here is the Commented Incident Worker Class.
//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld

//This is a Tutorial for Ticker-Based Events.
//This IncidentWorker class is used to spawn a Ticker Building in the game.

//You define the chance of the event occurring in the incidentDefs XML.

//These are base references for code functions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//These are references to RimWorld Code.
using UnityEngine;
using Verse;
using RimWorld;


namespace TTMCustomEvents
{
//You can change the class name
    public class IncidentWorker_MysteriousTransmission : IncidentWorker
    {
//This method is used to execute the incident.
        public override bool TryExecute(IncidentParms parms)
        {
//This function looks for a suitable cell in the map to spawn a ticker.
            IntVec3 intVec = GenCellFinder.RandomCellWith((IntVec3 sq) => sq.Standable() && !sq.IsFogged());

//This function creates the ticker building.
            Thing ticker = ThingMaker.MakeThing(ThingDef.Named("MTcounter"));

//This function spawns the ticker into the game.
            GenSpawn.Spawn(ticker, intVec);

//This determines if the incident has successfully initiated.
            return true;
        }

    }
}

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld


After you create the Incident Worker Class, we will then proceed to create the MTcounter Building that handles the Timeline of the Event.

The MTCounter building is basically the Ticker for this event.
For the duration of this event, The MTCounter building will provide the Tick() method to be used in the event.

Here is the Commented MTCounter building code.
//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld

//This is a Tutorial for Ticker-Based Events.
//This IncidentWorker class is used to spawn a Ticker Building in the game.

//You define the chance of the event occurring in the incidentDefs XML.

//These are base references for code functions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//You need these references to use RimWorld code functions.
using UnityEngine;
using Verse; //Verse contains most RimWorld method and Functions.
using Verse.AI; //Verse.AI deals with pawnAI specifics
using RimWorld; //RimWorld contains code interactions within the game.

//You can change the namespace to whatever you like.
namespace TTMCustomEvents
{

//You can change this class name to whatever you like.
    public class Ticker_MTcounter : Building //: Building : this references the type of Thing you are going to use. There are different kinds Building, ThingWithComponents, IncidentWorker etc.
    {

//These are instance variables.
        Pawn face, Mutator, abom; //Pawn class for dealing with specifying a pawn.
        int hours = UnityEngine.Random.Range(8000, 16000); //this variable contains the time amount and Randomizes the value.
//Time Table
//1 second IRL = 60Ticks
//1 gameHour = 2000Ticks
//1 gameDay = 20000Ticks

        bool justspawned = true, doonce = false, spawn = false; //these are determinants.

        IntVec3 place; //this variable will contain coordinates.

//SpawnSetup method is always used so that it will spawn the building.
        public override void SpawnSetup()
        {
            base.SpawnSetup();
            justspawned = true; //I'm using justspawned bool variable to instantiate starting phase of the event. when this becomes false it has finished starting process, then proceeds to second part for the Time Sequence of the Event.
        }

//The Ticker method makes everything move.
//This is called everytime the game moves.
        public override void Tick()
        {
            base.Tick();

            // This first part checks if the spacers have already spawned, if not then proceeds to create Spacers.

            //Log.Warning("");
            if (justspawned == true)
            {
//This line looks for pawns that incapacitated or Prisoners and if They are of Spacer Faction. then outputs it to the list variable.
                List<Pawn> list = (
                from Pawn g in Find.ListerPawns.AllPawns
                where g.Incapacitated || g.IsPrisonerOfColony && g.Faction.def.defName == "Spacer"
                select g).ToList<Pawn>();

                int c = list.Count(); //Counts how many pawns are in the list variable.

                if (c > 2)
                {
                  face = list.RandomElement<Pawn>(); //find a pawn to be set in the face variable.
                  justspawned = false;
                }
                else
                {
                    for (int i = 0; i < 2; i++)
                    {
//this line loops 2times to make 2 Spacers. If you set these variables outside the loop it will create
//The same pawn 2times, but only spawn one spacer.

//this determines the faction.
                        Faction faction = Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Spacer"));

//this creates the pawn you want to be spawned.
                        Pawn pawn = PawnGenerator.GeneratePawn(PawnKindDef.Named("SpaceRefugee"), faction);

//looks for a suitable area.
                        IntVec3 land = GenCellFinder.RandomStandableClosewalkCellNear(base.Position, 5);

//this makes the spawned pawn incapacitated.
                        pawn.healthTracker.ForceIncap();

//this basically makes a pawn do something before it becomes psychotic.
                        pawn.jobs.StartJob(new Job(JobDefOf.Wait));

//This utility makes a psychotic, you can change the SanityState to any available type.
                        PsychologyUtility.TryDoMentalBreak(pawn, SanityState.Psychotic);

//this utility spawns a dropPod containing pawns.
                        DropPodUtility.MakeDropPodAt(land, new DropPodInfo
                        {
                            SingleContainedThing = pawn,
                            openDelay = 880,
                            leaveSlag = true
                        });
                    }

//These lines determines the face pawn variable.
//This is a single iteration of the above code.
                    Faction factionf = Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Spacer"));
                    face = PawnGenerator.GeneratePawn(PawnKindDef.Named("SpaceRefugee"), factionf);

                    IntVec3 landf = GenCellFinder.RandomStandableClosewalkCellNear(base.Position, 5);
                    face.healthTracker.ForceIncap();
                    face.jobs.StartJob(new Job(JobDefOf.Wait));
                    PsychologyUtility.TryDoMentalBreak(face, SanityState.Psychotic);
                    DropPodUtility.MakeDropPodAt(landf, new DropPodInfo
                    {
                        SingleContainedThing = face,
                        openDelay = 880,
                        leaveSlag = true
                    });


//After the Spacers are spawned this will proceed to the Letter Notification of the Event.
                    justspawned = false;

//You set the message here.
//After 3 Updates to my mods you MUST set a string variable for your messages because RimWorld code changes a lot. Do not put the message in the method.
                    string text = "-------------Incoming Transmission-------------\n zzzbxzzx HELP!.... zxxcxbx We are under attack by an unknown lifeform!... zxcbcxzzz \n\n Please.. cvxzzxc HELP.xz..xz.. \nThe Ship is going dow.zxc.zx.x. We are escaping to a Rimworld.zx.c..... \n\n---------------End of Transmission--------------- \n\nDropPods Incoming!";

//This will make the Letter Notification appear in-game.
                    Find.History.AddGameEvent(text, GameEventType.BadNonUrgent, true, this.Position, string.Empty);
                    //----------------------^text variable is the message
//-----------------------------^GameEventType: There are 3 types BadNonUrgent = Yellow, BadUrgent = Red, Good = Blue.
//-------------------------------------------------------^Boolean to send Letter
//----------------------------------------------------------------^variable to determine the Go-To location of the event.
//--------------------------------------------------------------------------------^a DebugText **I haven't used this yet.
                }
            }

            // Check if already spawned
         
//Second Part
//The second part will start the time sequence of the events.
            hours--; //After instantiating the starting phase, the hours variable will then minus itself by 1, and do this every tick.
            if(face.IsInBed() && doonce == false) //Check if the face pawn is already in Bed. and makes it only do once.
            {
//Creates a message and sends a Letter Notification in-Game.
                string text = "The faces of the humans contained within the droppods looked terrified beyond belief, they must've experienced something horrifying.";
                Find.History.AddGameEvent(text, GameEventType.BadNonUrgent, true, face.Position, string.Empty);
                doonce = true;
            }

            if(hours <= 0) //When the hours variable is going below 0 or is 0 it will then proceed to the events you want to happen.
            {
//This is how I determine the chance. **Pretty lame right? :D
                int chance = UnityEngine.Random.Range(0, 100); //This gets a random value. min 0 max 100

                if (chance > 50) //A 50/50 chance to spawn the Abomination.
                {
//If chance is greater than 50 then.

//This gets a random pawn in the game that is a Human and Faction is Spacer.
                    if ((from pwn in Find.ListerPawns.AllPawns
                         where pwn.def.defName == "Human" && pwn.Faction.def.defName == "Spacer"
                         select pwn).TryRandomElement(out Mutator)) //Outputs the pawn into the variable name
                    {
//Create message and send a Letter Notification.
                        string text = "" + Mutator.Name.nick + " transformed into a huge abomination! that mysterious transmission dropped a Mutated Lifeform unto us! \n\nDestroy it before it slaughters all of the colonists!";
                        Find.History.AddGameEvent(text, GameEventType.BadUrgent, true, Mutator.Position, string.Empty);

                        place = Mutator.Position; //Save the position of the chosen pawn.

                        Mutator.health = 9999; //Makes the health of the Mutator pawn 9999
                        Explosion.DoExplosion(place, 0.1f, DamageTypeDefOf.Bomb, null);
//Creates an Explosion in the position, Explosion Radius, DmgType, Instigator

                        for (int b = 0; b < 90; b++)
                        {
//Creates blood and spews it all over the place.
                            IntVec3 SpewBlood = GenCellFinder.RandomStandableClosewalkCellNear(place, 4);
                            ThingDef blood = DefDatabase<ThingDef>.GetNamed("FilthBlood");
                            FilthMaker.MakeFilth(SpewBlood, blood, Mutator.Name.nick);
                        }

                        Mutator.Destroy(); //this removes the Mutator Pawn to replace it with the Abomination.

//Spawns the Abomination
                        Faction faction = Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Abomination"));
                        abom = PawnGenerator.GeneratePawn(PawnKindDef.Named("Abomination"), faction);
                        GenSpawn.Spawn(abom, place);

//Makes the Abomination Psychotic
                        PsychologyUtility.TryDoMentalBreak(abom, SanityState.Psychotic);
                        spawn = true; //Bool Variable to determine if Abomination has Spawned
                    }
                }
                else {

//If chance is less than 50 then it will only send this message and nothing else.
                    string text = "It seems that the nightmare of the 3 Spacers has ended, Whatever attacked their spaceship may have been destroyed together with their ship. \n\nLet's just hope that they forget the terror they have experienced and continue to live on.";
                    Find.History.AddGameEvent(text, GameEventType.Good, true, string.Empty);

//This else condition is an Ending Phase of the Event
//You should then proceed to Destroy this building for Clean Up.
                    this.Destroy(); }             
            }

            if (spawn == true) //if abomination has spawned.
            {
                if (abom.healthTracker.Health < 100 || abom.health < 100)
                {
//saves the abomination position
                    place = abom.Position;
                    abom.health = 9999; //Edits abomination health to 9999
//* I explicitly do this so that the abomination doesn't die after the explosion.
// If the abomination dies before the .Destroy() method it will create a null Reference Error.
// After the explosion the code will then Destroy() the abomination.

//Do Explosion
                    Explosion.DoExplosion(place, 5f, DamageTypeDefOf.Bomb, null);

                    for (int b = 0; b < 250; b++) //Spews blood all over the place.
                    {
                        IntVec3 SpewBlood = GenCellFinder.RandomStandableClosewalkCellNear(place, 7);
                        ThingDef blood = DefDatabase<ThingDef>.GetNamed("FilthBlood");
                        FilthMaker.MakeFilth(SpewBlood, blood, 1);
                    }

//End Message.
                    string text = "The Mutated Abomination exploded to bits and pieces.";
                    Find.History.AddGameEvent(text, GameEventType.BadNonUrgent, true, place, string.Empty);

//Destroy abomination.
                    abom.Destroy();

//After the last event sequence you should then proceed to destroy this building for Clean Up.
                    this.Destroy();
                }
            }
           

        }
    }
}

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld


That's most of the code.
You then proceed to make the necessary XML for the event and the Building ThingDef XML for the MTcounter Building

ThingDef XML

<?xml version="1.0" encoding="utf-8" ?>
<Buildings>


<ThingDef Name="BuildingBase" Abstract="True">
<category>Building</category>
<soundBulletHit>BulletImpactMetal</soundBulletHit>
<selectable>true</selectable>
<drawerType>MapMeshAndRealTime</drawerType>
<surfaceNeeded>Light</surfaceNeeded>
<constructionEffect>ConstructMetal</constructionEffect>
<repairEffect>Repair</repairEffect>
<leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
</ThingDef>

<!-- Tech Tree Minami -->

<ThingDef ParentName="BuildingBase">
<defName>MTcounter</defName>
<eType>BuildingComplex</eType>
<label>Ticker</label>
<thingClass>TTMCustomEvents.Ticker_MTcounter</thingClass>
<textureFolderPath>Things/Filth/RubbleRock</textureFolderPath>
<altitudeLayer>Waist</altitudeLayer>
<passability>Standable</passability>
<selectable>false</selectable>
<useStandardHealth>false</useStandardHealth>
<tickerType>Normal</tickerType>
<description>Ticker</description>
<size>(1,1)</size>
<workToBuild>1</workToBuild>
<overdraw>false</overdraw>
<fillPercent>0</fillPercent>
<surfaceNeeded>Heavy</surfaceNeeded>
<designationCategory></designationCategory>
<itemSurface>true</itemSurface>
  </ThingDef>

</Buildings>


IncidentDef XML

<?xml version="1.0" encoding="utf-8" ?>
<IncidentDefs>

<!-- TTM Custom Events -->
<!-- Anomaly Events -->

<IncidentDef>
<defName>Anomaly_MysteriousTransmission</defName>
<workerClass>TTMCustomEvents.IncidentWorker_MysteriousTransmission</workerClass>
<minRefireDays>30</minRefireDays>
<favorability>Neutral</favorability>
<chance>2</chance>
</IncidentDef>

</IncidentDefs>


And thats it!
Oh and you might need the Abomination Pawn XML definitions too!
I'll put them in the attachments.

Thanks for checking this out!
More Power to RimWorld and Tynan Sylvester!

[attachment deleted by admin: too old]
#3
From the main mod








Adds 36+ Custom Events
HyperTornado
FlashFlood *somewhat
Wild TuskBeasts
Static Signals
Animal Genocide
Faction War
Wanted Outlander
Suspicious Crates
Tribe Migration
Muffalo Migration
Colonist Regeneration
BrokenBuildingGeothermal
BlackVoid
Earthquake
EclipseSubEventA (Eclipse animalFeral)
EclipseSubEventB (Eclipse Meteor)
EndRescue (Game Ender)
MeteorShower
PrisonBreak
PrisonerAssault
PrisonerRampage
PrisonRiot
RageVirus
RaiderSyndicate
SolarFlareSubEventA (Cosmic Radiation)
Stroke
Mechanoid Swarm
Raid Command
Resource Prescience
Colonist Kidnappers
Terminator
Buzzant Hill
Mysterious Ship Transmission
Colonist Stash
Risk/Reward Event
Nausea

+22 Text only Events

v2.3 New Feature:
Made an Initializer to provide a 55% chance to call a trader once every month.
This serves as a measure to make sure that a trader should come into your colony rather than just relying on the Incident chance of a trading ship to pass.




Please start a NEW WORLD and NEW GAME before playing with the mod.
Should be compatible with any mod. Post here if you have problems.

Recommended:
The greatest RimWorld story ever told! *Features TTM[CustomEvents]!!
Rebecca Cain
https://www.youtube.com/watch?v=He9PN-ngxsU

Help:
This mod is not compatible on old Saves that do not have [CustomEvents] installed, please start a new World and a new Game before playing with this mod.

Installation:
- After downloading the .rar file, just Extract its contents to your RimWorld/Mods folder and enable TTM[CustomEvents] in the mods panel within RimWorld.

How to Update:
- Delete the old TTM[CustomEvents] folder and replace it with the new update file.

Screenshots:


Changelog:
Changelog:
v2.3d
Changes:
Adds a condition for Animal Genocide Event to not kill MAIs when it is installed.
TuskBeast movespeed increased to 3, Meat yield Lowered.

v2.3c
+Fixed
- Removed Abomination explosion mechanic to prevent loop error.
v2.3b
+Fixed never ending faction war when loading a game when this is occurring.

v2.3a
+Fixed
- Fix Tuskbeast error when killed.

v2.3
Alpha 7 Compatibility

New Feature:
Made an Initializer to provide a 55% chance to call a trader once every month.
This serves as a measure to make sure that a trader should come into your colony rather than just relying on the Incident chance of a trading ship to pass.

New Events:
HyperTornado - A hyper destructive force of nature!
FlashFlood - Be wary of dense forests FlashFloods are a killer!
WildTuskBeast - Majestic Beasts :3
Static Signal - This is how the Atmospheric Interruption should be!
AnimalGenocide - A super mysterious RimWorld phenomena D:

Changes:
Cosmic Radiation:
affected colonists should only get tired and need rest.

Mysterious Transmission:
Changed Mutated Abomination mechanics.

Earthquake:
should now only damage some buildings!
no more mini explosions.

Fixes:
Black Void:
fixed voids dying.

-- Spawner Buildings are now forced to undo the claim button effect.

v2.2
New Events!

Scenario Events:
Faction War
- Pirates vs Outlanders! = lots of corpses.
Wanted Outlander
- It's a manhunt!
Suspicious Crates
- Not all dropped goods from orbit are items.

Normal Events:
Tribe Migration
- Tribals get raided too.
Muffalo Migration
- Muffalos on the go.
Colonist Regeneration
- Miraculous healing properties. *limited to wounds only

Changes:
Changed RaiderSyndicate to only choose prisoners.
Recalibrated ColonyWealth Requirement for hard events.
Removed PrisonerSuicide Event.
Removed AtmosphericInterruption Event.
Removed ColonistDeath Event.
Nerfed RageVirus to affect only half of the colonist population.

Fix:
Fixed Risk/Reward event scenario[1](Bomb Chest/Silver Reward) not killing/removing the colonist.
Fixed Abomination exploding over and over again.

v2.1.4
Alpha6 Compatibility and Removed Events

Removed Sickness Events
- The sickness events caused colonists to die prematurely.


Download:

Alpha 7 Custom Events v2.3d:



Alpha 6:
TechTreeMinami[Custom Events] v2.2 Mediafire Link

TechTreeMinami[Custom Events] v2.1.4 Mediafire Link

------------------------------------

Do you have a nice idea for an event? Do you think its doable in rimworld?
Here are some questions and guidelines that makes it doable:

Does it involve a falling object in space and releasing something?
Does it involve destruction?
Does it involve killing pawns?
Does it involve altering mindstates?
Does it involve spawning something?
Is it a random chance?
(Thats all I could think of for now.)
If yes! then it "might" be doable! *not totally sure

Or If you have a totally out of this world, but super awesome idea give it a try and post your Ideas!

Compatibility:

Compatible with every other mod that doesn't edit the Original Incidents in the IncidentsDef folder.
-If a particular mod edits the original incidents you must load this in the mods panel last.

License:
Please ask for permission to use for integration, dissection, and whatnot. Please do not redistribute individual parts as your own. Give credits please, thankyou!
#4
Help / Help on my code (Advanced Rimworld Code)
May 31, 2014, 10:07:22 AM
Hello Everybody,

I would like to have help on remaking the commsconsole code,
I am truly stuck on my medicine cabinet mod.
I've attached the medicinecabinet source so you can see.

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UI;
using AI;
using Sound;

namespace ttm
{
    public class Building_MedicineCabinet : Building
    {
        public static int CollectDuration = 150;
        public override void ExposeData()
        {
            base.ExposeData();
        }
        public override void SpawnSetup()
        {
            base.SpawnSetup();
        }

//Checking if there is Medicine in Hopper
        private Thing MedsinHopper
        {
            get
            {
                Thing result;
                foreach (IntVec3 current in GenAdj.AdjacentSquaresCardinal(this))
                {
                    Thing thing = null;
                    Thing thing2 = null;
                    ThingDef thingDef = ThingDef.Named("Medicine");
                    ThingDef thingDef2 = ThingDef.Named("Hopper");
                    foreach (Thing current2 in Find.Grids.ThingsAt(current))
                    {
                        if (current2.def == thingDef)
                        {
                            thing = current2;
                        }
                        if(current2.def == thingDef2)
                        {
                            thing2 = current2;
                        }
                    }
                    if(thing != null && thing2 != null)
                    {
                        result = thing;
                        return result;
                    }
                }
                result = null;
                return result;
            }
        }

//Use a Medicine in hopper
        public Thing useMeds()
        {
            Thing result;
            int num = 1;
            int num2 = 0;
            System.Collections.Generic.List<ThingDef> list = new System.Collections.Generic.List<ThingDef>();
            Thing MedsinHopper = this.MedsinHopper;
            do
            {
                int num3 = Mathf.Min(MedsinHopper.stackCount, num);
                num2 += num3;
                list.Add(MedsinHopper.def);
                MedsinHopper.SplitOff(num3);
                if (num2 >= num)
                {
                    break;
                }
                MedsinHopper = this.MedsinHopper;
            }
            while (MedsinHopper != null);
            result = null;
            return result;
        }
        public bool CanuseMeds
        {
            get
            {
                return this.MedsinHopper != null;
            }
        }


//Salvaged Comms Console Code
        public override IEnumerable<FloatMenuOption> GetFloatMenuChoicesFor(Pawn myPawn)
        {
            if (!myPawn.CanReach(this, PathMode.InteractionSquare))
            {
                FloatMenuOption item = new FloatMenuOption("Cannot use (no Path)", null);
                return new List<FloatMenuOption>
                {
                    item
                };
            }
            if (!CanuseMeds)
            {
                FloatMenuOption item2 = new FloatMenuOption("There's no Medicine in Hopper.", null);
                return new List<FloatMenuOption>
                {
                    item2
                };
            }
            else
            {
                Action action = delegate {
                    Job job = new Job(JobDefOf.UseCommsConsole, new TargetPack(this));
                    myPawn.playerController.TakeOrderedJob(job);

                    this.useMeds();
                    int amount = myPawn.healthTracker.MaxHealth - UnityEngine.Random.Range(10, 35);
                    myPawn.TakeDamage(new DamageInfo(DamageTypeDefOf.Healing, amount, null));
                    this.def.building.soundDispense.Play(base.Position);
                };
                List<FloatMenuOption> list = new List<FloatMenuOption>();
                list.Add(new FloatMenuOption("Heal " + myPawn.Name.nick, action));
                return list;
            }     
        }
    }
}

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld


I want to know how the jobdriver works and make a pawn stop on the building within the interaction square. ILSPY messes up the jobdriver_useCommsConsole and WorkGiver code.

also I would like to ask how to use ,
if (Find.ResearchManager.IsFinished(ResearchProjectDef.Named("")))
            {
                DefDatabase<ThingDef>.GetNamed("").comps<CompPowerTrader>.();
            }


Im trying to mod a building research upgrade to reduce consumption of power, and I don't know how to get Comppowertrader

<compClass>CompPowerTrader</compClass>
<basePowerConsumption>350</basePowerConsumption>

in the code.
or is that even possible?

Lastly, what better way to search for a building? and count how many there are. I am doing this


List<Building_OrbitalTradeBeacon> list = (
              from Building_OrbitalTradeBeacon d in Find.ListerBuildings.AllBuildingsColonistOfType(EntityType.BuildingComplex)
              where d.def.defName == "OrbitalTradeBeacon"
              select d).ToList<Building_OrbitalTradeBeacon>();

Building building = list.RandomListElement<Building_OrbitalTradeBeacon>();



but it returns an object is not set to instance error.

Heres the source where im using this code.
//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UI;

namespace ttm
{
    class IncidentWorker_BrokenOTB : IncidentWorker
    {
        public override bool TryExecute(IncidentParms parms)
        {
            List<Building_OrbitalTradeBeacon> list = (
              from Building_OrbitalTradeBeacon d in Find.ListerBuildings.AllBuildingsColonistOfType(EntityType.BuildingComplex)
              where d.def.defName == "OrbitalTradeBeacon"
              select d).ToList<Building_OrbitalTradeBeacon>();
            {
                Building building = list.RandomListElement<Building_OrbitalTradeBeacon>();
                Find.LetterStack.ReceiveLetter(new Letter("An Orbital trade beacon has stumbled, turns out it got broken.", LetterUrgency.Medium));
                building.TakeDamage(new DamageInfo(DamageTypeDefOf.Bullet, 100, null));
                return true;
            }
        }
    }
}

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld


Heres a source that works with using the code, I really don't know why this works though, maybe its got something to do with it being EntityType.Building_PowerPlantGeothermal specifically. I haven't really studied it that much though and moved on.

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UI;

namespace ttm
{
    public class IncidentWorker_BrokenBuildingGeothermal : IncidentWorker
    {
        public override bool TryExecute(IncidentParms parms)
        {
            List<Building_PowerPlant> list = (
                from Building_PowerPlant g in Find.ListerBuildings.AllBuildingsColonistOfType(EntityType.Building_PowerPlantGeothermal)
                where g.GetComp<CompPowerTrader>().powerOutput > 3000
                select g).ToList<Building_PowerPlant>();
            {
                Building building = list.RandomListElement<Building_PowerPlant>();
                Explosion.DoExplosion(building.Position, 5f, DamageTypeDefOf.Flame, null);
                Find.LetterStack.ReceiveLetter(new Letter("A geothermal reactor's engine has been severely damaged and destroyed from a strong steam propulsion inside the planet core, due to an uncharted planet core these things happen on rimworlds.", LetterUrgency.Medium));
                building.TakeDamage(new DamageInfo(DamageTypeDefOf.Bomb, 1000, null));       
                return true;
            }
        }
    }
}

//Rimworld
//Rimworld TechTreeMinami Mod by: minami26
//Rimworld


Thats all thankyou! More power to rimworld!
#5
Economy Balance + TRADERS, VisitorMedBed and KeyBinding By Haplo! [MOD REPACK]
Updated Patches:
  - Custom Events
  - MAI v1.7.5

You want this sexy image as your Signature? then copy paste this code on your forum profile signature!
[center][url=https://ludeon.com/forums/index.php?topic=3464.0][IMG]http://i59.tinypic.com/24v6t0h.png[/img][/url][/center]

Tech Tree Minami is a Gameplay + ModPack overhaul mod for RimWorld.
*This mod is not for beginners of RimWorld. This mod increases the difficulty of RimWorld significantly it may totally annihilate you.

o If you want more challenge and totally ramp up the difficulty this RimWorld mod may be just for you!

o TechTree Minami houses a large and extensive Research Tech Tree that spans from the early beginnings of your colony up to the building of your ship out to space! this extensive Research line contains quality amounts of Building Upgrades to help you further enhance your colony more!

o TechTree Minami puts all the vanilla items into their own respective Research Tree to give overseers the feeling of learning materials first before actually making them.

o Adds more than just a tech tree, features crafting of individual parts for building construction and a fine amount of custom buildings created out of fun ideas and simple thoughts!

o A transition period between survivor colony to a permanent colony which takes dependence on trading ships and TTM's local traders.

o Contains 'Animal Husbandry' which allows taming of RimWorld animals. These Domesticated Animals follow their tamer and breed, complete with pregnancy period and a Kid-Animal aging process.

o Raiders actually has reasons to attack you! TTM possesses the ability to contact attacking raiders and lets you negotiate with them for a hefty sum using the Signal Beacon Building.

o This Signal Beacon Building has access to Establishing a Trading contract and signalling Call/Order TradeShips that eagerly travels to your RimWorld and provides all the Trading items you need for a fee of 800Silver. It also has the capability to send a minor signal to call for other TradeShip types or Risk calling Raiders instead! *you have been warned!

o TTM also posses a T.U.T.O.R.I.A.L. (Temporal Unified Tutor On Reformation & Intricate Artificial Learning) building for colonists to actually Learn skills! and a super efficient C.H.E.S.T (Compression Holder Entity Storage Tank) building that can store a whopping 1200 stacks of items! talk about storage you say? + a FoodPreserver and Fridge for extending your foods expiration date!

o TTM has a Medicine Cabinet that enables you to use Drugs to enhance your colonists and are concocted from the Concoction table complete with nasty side effects and the ability to make Medicine. Current Drugs available are: Crankulant - Rest drug. Bloatulant - Food drug. Hastulant - Movement speed drug. Illusiolant - Mood drug. Regenulant - Healing drug.

o A new food mechanism from the "Fireplace" which lets you put RawFood or PreparedMeat on it and grills them for better food than chewing on raw materials.

o Has the Universal Vending Machine that lets you buy a number of available Comfort Food e.g Pizza, Burgers, IceCream, Fries and BEER!. These comfort food provide a nice mood boost to straighten up the long faces of your colonists.

o Equipped with a Missile Launcher Security Building to annihilate Mass amounts of Raiders or try to subdue siege-ing Raiders. Provided a simple Animal Zapper Security Building perfect for those pesky Animal Insanity waves that overwhelm the colony.

o Now has Entertainment Buildings to provide a Mood Boost for those idling colonists. [PoolTable, Arcade]

o TTM contains additional mods that greatly enhances the quality of the game!



Features:


First of all please help yourself with the TechTree Guide provided by yours truly.

Integrated Mods:
*w/ Thingamajigs!

Enhanced Defence: Phoenix Edition *Shields and Embrasures only!
MachineGun Nests

Mobile AI (MAI) + Traders + VisitorMedBed + KeyBinding

A2B: Conveyor Belts
Extended Stoneworking
Mining & Co.Deepdriller + MMS
Extended Surgery and Bionics
Glassworks VII


TTM is crafting dependent.
*Always start with a colonist with Crafting skill of 5 or more! *the higher the skill the better!

Read the FULL list of features here!



I hope you enjoy playing my mod!

Tips:
! Don't forget to set "Ingredient Search Radius" in the bills tab.
*it can get pretty annoying if they haul stuff from far away and get only the exact amount for crafting. =.=
! Do this Urban Defense
*try it its fun!
! Don't stop researching.

Here's a little defense guide I made for those who are having great difficulty in defending their colony.

Help:
This mod is not compatible on old Saves that doesn't have TTM installed, please start a new World and a new Game before playing with this mod.

Installation:
- After downloading the .rar file, just Extract its contents to your RimWorld/Mods folder and enable TTM and its related mods in the mods panel within RimWorld.

Compatibility:

Works well with EdB Interface Mods. You just have to load EdB related mods LAST.

Heres what you should do:
1. UNLOAD all your mods. *except "core" ofcourse
2. Load ALL TTM related mods. *make sure to load TTM MAIN first!! very important!!
3. then load Edb Interface and Prepare Carefully last.

Quote from: Kitsune on August 29, 2014, 10:12:51 AM
TTM is somewhat compatible with many mods. The biggest problem are mods that change/alter or something doing with map generation. The first thing for look out is trie the mods together and if you get the starting items and the message from TTM, its almost clear and maybe its imbalanced and the other mod is sure not integrated in the TTM techtree. If you dont get the starting items (drop pods and CRT) the mod is not compatible with TTM. :)

So if you want a mod and dont want to wait for anyone to test it, test it yourself, if anything from TTM is not aviable or your game explodes in clouds of fluffy kittens, dont use the mod with TTM. ;)

Tech Tree Minami is compatible with mods that adds new stuff and doesn't edit existing items from the core game.
The only hiccup is that mods that add new stuff to the game do not get placed in the tech tree. If you want a mod to have a TTM patch you can happily request so!

FAQ:
Q: There is something wrong with TTM it has lots of errors when I play with it, help!
A: Are you playing it on an Old Save? if it is your first time playing with TTM. It is Required that you create a New World and a New Game.

Q: Some buildings and things don't work what could be wrong / The game just freezes when I load the mod and nothing happens, what to do?
A: You can try refreshing your RimWorld settings by deleting the Ludeon Studios Folder in

WINDOWS:   C:/Users/[username]/AppData/LocalLow/
(On Windows, the AppData folder may be hidden.)

MAC:       Users/[username]/library/cache/

LINUX:       /home/[username]/.config/unity3d/


to make sure that everything is starting on fresh settings.
*Warning! this will also delete your save files, please go make a copy of them.

Q: When I load up TTM some textures have great big X's on them.
A: After updating TTM, this usually happens. Just close RimWorld and Open the game again and it should be fixed right away.

Q: Im having a Black Screen on loading.
Quote from: Killa on September 19, 2014, 02:10:14 AM
Hey I'm getting a problem activating the mod, the game stops responding and just freezes up. I've waited over 20 mins and it wont start back up, the game will run other mods fine and the same rimworld file will run fine on my laptop so I'm assuming it's not agreeing with something on my pc. Is there anything else you need to know to give me an idea as to what is wrong?

Just left the game on not responding while I went out for about an hour and a half and it's loaded. No idea what's going on but if you could suggest something that would be great as it's going to take about that long every time I load the game up.
A: Read this post for a possible fix.

Notes:

You are free to adjust and dissect the mod if its too hard for you, but only for your own use.

If you want a survival type game, where there are drama and traitors and less attacking. Try RandyRandom!
If you want the Rimworld Style of events where Attacks escalate play Cassandra Playstyles! I think the events even out on Cassandra.

as of v2.1 randyrandom is again the nicest way to play TTM!

Screenshots:


Download:

Disclaimer
*Functionality may or may not work with OSX based machines.

Alpha 7 v3.3 Full Pack (Includes 15 TTM patched mods) *Please start a NEW GAME.



Alpha 7 v3.3 TTM Main only *Please start a NEW GAME.
TTM v3.3 Main only Mediafire Link

TTM Patched Mods for v3.3:
Mediafire Links
Animal Husbandry
MachineGun Nests v0.1
Embrasures
Extended Stoneworking
Project Armory v2.15
SurgeryExtended & Bionics (Recipe Nurse Included!)
Glassworks VII
Clutter Update25 v0.1
Shields v0.3
Apparello w/ Thingamajigs v0.3
Mining&Co.Deepdriller+MMS v0.2
Updated!
Mobile AI (MAI) v0.2
Custom Events v0.4

Alpha 7 v3.1 FULLPACK
TTM v3.1 FULLPACK Mediafire link

Alpha 6 v3.0 FULLPACK
TTM v3.0 FULLPACK Mediafire link
GoogleDrive Download Link

Alpha 6 v2.9 FULLPACK
TTM v2.9 Mediafire link

TTM a7 SOURCE CODES *please go easy on my codes I do messy codes :(
TTM a7 SOURCE latest v3.1

You can find previous version download links here!

Changelog:

v3.3 Economy Balance + TRADERS, VisitorMedBed and KeyBinding By Haplo! [MOD REPACK]

Updated Patches:
  - Custom Events
  - MAI v1.7.5

Added: Integrated directly in TTM, these are MUST HAVES!
Haplo's Traders.
- Adds a local trader from a friendly faction to come to the colony and trade items with their TradingPost.
- Integrated especially into TTM Main to replace the existing local trader... Haplo made it 10000000x better.

Haplo's Visitor Medical Bed
- Very Handy Bed for those wanting to ever save their fellow friendly faction.
  *HOW TO USE:
when people from a friendly faction gets incapacitated an option will be available from the VisitorMedical Bed by RightClicking the bed and choosing which person to help.

Haplo's KeyBinding [NEEDS A NEW COLONY]
- Keys 7, 8 and 9 are used to set drafted colonist positions.
*HOW TO USE:
press SHIFT + 7/8/9 to save selected drafted Colonists position.
pressing 7/8/9 will automatically call all selected colonists that are saved into position.

pressing SHIFT + Q sends a colonist to bed if tired.
pressing SHIFT + E sends a colonist to eat if hungry.

Changes:

Economy Balance
- first attempt at balancing Item Prices.
- Everything is higher priced now due to market value scaling.
- Makes items cheaper to make than buying while earning a profit.
- lowered amount of silver traders carry.
- Reconfigured what Local Traders Carry to match needs of the colony. Ship traders feels more like real SPACESHIP traders.

- Balanced Utility Metal and WoodPlank building costs.
- Changed Table and Stool stuff costs, made cheap.
- Removed Uranium as Stuff.

view the old changelogs here!
https://docs.google.com/document/d/1MGuf4y9QtstgS8-g4m7EL4cpsuANt5MHdAjyXFdm5To/pub




Mod Team:
minami26 (Mod Maker)

Texture Artist:


Texture Contributor:



Credits:
Special Mention to these awesome people!
Tynan Sylvester and Ludeon Studios, Evul and the Project Armory Dev Team, Haplo, Mrofa, Renham, Spatula, Ramsis, Kitsune, Shinzy, Jaxxa, PunisheR007, Psyckosama, Compozitor, LordJulian, noone, ItchyFlea, Rikiki, Minus, ITOS.

And to the players of RimWorld, TTM and the RimWorld Community!

Classical/Modern/Spacer art not mine! I just got them from google.

License:
Please ask for permission to use for integration, dissection, and whatnot. Please do not redistribute individual parts as your own. Give credits please, thankyou!