Closed TomaszewskiPatryk closed 5 years ago
In CYF, a special function is launched whenever the Player presses the Cancel (Shift or X I think) key. I'd rather not change how that function works for such a tiny detail, if you see what I mean. However if you really really think that's important, I'll let you try to convince me it is
Well, yeah, I think it is that important. Even though it is a small thing, it makes the whole skipping feature useless for texts that are longer than a single line (well, unless you spam both shift and Z and also do it in a proper order). And if any text should be skipped it would probably be the long, multi-line one. Just imagine having an opening dialog at the start of an encounter with 30 or more lines, which you have to listen to every time you die...
And for the "special function", you could theoretically consider it as two cases - one when you skip the text while it's being written (which is already implemented) and one that skips the text before it's shown (at the start of a new line, if shift is held down, simply call the same function which is used for skipping mid-line or add an [instant]
prefix to that line).
Can't you check if the player is holding Shift with Input.GetKey("Shift")
, at the same time they advance the text with Input.Confirm
, and then call Text.SkipLine()
?
That wouldn't work if the text changes automatically ([next]
or Text.progressmode = "auto"
) and when there is a [noskip]
flag. A better approach would be adding a function at the beginning of every line which doesn't contain [noskip]
, which skips the line if shift is held down. It's a decent workaround, but still only that - a workaround.
Here, I've written some very short code that does exactly what you want:
function EncounterStarting()
lines = {"line 1 line 1 line 1[next]", "[noskip]line 2 line 2 line 2", "line 3 line 3 line 3"}
text = CreateText(lines, {100, 400}, 200)
text.progressmode = "auto"
end
function Update()
if Input.GetKey("LeftShift") > 0 and text.isactive then
local currentLine = lines[text.currentLine + 1] -- currentLine is zero-indexed
-- check if the current line of text starts with [noskip]
-- unskippable lines should start with noskip, it'd make no sense otherwise
if not currentLine:find("%[noskip%]") then
text.SkipLine()
end
-- check if the current line of text ends with [next]
-- likewise, it would make no sense not to have [next] at the end of its text
if currentLine:find("%[next%]") then
text.NextLine()
end
end
end
Also, not important, but I had tried to get holding shift to auto-skip text to work in Undertale, but to no avail. Either way, I see no reason to add this to base CYF, especially considering how easy it was to write this code, sorry.
Anyway, hopefully this gives you what you wanted!
After seeing that holding shift is working in delta rune, I just assumed that the same applies to undertale, my bad. And since Rhenaud wants to keep CYF more undertale based than delta rune based, it's not really an issue.
Describe the bug You can only skip text by clicking shift while line is being typed. If you start holding shift before line starts appearing (and are still holding it while the line is being typed) it won't skip it. In original game it displays the line instantly if you hold shift before you press Z.
Setup: