Okay I am trying to add thoughts to my own items that I have added. In ThoughtDefs I have
<?xml version="1.0" encoding="UTF-8"?>
-<ThoughtDefs>
-<ThoughtDef>
<defName>ObservedCutePodBed</defName>
<label>Observed Horrifically Pink Bed</label>
<description>This is pink enough to make anyone feel ill!</description>
<baseHappinessEffect>-2</baseHappinessEffect>
<baseFearEffect>5</baseFearEffect>
<duration>10000</duration>
<stackedEffectMultiplier>0.5</stackedEffectMultiplier>
<stackLimit>5</stackLimit>
</ThoughtDef>
-<ThoughtDef>
<defName>ObservedCuteCouchA</defName>
<label>Observed a flamingo looking couch</label>
<description>I saw a bright pink couch. Can this place get any worse?</description>
<baseHappinessEffect>-3</baseHappinessEffect>
<baseFearEffect>10</baseFearEffect>
<duration>10000</duration>
<stackedEffectMultiplier>0.5</stackedEffectMultiplier>
<stackLimit>5</stackLimit>
</ThoughtDef>
-<ThoughtDef>
<defName>ObservedKitty</defName>
<label>Observed an evil cat!</label>
<description>I saw a cute cat.... This place is terrifying!</description>
<baseHappinessEffect>-12</baseHappinessEffect>
<baseFearEffect>15</baseFearEffect>
<duration>10000</duration>
<stackedEffectMultiplier>0.5</stackedEffectMultiplier>
<stackLimit>5</stackLimit>
</ThoughtDef>
</ThoughtDefs>
After "Observed" I have placed the defname of those 3 items. What am I missing?
I'm guessing that they need <thingClass> but does that need me to create an assembly? Or if I do <thingClass>ModCute.CutePodBed</thingClass> will that be it?
Quote from: Crimsonknight3 on May 23, 2014, 05:22:37 PM
I'm guessing that they need <thingClass> but does that need me to create an assembly? Or if I do <thingClass>ModCute.CutePodBed</thingClass> will that be it?
That didn't work.... So in thought defs do I need to use the items label instead? E.g The Hello Kitty statue thingdef is Kitty, but its label is Cute Statue... Do I use the label without a space? .....
<?xml version="1.0" encoding="utf-8" ?>
<ThoughtDefs>
<ThoughtDef>
<defName>ObservedCutePodBed</defName>
<label>Observed horrifically pink bed</label>
<description>This is pink enough to make anyone feel ill!</description>
<baseHappinessEffect>-2</baseHappinessEffect>
<baseFearEffect>5</baseFearEffect>
<duration>10000</duration>
<stackLimit>3</stackLimit>
</ThoughtDef>
</ThoughtDefs>
Are you making something trigger it?
This one worked when I triggered it by changing the simple food thought def to this.
Quote from: Cala13er on May 23, 2014, 05:31:20 PM
StackLimit is obviously how many of the same thoughts a pawn can have at the same time.
Are you making something trigger it?
I assumed that in ThoughDefs the "Observed" in Def name was the trigger. I've looked at the cores defs for the gibbet cages and cremation inc's coffins/body bags for hints as to what is triggering it, or what is linking the thought to the item but I am just stumped lol I have tried everything I can think of by looking at other peoples xml's.
I guess the thought def is correct, I need to look elsewhere to find what exactly is triggering the thought...
My only guess is that the trigger is a custom assembly. I have looked through all of cremation inc's files and there is nothing I can see to trigger a thought in the thingdefs nor thoughtdefs so my only conclusion is that it's in the .dll.
Either that, or maybe a modder may tell me if there is a tag for putting Fear instead of <Beauty>
No, the ThoughtDef is just the effects of the thought.
The trigger is in the building classes theirself.
For example, in gibbet cages there is.
public Thought GiveObservedThought()
{
if (base.Position.FirstContainedStorableOrNull() == null)
{
return new Thought_Observation(ThoughtDef.Named("ObservedGibbetCageEmpty"), this);
}
return null;
}
And in Corpse there is this.
public Thought GiveObservedThought()
{
if (!this.sourcePawn.RaceDef.humanoid)
{
return null;
}
Thing thing = this.StoringBuilding();
if (thing == null)
{
return new Thought_Observation(ThoughtDef.Named("ObservedLayingCorpse"), this);
}
if (!(thing.def.defName == "GibbetCage"))
{
return null;
}
if (this.sourcePawn.Faction == Faction.OfColony)
{
return new Thought_Observation(ThoughtDef.Named("ObservedGibbetCageFullColonist"), this);
}
return new Thought_Observation(ThoughtDef.Named("ObservedGibbetCageFullStranger"), this);
}
So I need to add in a custom assembly to define the trigger? I have microsoft visual studio is that a good program to use? It's kinda confusing me at the minute.... I am trying to browse the cremation inc .dll just to familiarise myself but I can't really see anything other than for example Body bag -> BodyBag() GiveObservedThought().
Either that or I am over- complicating things and where can I find the building classes to simply edit with Notepad++ (Which I Usually use) if they aren't .dll :)
You are really over-complicating things :P
I'll make the dll for you if you want?
Quote from: Cala13er on May 23, 2014, 07:16:24 PM
You are really over-complicating things :P
I'll make the dll for you if you want?
I would appreciate that, but also if you could explain very simply how I can view the code in the .dll then I can see what you have done and work my way back from there so I know for next time I may need the knowledge :)
Download ILSPY, allows you to read assemblies code.
Here's the DLL
Download it, put it in your mods Assemblies folder, then in your CutePodBed's ThingDef change the <thingClass>Building_Bed</thingClass> to <thingClass>Building_CutePodBed</thingClass>
And it should work :)
[attachment deleted by admin: too old]
Okay did that and now I have read the code for cremation inc and I can see how you trigger the thoughtdef :) Going to have to look at a few tutorials explaining how to create .dll files for future reference aswell :)
Also thanks a lot for your help :)
No problem, also, if you use that dll in your mod. I would appreciate credit. :)
If you need any further help with dll's for your mod or whatever, just message me, I'm pretty decent with C# and I'm only improving. So just message us if you want help. I use Visual Studio Ultimate which costs $11,000 :P.
Quote from: Cala13er on May 23, 2014, 07:36:39 PM
No problem, also, if you use that dll in your mod. I would appreciate credit. :)
If you need any further help with dll's for your mod or whatever, just message me, I'm pretty decent with C# and I'm only improving. So just message us if you want help. I use Visual Studio Ultimate which costs $11,000 :P.
Damn!! I'm guessing you use it professionally!!! haha The closest I got to professional programming was a little web design as an apprentice but they were useless at teaching me... Basically plonked me in front of a computer with "HTML for dummies" and "PHP for dummies" and then off they set me then after 3 weeks wondered why I hadn't created a fully functioning website........ lol
I am just looking into a guide for how to create .dll's. Just figuring out how to create folders inside it... I guess Visual Studio for a complete beginner is pretty... Overwhelming lol
Of course I will give you credit :) - Going to edit it to add more items but anyone who helps me will get credit as this is my first foray into modding haha
[edit] ignore the folders part, when browsing the crem inc .dll when clicking a class it expands to show base types derived types etc - confused me >.<
Wohoo!! I created a whole new project on visual studio created the new classes managed to figure out to add rimworlds references, built it plonked it in changed the xml's and yay I did it >.> haha Thanks so much :D
Quote from: Crimsonknight3 on May 23, 2014, 08:53:06 PM
Wohoo!! I created a whole new project on visual studio created the new classes managed to figure out to add rimworlds references, built it plonked it in changed the xml's and yay I did it >.> haha Thanks so much :D
good job!!
Quote from: Cala13er on May 23, 2014, 07:36:39 PM
I use Visual Studio Ultimate which costs $11,000 :P.
Do entire codding for you:D
Just joking use him as much as you can his good at it :)
You guys should note that there are two types of thoughts, "conditions" and "memories". What you're doing is a memory, which is an expiring record of a single event. Conditions are things like "I'm hungry" and are about a situation that exists in the present. These are handled a bit differently, by reference to a class which holds a piece of code that defines the condition.