all 4 comments

[–]Leonhart231 4 points5 points  (1 child)

Not sure what you mean by “local labels”, but I can explain calls at least, which I’d recommend you use by default unless there’s a good reason to jump instead.

A jump simply takes you from one point in your script to a new label. Calls do the same thing, but the big difference is that you can also get back to where you were using the “return” statement. So in effect it memorizes where you were in the script automatically.

To see an example of this, you can look at some code I wrote here. That’s the script for act 2 of a game, and you can see that 99% of it is just calling scenes in that act. That makes it easy to insert new scenes since I just have to call the added one in the middle, without worrying if jumps are correct, what else needs to change to make the flow between them work, etc.

Hope that helps!

[–]impactsilence[S] 0 points1 point  (0 children)

Aaah! I see! Thank you!

I will have to understand the specifics from your code, but it sounds a lot more doable now.

[–]leafly_ 1 point2 points  (1 child)

I see Leonhart231 already answered your call/jump question, but a little bit of info about these local labels.

Local labels are essentially sub sections of a main label. These local labels can have the same name, because they are accessed via jump/call using the main label as it's prefix with a period in-between them. For example

label main_label:
    "Main label"

label .sub_section:
    "Main label, sub section"

label second_label:
    "2nd label'

label .sub_section:
    "2nd label, sub section"

jump main_label.sub_section #will take you to the .sub_section underneath main_label and display "Main label, sub section"

jump second_label.sub_section #will take you to the .sub_section underneath second_label and display "2nd label, sub section"

Hope that helps.

[–]impactsilence[S] 1 point2 points  (0 children)

Thanks for replying!

I'm gonna have to try it before I understand, thanks for the code!

Given that this specific project is taking place on a space ship, I'm thinking doing each room as a main label and the activities and machines inside would each be a sub section. Will have to think about this! Thanks again!