From a057d0477a0ef5ad1756ffc34a07885b0ac6ae9b Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 23 Oct 2023 12:20:42 +1000 Subject: [PATCH] Allow custom broadcasts on aspects. --- CUSTOM.md | 4 ++++ script.lua | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CUSTOM.md b/CUSTOM.md index 938d81231..79229d4b9 100644 --- a/CUSTOM.md +++ b/CUSTOM.md @@ -148,6 +148,10 @@ This section is meant for users who are familiar with both the tts mod and progr - `broadcast`: **string** - text to display when selecting spirit - Note: this needs to be set manually in json under **LuaScriptState** for spirit, anything set in **LuaScript** will be lost to spirit updater operation +### Aspect +- `broadcast`: **string** - text to display when selecting aspect + - Note: unlike the spirit broadcast, this can be set in the script + ### Adversary & Scenario - collision workaround - workaround for TTS bug https://tabletopsimulator.nolt.io/770 diff --git a/script.lua b/script.lua index 9abaa01ff..d80608afa 100644 --- a/script.lua +++ b/script.lua @@ -473,6 +473,9 @@ function onObjectEnterScriptingZone(zone, obj) for color,data in pairs(selectedColors) do if data.zone == zone then Player[color].broadcast("Using Aspect "..obj.getName(), Color.White) + if obj.getVar("broadcast") then + Player[color].broadcast(obj.getVar("broadcast"), Color.SoftBlue) + end break end end @@ -3761,6 +3764,9 @@ function runSpiritSetup() if obj.hasTag("Aspect") then Player[color].broadcast("Using Aspect "..obj.getName(), Color.White) + if obj.getVar("broadcast") then + Player[color].broadcast(obj.getVar("broadcast"), Color.SoftBlue) + end end end end