Multiple subsequent labels without all displaying


#1

Hello again everyone,

I’m having some trouble with creating multiple labels that are labelled one after the other and trying to not have them all be displayed.

Normally this wouldn’t be an issue because there’s usually either a *page_break or a *goto or *finish or something of that nature to where the labels don’t interfere with one another. However, in this case I’m doing a journal and I can’t have those commands since I want to keep it on one page that just adds more as it updates.

The journal is an addition to the stats page and has a separate page of it’s own. The point is that as the player goes through the game, the journal updates with entries as well as current tasks.

I want it to be dynamic, so if there are no entries and no tasks, it’ll say that. Then, it’ll update with the relevant information if there are new entries and tasks, and for the tasks specifically, it’ll change back to “You have no current tasks” once it’s resolved.

I do actually want it to display all previous entries with the current one, which is fine and I got that to work. My problem is that I also want to put current tasks on the same page, but for the empty task and entries, I don’t want to to display both “empty messages”.

I also need either a *goto or *finish for an *if statement, meaning I can’t just say if this requirement is met just display this.

I’m fairly tired while writing this at the moment, so please let me know if I need to clarify or if what I wrote doesn’t make sense. Thanks!

The code below explains further.

[i]Entries[/i]

*if entries = 0
	*goto emptyentry
*comment since "emptyentry" is found at the end of this scene, this has no issues.
*elseif entries = 1
	You have an entry in your journal.
	*line_break
	*line_break
	*goto entry1
*else
	You have a few entries in your journal.
	*line_break
	*line_break
	*goto entry#
*label entry1
[i]Entry 1[/i]

Some info here.
		

[i]Current tasks:[/i]
*if tasks = 0
	*goto emptytask
*comment Since "emptytask" is labelled before "emptyentry" and there's nothing else in between the two, it'll display both which I don't want. I can't figure out a way to have it only display what's under "emptytask". I'm not sure if there's a better command than just going to a label.
*elseif tasks = 1
	You have an ongoing task.
	*line_break
	*line_break
	*goto task

*label task
Blah.

*choice
	#Return to main stats
		*goto_scene choicescript_stats
	 #Check your backpack
		*goto_scene backpack
	#Consult your spellbook
		*goto_scene spellbook

*label emptytask
You currently have no tasks.

*label emptyentry
You have nothing in your journal

tl;dr: Too many labels without them going somewhere else. How can I display just one of them?


#2

I imagine that your journal will have this “Notification” section that always appears on top of any entries, am I right?

Hmm hmm hmm…
One thing that’s might worthy to know, is that your stats screen won’t be updated without progressing in the main story.

That means, the only way your stats screen updates itself is by pressing “Next” buttons on the main story.


By the way, you can truncate that code into this


[i]Entries[/i]

*if entries = 0
	You have nothing in your journal
*comment removed the label, and simply drag its text right to the *if commands
*elseif entries = 1
	You have an entry in your journal.
	*line_break
	*line_break
	*goto entry1
*else
	You have a few entries in your journal.
	*line_break
	*line_break
	*goto entry#
*label entry1
[i]Entry 1[/i]

Some info here.
		

[i]Current tasks:[/i]
*if tasks = 0
	You currently have no tasks.

*comment just as same as the entry one
*elseif tasks = 1
	You have an ongoing task.
	*line_break
	*line_break
	*goto task

*label task
Blah.

*choice
	#Return to main stats
		*goto_scene choicescript_stats
	 #Check your backpack
		*goto_scene backpack
	#Consult your spellbook
		*goto_scene spellbook

About your problem about you don’t want to both Entry and Task to show “No Message,” can you clarify it?
How do you want to present it to the player if both things are actually “No Message”?


#3

Just hide each section under a different *if command.

E.g.

*if (journal_entry_xyz)
     Entry #1 -- xyz
*if (journal_entry_abc)
     ...

You shouldn’t need a *goto or *finish for a standalone if.

Or, if journal entries are always going to be sequential, you could use a single counter variable.


#4

Here is one way to do that:

Code
*label mainmenu

[b]Which Journal entry do you want to see?[/b]

*choice
 #1
  *goto one
 #2
  *goto two
 #3
  *goto three
 #4
  *goto four
 #5
  *goto five
 #6
  *goto six
 #7
  *goto seven
 #8
  *goto eight
 #9
  *goto nine
 #10
  *goto ten

*label one
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed mi orci. Pellentesque quam enim, scelerisque a elementum id, vestibulum at elit. Suspendisse bibendum urna ut hendrerit finibus. Praesent viverra massa dui, vel porta 

nibh porttitor at. Donec in dignissim odio. Maecenas sit amet iaculis magna, quis iaculis diam. Curabitur eget risus ut nunc fermentum eleifend. Donec venenatis magna vel mi lobortis ultrices. Pellentesque non arcu ac erat ultricies 

