From 0c82e80e48d4d39e65adbc156dd662e8f094d557 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 26 May 2020 16:40:37 -0400 Subject: [PATCH] Allow triggering MSBs from Responders. --- korman/nodes/node_messages.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/korman/nodes/node_messages.py b/korman/nodes/node_messages.py index de436e5..64c9e03 100644 --- a/korman/nodes/node_messages.py +++ b/korman/nodes/node_messages.py @@ -831,6 +831,34 @@ class PlasmaTimerCallbackMsgNode(PlasmaMessageWithCallbacksNode, bpy.types.Node) return msg +class PlasmaTriggerMultiStageMsgNode(PlasmaMessageNode, bpy.types.Node): + bl_category = "MSG" + bl_idname = "PlasmaTriggerMultiStageMsgNode" + bl_label = "Trigger MultiStage" + + output_sockets = OrderedDict([ + ("satisfies", { + "text": "Trigger", + "type": "PlasmaConditionSocket", + "valid_link_nodes": "PlasmaMultiStageBehaviorNode", + "valid_link_sockets": "PlasmaConditionSocket", + "link_limit": 1, + }) + ]) + + def convert_message(self, exporter, so): + # Yeah, this is not a REAL Plasma message, but the Korman way is to try to hide these little + # low-level notifications behind higher level abstractions, so here you go. A notify message + # that only targets plMultiStageBehMod. You're welcome! + msg = self.generate_notify_msg(exporter, so, "satisfies") + + # The MultiStageBehMod needs to receive the avatar key that whatdonetriggeredit. We don't know + # this information at export-time, but plResponderModifier::IContinueSending will interpret + # a collision event as "ohey, let's add the avatar key for MSBs" - nice. + msg.addEvent(proCollisionEventData()) + return msg + + class PlasmaFootstepSoundMsgNode(PlasmaMessageNode, bpy.types.Node): bl_category = "MSG" bl_idname = "PlasmaFootstepSoundMsgNode"