Linking extra screens to the stats page issue- I think it's fixed

Hi again, sorry need more help with the coding.

I need to link an acknowlegements/references page and a hints page somewhere ideally easily accessable, or at least accessable at the end of each run though.

I’ve tried linking it to the bottom of the stats page, however although it works sometimes, at others it ends up in a loop (ie if you press “return to game” or “stats screen” you either stay on the stat’s screen or return to the hints or references screen, there seems to be no way back to the game when that happens.)

Is there a way around this? I’ve noticed other people put extra screens linking to the stats screen, not sure why mine is doing this.

By the way it’s just a standard choice like this

*choice
#I need a hint on how achieve part of the game. 
        *goto_scene hints
        
    #References and Acknowledgements
        *goto_scene thankyous    

The references goes straight to the references screen and links back via a

    *choice
      #return to stats screen
         *goto_scene choicescript_stats

The hints page is via an “Are you sure” choice then has the same linkback as above.

*Edit- I tried taking the 2nd choice out and linking it on the 2nd “are you sure page” but it’s still looping. It looks as if the “return to game button” is treating the hints or the references page as the new set point for the story.

*2nd edit- actually I think I know what I’m doing wrong. I’m guessing it’s a problem because I’m linking to different pages. Will try putting them under labels on the same page.

I’m not sure how *goto_scene works from the stats screen. I know there were issues before but some of them were resolved, I think.

I would instead put everything at the bottom of the stats screen scene file as opposed to making a new scene.

You can’t use *goto_scene from the stats screen.

2 Likes

Oh! Duh! It was the setting stats on the stats screen thing that was fixed. :slight_smile:

The breaking the game by goto_scene from the stats screen, is still the infinite loop of horror (as well it should be.)

1 Like

Thanks guys :slight_smile: Yes I discovered how to create the choicescript infinite loop of horror lol (And although this might have caused the story to go on longer…much longer, I don’t think the two page circle would have impressed readers much).

I’ve moved the files around so I can use the goto command rather than goto_scene and I think it all seems to be ok now.

1 Like

IMPORTANT EDIT: I had not read your last comment, seems I purposelessly commented.
Still I’ll leave my code here in case you wanna take a look.

Instead of making it a seperate scene (problem is the stat screen and the main game aren’t seperated, if in the stat screen it says “goto_scene x” then it’s true everywhere)

Instead copy-paste your hints in a *page_break HINTS and *page_break THANK YOU
Or, a *choice *goto HINTS (instead of a goto_scene; this allows for the main game to stay exactly where it is)

*comment whether or not player found these weapons
*temp flashlight true
*temp handgun true
*temp knife true

*temp item "nothing"
*comment the item the player has in hand

*temp ammo 7
*comment number of clips for the handgun

*label statscreen
*stat_chart
	text flashlight
	text knife
	text handgun
	
*label inventory
*page_break BACKPACK
You can only hold one object at once. The flashlight is useful to see in the dark,
the knife is great for close combat and the handgun is great for
mid-range self defense. Which item do you want to pick?

You can only hold one item at once. Which item do you want to pick?

*fake_choice
	*selectable_if (flashlight) #Flashlight
		You pull out your Flashlight, you can now see in the dark.
		*set item "flashlight"
	*selectable_if (knife) #Knife
		You pull out your knife, you're now armed and ready.
		*set item "knife"
	*selectable_if (handgun) #Handgun, ${ammo} ammo clips left.
		You pull out your handgun, you're now armed and ready.
		*set item "handgun"
	#Keep everything in the bag, I want nothing in my hands.
		You have nothing in your hands.
		*set item "nothing"
	#Nevermind.
1 Like

I just added a fairly complicated function to my stat screen by creating a separate scene for it, then using gosub_scene to reference it. It seems to be working, besides a minor issue that could be unrelated to using that command.

Am I right in thinking that gosub_scene is fine to use with choicescript_stats, as long as you have a return command at the relevant places? Or do I have to copy the scene over to a label in choicescript_stats, like my other stat screen options have been?

I think that’s correct, as long as you remember to return you shouldn’t have any problems (i.e. don’t start using *goto_scene from within that *gosub_scene).