Maybe I can explain what I think is happening here. The problem is that "return" isn't a command, but a special statement in programming. In memory, computers keep commands in a stack -- it works just like a stack of plates. If you have something like:
Code: Select all
MyPseudoCode:
main menu:
play start animation
call MyAwesomeFunction
play ending animation
So "main menu" will go on the stack, then it will "play start animation," and then MyAwesomeFunction will go on the stack. When MyAwesomeFunction is done running, the "return" statement at the end tells it to take MyAwesomeFunction off of the top of the stack and continue from where it left off (which is inside "main menu," right after "call MyAwesomeFunction"). At that point, it goes on to run "play ending animation."
So, line-by-line, this is what's happening in your code:
You go into the block labelled start, so the stack looks like this:
2. start block
1. main menu
Then the character says "Hello."
3. the end of the line of "Character" "Hello."
2. start block
1. main menu
Then you enter a new block, labelled repeat:
4. repeat block
3. the end of the line of "Character" "Hello."
2. start block
1. main menu
It runs the line with the links:
5. end of the line of "Character" "You can go {a= next}here{/a} or {a= final}here{/a}"
4. repeat block
3. the end of the line of "Character" "Hello."
2. start block
1. main menu
The player clicks final, so it jumps to final:
6. final block
5. end of the line of "Character" "You can go {a= next}here{/a} or {a= final}here{/a}"
4. repeat block
3. the end of the line of "Character" "Hello."
2. start block
1. main menu
Now it executes the line "Character" "Message text." Then it hits RETURN. Return tells it to take the top off the stack (because it's done with it). So right after the happens, the stack is:
5. end of the line of "Character" "You can go {a= next}here{/a} or {a= final}here{/a}"
4. repeat block
3. the end of the line of "Character" "Hello."
2. start block
1. main menu
The next line is "jump repeat." So it repeats. If the repeat were not there, it would finish the repeat block. There aren't any more commands in the repeat block, so by default, that would come off the stack and it would go back to the end of the Hello line. There's nothing after that, so that would come off the stack and it would go back to the start block, and there's nothing else in that start block, so it would go back to the main menu.
Return isn't unlike the Back button on a browser -- it goes back to where it came from; it's difficult to see in this case because of the nested labels. It's used in programming because you can (but don't have to) pass values with it.
I hope this explanation wasn't too technical.

Hopefully it'll help you understand the behavior so you can rearrange things to work as you want them to.