*disable_reuse not working

Hi, so this is a part of the script. Everthying except the disable_reuse command is working properly. Can somebody help me figure out what’s wrong in my script.

119 label line_119
120 if (aa=2)
121goto_scene chapter1 line_129
122 else
123
choice
124disable_reuse #Acquire a gun
125
goto_scene scene_gunchapterl
126disable_reuse #burner phones
127
goto_scene scene_phone
128 line_break
129 label line 129

A bit confused by your code but, it looks something like this?

 *choice
        #*disable_reuse Acquire a gun
            *goto_scene scene_gunchapterl
        #*disable_reuse burner phones
            *goto_scene scene_phone

if so makes sense why it doesn’t work the *disable_reuse command is typically used when you want to prevent the player from selecting an option that they have already chosen, However,
you’re using *goto_scene right after the choice, which means the player is taken to a different scene and won’t have the chance to reselect the option. Therefore, the *disable_reuse command isn’t necessary


Even though it goes to another scene it comes back to the beginning. Doesn’t matter which choice he makes until the user has chosen two times. Then the user continues with the story. What i need is that the user cant choose what he chose again when he comes back.

*create chosen_gun false
*create chosen_phone false

in startup


    *choice
        *selectable_if (chosen_gun = false) #Acquire a gun
            *set chosen_gun true
            *goto_scene scene_gunchapterl
        *selectable_if (chosen_phone = false) #burner phones
            *set chosen_phone true
            *goto_scene scene_phone

If chosen_gun is false, it means the player hasn’t acquired a gun yet. So, the option “Acquire a gun” will be selectable. If the player selects this option, it will be set to true, indicating that the gun has been acquired and making the option unavailable if the player returns to this point in the story.

Similarly, for chosen_phone

1 Like

Thank you for the help

Well, there’s your issue. If I’ve understood correctly, disable_reuse resets when you load another scene.

2 Likes

ETA: I misunderstood! You want to gray out the choices. In that case @coal8’s solution is correct. I’ve removed my post.

1 Like

This is I think the key issue. I ran into the same problem when I was looking at bringing out a subscene from one of my chapters to be its own txt file. I rolled it back into the main scene when I realized that jumping out of it would reset all my temp variables and hide_reuse/disable_reuses in the main scene.

How long are the subscenes we’re talking about in your game, @Gokul? @coal8’s solution works fine if you need to have separate scenes for gun and phone acquisition…but if those aren’t super-long, I’d suggest just using a *gosub for them rather than a whole new scene.

In that case, *disable_reuse should work just fine, without the need for creating extra variables and typing out the selectable_ifs.

(What counts as super-long will vary by your personal preference–I recognize that some people prefer to organize their story by shorter scenes rather than by labels within the main scene file. The subscene I’m talking about from my own game was 20,800 words and 1444 lines long, which is about the point where even I start thinking it might work better as its own txt file.)

Would a gosub take them back to the top of the choice, though? I thought the *return would take them back to inside the choice where the gosub is set. Gokul could do a goto though and just have that bit detailed elsewhere in the scene file. (Note: I don’t turn on implicit flow, so I don’t know how that’d affect things). The end of the, for example, scene for getting a gun could then just goto line 119 again.

Or, I guess you could:

    *disable_reuse # Burner phones
        *gosub get_phones
        *goto line_119

???

1 Like

@coal8 's method worked for my problem. Everything is working smoothly now.

1 Like

The subscenes are not that long just 1000 words each and my game as a whole has a small wordcount. I am creating the subscenes so as to maintain a beauty in the files i am working on.I am using variables in the startup itself and not using temp variables so i did not face the problem you have faced. It’s just you have to keep track of which variable names and name them in ways which you can track easily.
For eg
My variable names for chapter 1 are
aa - first a being the chapter number and second a the number of the variable used.

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.