RimWorld

RimWorld

Anomalies Expected
 This topic has been pinned, so it's probably important
[Zerg03] MrHydralisk  [developer] 9 Jun, 2024 @ 11:00am
Custom Anomalies Modding notes, if Anomaly Expected used as dependency framework.
Classification
Classification being used so far
- Class 0 anomaly "Safe". Cannot lead to death of a colonist directly.
- Class 1 anomaly "Caution". May cause death of a colonist directly, during usage. For example if player doing a mistake.
- Class 2 anomaly "Warning". May cayse death of a colonist directly, if not prevented. For example if anomaly will try to kill colonist, but it could be prevented by player actions.
- Class 3 anomaly "Danger". Will kill colonist. If anomaly usage or it itself can and will kill colonist, whithout any way to save it, basically requiring a disposable colonists.
- Class 4 anomaly "Critical". Can result in death of all colonists in facility or result in a destruction of facility (colony survival).
- Class 5 anomaly "Apocalypse". Destruction or lethality or any other way it have very high chance of ending the current walkthough of a player.

Custom XML
IncidentDef

<workerClass>AnomaliesExpected.IncidentWorker_DeployFromOrbit</workerClass> // Best for spawning building on impact <modExtensions> <li Class="AnomaliesExpected.IncidentDefExtension"> // Extension for additional variables used by custom workerClass <DeployableObjectDef>AE_AnomalyBed</DeployableObjectDef> // Building that created on impact <SkyfallerDef>AE_AnomalyIncoming</SkyfallerDef> <ChanceFactorPowPerBuilding>0.3</ChanceFactorPowPerBuilding> // Multiplier to chance, if anomaly already exist on a map </li> </modExtensions>

<workerClass>AnomaliesExpected.IncidentWorker_DeployThingFromOrbit</workerClass> // Best for spawning multiple items on impact, similar to drop pod <modExtensions> <li Class="AnomaliesExpected.IncidentDefExtension"> <DeployableThingDefs> // Things list that spawned on impact <li>AE_ForbiddenFruit</li> </DeployableThingDefs> <ActiveDropPodDef>AE_ActiveDropPodAnomaly</ActiveDropPodDef> <SkyfallerDef>AE_AnomalyIncoming</SkyfallerDef> <ChanceFactorPowPerBuilding>0.7</ChanceFactorPowPerBuilding> // Multiplier to chance per already existing item from list on a map </li> </modExtensions>

ThingDef

<thingClass>AnomaliesExpected.Building_AE</thingClass> // Required itself or it code adoption, for custom description from study notes to work ... <comps> <li Class="CompProperties_Studiable"> <compClass>AnomaliesExpected.CompStudiableAE</compClass> // Helps with preventing null errors from vanilla code, if trying to give study points via method call without allowing studying <frequencyTicks>120000</frequencyTicks> <knowledgeCategory>Basic</knowledgeCategory> <knowledgeFactorOutdoors>0</knowledgeFactorOutdoors> <anomalyKnowledge>0</anomalyKnowledge> <minMonolithLevelForStudy>1</minMonolithLevelForStudy> <studyEnabledByDefault>false</studyEnabledByDefault> </li> <li Class="CompProperties_StudyUnlocks"> <compClass>AnomaliesExpected.CompAEStudyUnlocks</compClass> // Allow to use extended AE study notes <studyNotes> <li Class="AnomaliesExpected.AEStudyNote"> // Allow to change Label and Description of anomaly itself, with each unlocked study note (will pick latest ones) <AnomalyLabel>anomalous bed</AnomalyLabel> // Will change anomaly thing Label to this once this study note is unlocked <AnomalyDesc>A cozy mattress and sheets on a frame made of organic metal for resting. A colonist sleeping on this bed will rest abnormally quickly.\n\nProviding study knowledge about anomaly when someone sleep on it.\n\nClassified as Class-0 (Safe) anomaly.</AnomalyDesc> // Will change anomaly thing Description to this once this study note is unlocked <threshold>1</threshold> <label>#1/3 Ordinary bed study report</label> <text>Enhanced Cognitive Function Following Non-Standard Sleep\n\nSubject: {PAWN_nameDef}\n\nAbstract:\nThis report details observations of Subject {PAWN_nameDef} following a period of sleep on ordinary bed. This deviated from the typical sleep protocol within the facility. While Subject exhibited abnormally rapid sleep and atypical brain activity, no adverse effects were noted. Interestingly, upon awakening, {PAWN_nameDef} reported newfound knowledge directly related to ongoing anomalies research in the facility. This information appears unrelated to prior exposure within the facility, suggesting unconventional pathways to data acquisition. Current research protocols may not be optimally suited to study this phenomenon. Further investigation is warranted.\n\nObservations:\n{PAWN_nameDef} was permitted to utilize ordinary bed for sleep, deviating from the standard protocol.\nSleep duration was significantly shorter than the norm for Subject.\nBrainwave patterns deviated from baseline readings during sleep.\nNo negative physical or behavioral changes were observed post-sleep.\n\nOutcome:\nUpon awakening, {PAWN_nameDef} reported novel information relevant to ongoing research on anomalies in the facility.\nThe reported information was not previously known to Subject and could not be attributed to standard briefings or exposure within the facility.\n\nDiscussion:\nThese findings suggest a potential correlation between non-standard sleep and enhanced cognitive function, specifically related to anomaly research. Conventional research methods may not be sufficient to explore this phenomenon.\nTemporary anomalous bed has been classified as Class-0 (Safe) anomaly.\n\nRecommendations:\nFurther experimentation is required to substantiate these observations. Additional tests with {PAWN_nameDef} and potentially other subjects are recommended to explore the potential of non-standard sleep and acquisition of research-relevant data.</text> </li> ... </studyNotes> </li> </comps>

Thing Comp

<li Class="AnomaliesExpected.CompProperties_CanDestroyedAfterStudy"> // Similar to CompInteractable, but allow to destroy anomaly, while still allowing you to use CompInteractable for other things <ticksToActivate>180000</ticksToActivate> <maintainProgress>true</maintainProgress> <activateTexPath>UI/Buttons/Abandon</activateTexPath> <activateLabelString>Removal</activateLabelString> <activateDescString>Modify satellite data to make it teleport far away from the colony. [Will destroy it]</activateDescString> <guiLabelString>Choose who should remove this.</guiLabelString> <jobString>modify data</jobString> <activatingStringPending>modifying data for {0}</activatingStringPending> <activatingString>modifying data for {0}: {1}s</activatingString> <fleckOnAnomaly>PsycastSkipInnerExit</fleckOnAnomaly> // Fleck that will be spawned on top of anomaly, rather than fleckOnUsed, that spawning on user <fleckOnAnomalyScale>1</fleckOnAnomalyScale> <soundActivate>Psycast_Skip_Entry</soundActivate> <targetingParameters> <canTargetBuildings>false</canTargetBuildings> <canTargetAnimals>false</canTargetAnimals> <canTargetMechs>false</canTargetMechs> <onlyTargetControlledPawns>true</onlyTargetControlledPawns> </targetingParameters> <jobDef>AE_RemoveAnomaly</jobDef> // Job that will be called for pawn to go to anomaly and interact with it to destroy </li>

<li Class="AnomaliesExpected.CompProperties_UseEffectReplaceHediff"> // Will replace one hediff with other transfering it severity, when it ingestible <hediffDefFrom>Hediff_AEForbiddenFruit</hediffDefFrom> <hediffDefTo>Hediff_AEForbiddenFruitWithdrawal</hediffDefTo> <severityTransfere>1</severityTransfere> </li>

<li Class="AnomaliesExpected.CompProperties_UseEffectAddMentalState"> // Will give mental state, when it ingestible <mentalStateDef>Binging_Food</mentalStateDef> </li>

MinifiedDef

<minifiedDef>MinifiedThingAE</minifiedDef> // Will unminify itself, when not carried (when Spawned)
Last edited by [Zerg03] MrHydralisk; 9 Jun, 2024 @ 11:02am