| Name | Typ | Von |
|---|---|---|
| Hintergrundtext löschen (mehrere Optionen) | Definition | AFRLme |
Mit diesem Skript rufst du eine Funktion auf, die gerade angezeigte Hintergrundtexte beendet: die des aktuellen Charakters, die aller Charaktere oder alle Hintergrundtexte überhaupt.
Anweisungen
1. Füge das Hauptskript im Skripteditor von Visionaire Studio hinzu und lege es als Definitionsskript fest.
2a. Um alle aktiven Hintergrundtexte zu beenden, legst du einen Aktionsteil Skript ausführen an mit ...
killText(1)
2b. Um alle aktiven Hintergrundtexte von Charakteren zu beenden, legst du einen Aktionsteil Skript ausführen an mit ...
killText(2)
2c. Um den aktiven Hintergrundtext des aktuellen Charakters zu beenden, legst du einen Aktionsteil Skript ausführen an mit ...
killText(3)
2d. Um aktive Hintergrundtexte des Erzählers zu beenden, legst du einen Aktionsteil Skript ausführen an mit ...
killText(4)
Hauptskript
--[[
Kill background text (multiple options) [v4] (15/04/2017)
Written by AFRLme [Lee Clarke]
-- + --
email: afrlme@outlook.com
paypal: afrlme@zoho.com
patreon: https://www.patreon.com/AFRLme
portfolio: https://afrl.me
-- + --
This script is donation optional. In game credit is non-negotiable.
You are free to: ¹ use it in your game(s). ² modify the script.
Do not remove - or edit - this comment block.
--]]
-- * tables * --
txt = {} -- create table
txt["_temporary_"] = "" -- set table as temporary
-- * function which kills active background text (1 = all, 2 = all characters, 3 = current character, 4 = narration texts) * --
function killText(val)
for i = #txt, 1, -1 do
if val == 1 and txt[i].Active then txt[i].Active = false -- all background text (both character &; narration)
elseif val == 2 and txt[i].Active and txt[i].Owner:getId().tableId == eCharacters then txt[i].Active = false -- all character background text
elseif val == 3 and txt[i].Active and txt[i].Owner:getName() == game.CurrentCharacter:getName() then txt[i].Active = false -- current character background text
elseif val == 4 and txt[i].Active and txt[i].Owner:isEmpty() then txt[i].Active = false -- narration background text
end
end
end
-- * on text display function * --
function sText(text)
if text.Background then table.insert(txt, text) end
end
-- * function for text finished * --
function eText(text)
for i = #txt, 1, -1 do if not txt[i].Active then table.remove(txt, i) end end -- if text is inactive, remove from txt table
end
-- * event handlers * --
registerEventHandler("textStarted", "sText") -- event handler for begin text
registerEventHandler("textStopped", "eText") -- event handler for end text