thesePeople / CustomRitualFramework

A mod for the game Rimworld that adds a framework for adding new custom Ideological Rituals
5 stars 1 forks source link

Create BehaviorWorker to require stuff for the ritual (or maybe not a BehaviorWorker, but something) #4

Closed thesePeople closed 3 years ago

thesePeople commented 3 years ago

Although I have this in progress, my early tests suggest there's a reason they didn't have this functionality in place. Searching an area for a building is a fairly expensive operation to be performed in the CanStartRitualNow function, since that runs very frequently when a ritual spot is selected to decide on the Gizmos.

I have the logic more or less working for TryExecute, but it allows you to bring up the ritual confirm window and then just doesn't start the ritual unless the specified building is present (i.e nearby the start spot).

It may be better to just implement this as a customizable RitualTargetFilter, though showing that the ritual can't be started due to the lack of the building in the ritual confirm dialog is also potentially an option.

thesePeople commented 3 years ago

decided to implement as a ritualstage cancellation trigger, like lightball parties