-
Notifications
You must be signed in to change notification settings - Fork 2
Funeral Framework Actions
For the most part Actions you create will be specific to what you want to do. However here's the actions I have that might be useful. Also just some general info about them
- They are exposeable, and you need to write the data from the def as when loaded they wont check the def.
- They can't tick, and are never called again after the trigger. So use them to set things in your behavior. So the behavior can do any cleanup/ticking that needs to be done.
- Apply is what gets called when trigger happens. So you have to call ApplyToPawn from there.
- RitualStageAction_Multi is what you want if want multiple actions per trigger.
- Be careful of having an action that might destroy or despawn someone taking part in the ritual. It can instantly end the ritual. Next time I come across I'm tracing it in detail and seeing if I can stop it.
This was created so I could add the effecters and sounds for the person crafting. But it's a bit more flexible now
- SoundDef sound - Sound Sustainer you want (If you want a 1 shot sound RitualStageAction_SoundOneshotOnTarget exists)
- Bool targetRitual = true - This was added later, but this allows you to change the target B for the effecter from the ritual target to the roles cell
- string roleID - The role you are applying the effecter on
- EffecterDef effect - The effecter
Creates the sustainer, saves it to the behavior. Then calls the ApplyToPawn
This creates the effecters on the pawns. Then passes it to behavior.
The targetRitual flag makes the targetB of the effecter be the ritual target. Otherwise its Pawn. I dont think this worked exactly how I wanted it to. But that was because of the effecter itself. The target was being set to what I wanted.
Super simple. Just strips the corpse. Use this if you want the corpse stripped at a certain time of the ritual rather then at the end via outcomeExtension
This is a wonky one because I wanted some psycast effects in my Anima Burial. However it could be useful for quite a few things. Things spawned are saved to behavior then destroyed on cleanup. If the thing has CompProperties_DestroyAfterDelay I set it to be destroyed in # of ticks left in ritual.
- Dictionary<string,ThingDef> thingsToSpawnOn
- Key - This is the command for where you want to spawn it. It needs to be formatted a specific way or it wont work at all
Prefixes
- p_ - This denotes it should be applied on a ritual role. eg p_AM_RitualRoleCorpse to apply on corpse
- t_ - This denotes it should be applied on the ritual selected target. What comes after prefix doesn't matter
- r_ - This denotes a random max distance from the ritual target. Uses CellFinder.TryFindRandomCellNear. Validates only that cell is not filled so be a bit careful with this.
- Value - Just the ThingDef you want spawn
- Key - This is the command for where you want to spawn it. It needs to be formatted a specific way or it wont work at all
Prefixes
Does the parsing the KVP then calls Spawnthing based on that command
Does a GenSpawn of the thing, at cell based on command. Then sets the DestroyAfterDelay Comp to ritual ticks
This is 100% specific to just Dreadnought. But going to just put a few things I learned with this one here for my memory and it might help others
- This 100% should have been a RitualStageAction_Multi I didnt know it existed when I made it, then was too lazy to swap.
- If you want to hide the corpse for any reason. Like in this case I wanted it to be drawn somewhere else. Map.dynamicDrawManager.DeRegisterDrawable() is by far the best way I've found. Just make sure your behavior is ready to register it in cleanup in case its canceled.
- I tried and failed to find a way to draw my own meshes within the context of ritual. I'm sure there's some way, but I just hacked it onto the Selected Thing Draw via harmony. Below is pure nonsense im just putting down in case I revisit this problem
- LordJob has drawdebug which gets called by LordMangerUpdate
- That might be a smoother harmony patch to make it call my own draw
- That gets called by Map.MapUpdate() which has a few things. But MapComponents are updated so I could look at that for no harmony option
- Also considered my own thing with DestroyAfterDelay. Might be the best solution.
- Chances this comes up again are super low. I was just reluctant to patch VFE Pirates methods.