efficitur vel quis lacus. Curabitur rutrum luctus suscipit.
*goto mainmenu

*label two
Vestibulum neque nunc, ornare vel vestibulum et, vestibulum eu nibh. Donec lobortis interdum dui et rutrum. Fusce libero odio, consequat sed velit a, scelerisque blandit libero. Morbi finibus dictum lacus in placerat. Etiam ultrices 

risus quis libero feugiat, eu consectetur risus dignissim. Sed et augue ultrices, fermentum felis ut, ornare ante. Fusce rhoncus elementum malesuada. Phasellus vestibulum odio sit amet mauris tincidunt scelerisque. Duis sit amet nulla 

ligula. Sed ullamcorper eu libero quis aliquet. Maecenas sagittis, massa at molestie iaculis, magna quam tincidunt lorem, at sodales lacus ligula ac eros. Proin at nisl vitae sem pretium tincidunt eget nec lorem. Orci varius natoque 

penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sit amet nulla egestas, cursus erat sed, facilisis nibh. Etiam eget malesuada felis.
*goto mainmenu

*label three
Maecenas faucibus est ut sagittis varius. Suspendisse non sollicitudin massa. Nam nec molestie nisl. Proin blandit lorem ante, non condimentum nibh accumsan ut. Duis sed porttitor urna. Nulla elementum nibh tempus libero imperdiet 

viverra. Nulla ut urna in nunc eleifend commodo quis sed libero. Suspendisse potenti. Nullam mollis non diam et egestas.
*goto mainmenu

*label four
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Maecenas tincidunt imperdiet diam, in tristique lacus commodo sit amet. Ut gravida sapien nunc, id porta ipsum suscipit id. Suspendisse elementum 

porttitor fringilla. Suspendisse interdum mattis diam in consectetur. Nullam ex mi, fringilla id lacus ac, posuere aliquet mi. Sed consectetur ante lectus, quis iaculis augue congue a. Donec cursus neque felis, sed iaculis dui ultricies 

eget. Sed sit amet tortor ligula. Phasellus ac metus sed ex pretium semper eget vel sapien. Fusce tristique porta nibh, quis porta velit dignissim eu. Vestibulum nec placerat enim.
*goto mainmenu

*label five
Aliquam tincidunt ipsum est, non pharetra mauris pulvinar ac. Donec tincidunt, ex vitae imperdiet sagittis, odio velit eleifend felis, at euismod dolor elit nec ex. Donec porttitor elit commodo pellentesque posuere. In malesuada nisl in 

nisl maximus, in efficitur dolor eleifend. Morbi ac sagittis lorem. Nulla nisl lectus, interdum et lectus vitae, vulputate dictum erat. Morbi sed mollis libero. Quisque eu arcu a nisl aliquam porta. Vivamus velit turpis, convallis 

molestie libero pretium, vulputate ultricies arcu. Nulla diam orci, elementum et lorem vitae, volutpat dignissim sapien. Morbi eu tempor turpis. Sed at pellentesque quam, a venenatis justo. Vivamus hendrerit pretium semper. In rhoncus, 

ipsum nec consequat sodales, urna leo bibendum urna, eu varius urna mi vel purus. Aenean laoreet tortor non malesuada maximus. Praesent lobortis dui molestie sodales pulvinar.
*goto mainmenu

*label six
In in mi tincidunt, fringilla justo in, facilisis erat. Nunc mauris urna, ultricies non turpis eget, ullamcorper faucibus erat. Mauris id tellus vestibulum, volutpat turpis id, elementum elit. Aenean interdum tellus non cursus pharetra. 

Sed id semper nibh. In urna nisi, tempus ut elementum vitae, auctor ac purus. Pellentesque rutrum eleifend ex, dignissim gravida leo convallis quis. Vestibulum libero orci, tincidunt non cursus vel, placerat vitae enim. Class aptent 

taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Mauris suscipit venenatis nibh id ultricies. Donec fermentum tortor ipsum, in gravida mauris cursus non. Phasellus diam magna, tempus in pulvinar id, 

vulputate eu sem. Phasellus nec risus eros. Etiam felis purus, tempor vitae convallis sed, auctor non tortor. Nunc tincidunt velit ac sem pellentesque suscipit.
*goto mainmenu

*label seven
Mauris rhoncus a eros eu pharetra. Aenean porttitor euismod purus vitae pretium. Donec laoreet, lectus a fermentum porta, turpis dolor hendrerit nulla, sit amet scelerisque felis arcu vitae ex. Quisque non diam nisi. In in rhoncus nunc, 

a egestas dolor. Integer lacinia nisi quis dui consectetur, et rhoncus nunc dictum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque vehicula, leo sed pretium iaculis, lacus sem dapibus nulla, euismod consequat 

