Skip to content

Random Periodic Interaction

Alite edited this page Sep 6, 2026 · 1 revision

This gene class causes the pawn to periodically interact and/or give thoughts to nearby pawns in the same faction. To use this, you need a special class and the EBSG Extension:

		<geneClass>EBSGFramework.Gene_RandomPeriodicInteraction</geneClass>
		<modExtensions>
			<li Class="EBSGFramework.EBSGExtension">
			</li>
		</modExtensions>

These are the relevant options from the extension:

  • intervalRange : Default (6000~12000) : How many ticks to have between interaction attempts. When the interval is over, the pawn will see if there's a pawn nearby for them to interact with, and the next interval will start regardless of whether or not there is
  • interaction : The InteractionDef to have between the pawns. If not used, then only the thought will happen
  • interactionThought : The memory to give the pawn being interacted with. If not used, interaction is the only thing used
  • thoughtAboutCarrier : Default (True) : When True, the target for interactionThought is the gene carrier. Otherwise, it's about a random pawn on the map in the same faction

This example is an adapted version of the Manipulative gene from the Highborn Xenotype which has the same functionality, but it uses this class for the gene and Random Opinion for the thought:

    <GeneDef>
		<defName>HBX_Manipulative</defName>
		<label>manipulative</label>
		<description>Carriers of this gene are born social butterflies, and enjoy using their talents to manipulate those around them through gossip in search of amusement.</description>
		<customEffectDescriptions>
           <li>Allows to engage in a special "gossip" social interaction with another pawn, changing their opinion of a random colonist to change in range from -10 to 10.</li>
        </customEffectDescriptions>
		<iconPath>UI/Gene_Manipulative</iconPath>
		<displayCategory>Miscellaneous</displayCategory>
		<displayOrderInCategory>128</displayOrderInCategory>
		<geneClass>EBSGFramework.Gene_RandomPeriodicInteraction</geneClass>
		<biostatCpx>1</biostatCpx>
		<biostatMet>0</biostatMet>
		<statOffsets>
			<SocialImpact>0.15</SocialImpact>
			<SlaveSuppressionOffset MayRequire="Ludeon.RimWorld.Ideology">-0.3</SlaveSuppressionOffset>
		</statOffsets>
		<modExtensions>
			<li Class="EBSGFramework.EBSGExtension">
				<intervalRange>600~1200</intervalRange>
				<interaction>HBX_Gossip_Interaction</interaction>
				<interactionThought>HBX_Gossip_Target</interactionThought>
				<thoughtAboutCarrier>False</thoughtAboutCarrier>
			</li>
		</modExtensions>
	</GeneDef>

	<InteractionDef>
		<defName>HBX_Gossip_Interaction</defName>
		<label>gossip</label>
		<symbol>Things/SpeechSymbols/HBX_Gossip</symbol>
		<initiatorThought>HBX_Gossip_Thought</initiatorThought>
		<initiatorXpGainSkill>Social</initiatorXpGainSkill>
		<initiatorXpGainAmount>10</initiatorXpGainAmount>
		<recipientThought>HBX_Gossip_Thought</recipientThought>
		<logRulesInitiator>
			<rulesStrings>
				<li>r_logentry->[INITIATOR_nameDef] and [RECIPIENT_nameDef] exchanged gossip.</li>
                <li>r_logentry->[INITIATOR_nameDef] shared a secret with [RECIPIENT_nameDef].</li>
                <li>r_logentry->With a wry look, [INITIATOR_nameDef] told [RECIPIENT_nameDef] a rumor about a fellow colonist.</li>
			</rulesStrings>
		</logRulesInitiator>
	</InteractionDef>
  
	<ThoughtDef>
		<defName>HBX_Gossip_Thought</defName>
		<thoughtClass>Thought_MemorySocialCumulative</thoughtClass>
		<stackLimit>1</stackLimit>
		<durationDays>1</durationDays>
		<maxCumulatedOpinionOffset>5</maxCumulatedOpinionOffset>
		<developmentalStageFilter>Baby, Child, Adult</developmentalStageFilter>
		<socialTargetDevelopmentalStageFilter>Baby, Child, Adult</socialTargetDevelopmentalStageFilter>
		<nullifyingTraits>
			<li>Psychopath</li>
		</nullifyingTraits>
		<nullifyingHediffs>
			<li MayRequire="Ludeon.RimWorld.Anomaly">Inhumanized</li>
		</nullifyingHediffs>
		<stages>
			<li>
				<label>gossiped with</label>
				<baseOpinionOffset>2</baseOpinionOffset>
			</li>
		</stages>
	</ThoughtDef>
	
	<ThoughtDef>
		<defName>HBX_Gossip_Target</defName>
		<thoughtClass>EBSGFramework.Thought_MemorySocialRandomOpinion</thoughtClass>
		<stackLimit>1</stackLimit>
		<durationDays>5</durationDays>
		<developmentalStageFilter>Baby, Child, Adult</developmentalStageFilter>
		<socialTargetDevelopmentalStageFilter>Baby, Child, Adult</socialTargetDevelopmentalStageFilter>
		<nullifyingTraits>
			<li>Psychopath</li>
		</nullifyingTraits>
		<nullifyingHediffs>
			<li MayRequire="Ludeon.RimWorld.Anomaly">Inhumanized</li>
		</nullifyingHediffs>
		<stages>
			<li>
				<label>target of gossip</label>
			</li>
		</stages>
        <modExtensions>
            <li Class="EBSGFramework.EBSGThoughtExtension">
                <range>-10~10</range>
            </li>
        </modExtensions>
    </ThoughtDef>

Other


Special Nodes

Clone this wiki locally