"Clear Previous Turn" Not Working

chellkafka
20 Dec 2015, 16:40
For some reason, that command isn't working for a specific game of mine, but it does for others.
Does anyone know how to fix that or how to find out why?

jaynabonne
22 Dec 2015, 23:21
From what I can see by looking the Quest core code, a new turn section is created when the player enters a command. Whatever was output before that command is considered the last turn.

In your case, a command is never entered. You *are* using a {command} text processor command, but it's always within the context of a "get input", which is eating the command. It comes in as the result of the "get input" and is never seen by the parser. (Which is fortunate, since you'd have to implement all those commands!) So a new text section is never created.

If you use the HTML tools to look at the output in the output divs, you'll see that all your output is inside the same section. A new section is never created. There ends up not being a "last" section.

A simple way to fix it is to change this:

HidePreviousTurnOutput

to this:

StartTurnOutputSection
HidePreviousTurnOutput

That way, a new section is created and the current text then becomes the last output just before you hide it.

(BTW, thanks very much for attaching a game file exhibiting the problem. It made solving it much easier, especially since I didn't know what "Clear Previous Turn" was to begin with.)

OurJud
23 Dec 2015, 00:33
Jay! While you're in a 'hiding things' mood, take a look at this and see what your soft matter can come up with.

If you get a sense of deja vu while reading, then don't worry, it's because I had a lengthy thread on the issue last December.

viewtopic.php?f=10&t=5754 (You can actually skip to the new developments when Alex joins in at post #4)

HegemonKhan
23 Dec 2015, 00:51
jaynabonne wrote:From what I can see by looking the Quest core code, a new turn section is created when the player enters a command. Whatever was output before that command is considered the last turn.

In your case, a command is never entered. You *are* using a {command} text processor command, but it's always within the context of a "get input", which is eating the command. It comes in as the result of the "get input" and is never seen by the parser. (Which is fortunate, since you'd have to implement all those commands!) So a new text section is never created.

If you use the HTML tools to look at the output in the output divs, you'll see that all your output is inside the same section. A new section is never created. There ends up not being a "last" section.

A simple way to fix it is to change this:

HidePreviousTurnOutput

to this:

StartTurnOutputSection
HidePreviousTurnOutput

That way, a new section is created and the current text then becomes the last output just before you hide it.

(BTW, thanks very much for attaching a game file exhibiting the problem. It made solving it much easier, especially since I didn't know what "Clear Previous Turn" was to begin with.)



ooo... I'm hoping this stuff will work for my problem... HK crosses his fingers...

(are these command~functions, internal ones, or are they normal ones?)

I wanted to do 'get input' and a 'text processor command hyperlink', it's for character creation, I'd love to be able to be use both in a single Function, and I hope your post Jay means that I can... (the reason for why I want to be able to do this: using get input for your choice selection, and using the hyperlink for a pedia enrty, either a 'ask' Function popup window or separate Functions usage of text area)

anyways, could you look into and~or let me know if your post methods will allow for 'get input' and a 'text processor command hyperlink' to work in the same Function?

jaynabonne
23 Dec 2015, 07:49
HK, have you taken a look at the file chellkafka posted? It sounds like it's what you're asking! It uses turnscripts, but each turnscript is self-contained, so you should be able to drop the same technique into a function instead.

OurJud: I'll take a look when I get home from work tonight.

HegemonKhan
24 Dec 2015, 03:12
@ Jay:

Unfortunately, I couldn't figure out how to get it to work, so I don't know if it can work, and I just don't understand the stuff well enough, to figure out how to get it to work, or if it can't work.

...HOWEVER...

I used your comment on how the 'get input' was eating up the Command's input... and I got it to work! (YEAH!)

I'm not sure if the way I did it is the most efficient way (not sure if there's "stacking ~ non-tail-end" recursion, and if there is, not sure how bad it is or isn't)