turpis odio consectetur ipsum. Nulla consequat enim dolor. In ligula ipsum, dignissim non tortor eget, efficitur vestibulum risus. Proin dignissim diam massa, eget accumsan quam iaculis eget. Morbi aliquet feugiat risus, ultricies 

scelerisque enim tristique at. Aliquam sed hendrerit diam.
*goto mainmenu

*label eight
Sed dictum congue nibh quis mattis. Cras luctus purus non nibh malesuada, ac vulputate lorem laoreet. Quisque nec convallis metus, eu feugiat leo. Suspendisse potenti. In ex arcu, vulputate a rhoncus eu, venenatis ut ex. Aliquam quis 

vulputate elit. Aenean tempor cursus velit sit amet ultricies. Quisque rhoncus semper lacus, quis iaculis dui. Morbi porta finibus vehicula. Morbi lacinia volutpat felis eget lacinia. Donec nec ante quis lorem ultrices lacinia sit amet 

sit amet libero. Sed sed mi vitae eros congue euismod. Aenean sem neque, lobortis eu mauris eget, tincidunt luctus nulla. Integer id tincidunt magna, sit amet convallis tortor. Sed ut interdum felis.
*goto mainmenu

*label nine
Donec sed tortor velit. Sed ut lorem est. In laoreet vestibulum mi sed porttitor. Praesent ac ligula tincidunt, faucibus nibh eget, hendrerit justo. Nunc at viverra dolor. Suspendisse vitae euismod lectus, gravida ornare arcu. Sed in 

arcu eu quam cursus vehicula. Nunc in vulputate libero, sit amet lobortis dui. Cras sed aliquet nunc. Aliquam ut erat sed odio faucibus blandit eget tristique nisl. Mauris porta ultricies enim. Donec rhoncus libero vitae dui porta, sit 

amet aliquet nisi consectetur. Mauris ac cursus massa, nec hendrerit leo.
*goto mainmenu

*label ten
Nunc fringilla lobortis velit eget convallis. Vestibulum finibus diam nisi, vel ullamcorper justo dictum laoreet. Fusce semper sed mi nec porta. Fusce egestas sem ut dui vestibulum, vel euismod dolor blandit. Sed id leo massa. Aenean 

aliquam massa ante, efficitur malesuada turpis convallis in. Etiam sit amet leo tempor, efficitur tortor at, scelerisque ex. Nam varius iaculis est. Nullam ex erat, imperdiet quis odio sit amet, volutpat molestie sem. Sed commodo 

malesuada sem id ultrices. Nunc vitae scelerisque diam, vitae viverra justo. Sed a pharetra odio. Fusce porta odio et tristique rhoncus. Sed pretium purus quis fermentum faucibus. Vestibulum mollis urna eu dui imperdiet molestie. Sed at 

mauris et lorem eleifend tincidunt.
*goto mainmenu

#5

@Szaal I’m not sure yet if I want to put a notification necessarily. I may just have it update with the latest entry, but notify the player in game when a new entry appears.

Also, the code you put is actually what I tried before. However, I keep getting the error:
"It is illegal to fall in to an *else statement; you must *goto or *finish before the end of the indented block."
Even though I do have a *goto for both the *elseif and the *else. I’m not sure if I’m doing something wrong with the code itself? I also haven’t switched over the entries *if statement yet but I will if the task one works.

The code I have currently with the error:

[i]Entries[/i]

*if entries = 0
	*goto emptyentry
*elseif entries = 1
	You have an entry in your journal.
	*line_break
	*line_break
	*goto entry1
*else
	You have a few entries in your journal.
	*line_break
	*line_break
	*goto entry#
*label entry1
[i]Entry 1[/i]

Some info here.
		

[i]Current tasks:[/i]
*if tasks = 0
	You currently have no tasks.
*elseif tasks = 1 //this is where it's showing I have the issue//
	You have an ongoing task.
	*line_break
	*line_break
	*goto tasklist
*else
	You have a few ongoing tasks.
	*line_break
	*line_break
	*goto tasklist

*label tasklist
Blah.

*label emptyentry
You have nothing in your journal.

As for the “no message” I actually want them to be different. For entries it would say “no entries”, and for tasks it would say “no tasks”.

@CJW
So if I’m understanding correctly, I just have the entries set up as their own variables and they show up if the requirement is fulfilled? I may switch to this if I can’t get it to work.

Also on the same issue, I know I don’t require the *goto for a standalone, but should that be an issue if the *else and *elseif do have the *goto under them? Or do I need to have a *goto for the *if statement if it’s not a standalone? (You can refer to the code above for where my issue lies)

@Carlos.R
I had actually considered this, but I wanted it all to be on one page originally. However, I think in future I will switch to this for at least the entries since it may get tedious to scroll through just one page of all the entries, and also should get rid of my issues with the *if command.
Also may I ask how you collapsed the code like that?


#6

Hm.

Nope. Not for both.
You can go to this thread for moar info and examples about "standalone"s

Now, I’ll assume that both your [entries] and [tasks] variable have the value of 0, am I right?


#7

Hmm okay. I’m not sure then why I’m having the issue. I figured I should be able to put just a statement in the *if and it would be fine. However, that’s not the case.

Also yes, both are currently at 0.


#8

*GAASP :scream_cat:
I see!

*ahem
Okay, so, as the error states “you’ll need *goto,” you literally need a *goto command for the task.
It appears I misunderstood your problem and gave you a bad code suggestion. :expressionless:"
In that case… sorry.

Now, I think we better be back to your old code. So here we are!

Old code
[i]Entries[/i]

*if entries = 0
	*goto emptyentry
*comment since "emptyentry" is found at the end of this scene, this has no issues.
*elseif entries = 1
	You have an entry in your journal.
	*line_break
	*line_break
	*goto entry1
*else
	You have a few entries in your journal.
	*line_break
	*line_break
	*goto entry#
*label entry1
[i]Entry 1[/i]

Some info here.
.
.
.

*label emptyentry
You have nothing in your journal

[i]Current tasks:[/i]
*if tasks = 0
	*goto emptytask
*comment Since "emptytask" is labelled before "emptyentry" and there's nothing else in between the two, it'll display both which I don't want. I can't figure out a way to have it only display what's under "emptytask". I'm not sure if there's a better command than just going to a label.
*elseif tasks = 1
	You have an ongoing task.
	*line_break
	*line_break
	*goto task

*label task
Blah.
.
.
.

*label emptytask
You currently have no tasks.

*choice
	#Return to main stats
		*goto_scene choicescript_stats
	 #Check your backpack
		*goto_scene backpack
	#Consult your spellbook
		*goto_scene spellbook

In short, you’ll need to relocate both the ‘emptytask’ and the ‘emptyentry’

Emptyentry should go right above your task section, while for the emptytask go right above the *choice line. You can refer to that code :point_up: this time. :stuck_out_tongue_winking_eye:


#9

In my first example, after every journal entry, there is a *goto mainmenu

This returns to the main menu after the journal entry is displayed, so it will not continue trying to display all journal entries below it.

Here is another example, if you want to display journals based on how journal entries you found, however this example assumes you find journal entries all in a row, not at random.

Code
*temp howmany 0

*label mainmenu
[b]How many journal entries have you found?[/b]

*choice
 #0
  *set howmany 0
  *goto myjournal
 #1
  *set howmany 1
  *goto myjournal
 #2
  *set howmany 2
  *goto myjournal
 #3
  *set howmany 3
  *goto myjournal
 #4
  *set howmany 4
  *goto myjournal
 #5
  *set howmany 5
  *goto myjournal
 #6
  *set howmany 6
  *goto myjournal
 #7
  *set howmany 7
  *goto myjournal
 #8
  *set howmany 8
  *goto myjournal
 #9
  *set howmany 9
  *goto myjournal
 #10
  *set howmany 10
  *goto myjournal


*label myjournal
*if howmany = 0
 (You have no journal entries.)

 *goto mainmenu
*if howmany >= 1
 1st Journal Entry

*if howmany >= 2
 2nd Journal Entry

*if howmany >= 3
 3rd Journal Entry

*if howmany >= 4
 4th Journal Entry

*if howmany >= 5
 5th Journal Entry

*if howmany >= 6
 6th Journal Entry

*if howmany >= 7
 7th Journal Entry

*if howmany >= 8
 8th Journal Entry

*if howmany >= 9
 9th Journal Entry

*if howmany >= 10
 10th Journal Entry

*goto mainmenu

#10

@Szaal
Thank you! It seems my main issue here was placement. I added a couple more things and now it’s perfect. Thanks for all the help!

@Carlos.R
Sorry haha, I should have clarified. I meant how you collapsed the code in the forum formatting. I understood the code you did for the journal entries.

Thank you though for the other code example, I actually would prefer it in that manner since the entries are sequential when found.


#11

Oh, I see!
Ok so on the toolbar when you do a reply, there’s a gear on the far right.
When you click that, three different options pop up.
I used the “Hide Details” button.
Or, you can just use the code below, but remove the spaces inside of the [ ]

[ details=Summary ]

[ /details ]

The above, without spaces, would look like this:

Summary

Since there’s no text between the details nothing happens when you click Summary.
Here’s the code again, with words:

Summary

This text will be hidden

If you want it to say something other than Summary, you just change the word Summary to something else.

Ardentdragon

Hello there!


#12

@Carlos.R Oh okay, thanks so much!