0 votes
by (750 points)
edited by
More for bugtesting, is there a way to unlock the manual save and load into a twine game by typing in a password?

 

save state is set to autosave, but would like an option to load save states to bugtest variables  and save time.

 

The idea is to have it hidden by a variable in the sidebar and unlock it by typing in a password at a already made password menu.(using twine's built in save/load menu.)

1 Answer

+1 vote
by (157k points)

You don't state this but based on your question I am assuming that you have somehow hidden the standard Saves button.

It is unclear what you mean when you say "the manual save and load", are you talking about:

1. Revealing the standard Saves button again.

2. Showing custom links in the side-bar which make reference to the save & load functions of the Save API.

The conditional part is fairly easy, simple store the 'password' in a story variable and then use an <<if>> macro based on the current value of the variable to determine what should be shown.

<<if $password is "some value">>/* include code to 'show' manual save & load. */<</if>>

... where exactly you place the above code depends on the answer to my previous quesion.

warning: Because you are making a HTML based web-applicaton the end-user has full access to the source code of your story HTML file, this means it is fairly easy for them to determine what the required 'password' is.

by (750 points)
Yes, the save and loading is hidden and autosaves.

 

Not worried of the password becoming known, as I can remove it later .

 

 

Also is the code to enact this really that simple?

 

The idea is to have the save/load menu hidden via a password. The game autosaves and the user can load saves if they made X progress. This idea is to share save states with bug testers; limiting the access to people who know the password.

 

 

....if that makes sense.
by (157k points)

Based on information you supplied on the Twine Discord server I now know you are using CSS within your Story Stylesheet area to hide the standard menu buttons, I also now know you want the standard Saves button to conditionally re-appear.

1. Replace your existing **menu-core** based CSS with the following.

#menu-item-saves, #menu-item-restart {
	display: none;
}


2. Use a <<if>> macro like the following after your "please enter a password" code to cause the Saves button to be shown when the password is correct.

<<if $password is "some value">>
	<<run $("#menu-item-saves").show()>>
<</if>>

note: You obviously need to replace the "some value" in the above with your own String value.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...