klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

No updates for "title", "tw-storydata name" and "_storySetTitle" #1494

Closed mmmsued closed 8 months ago

mmmsued commented 8 months ago

Describe the bug.

When I save a finished game under a new name in Twine (BUILD | PUBLISH TO FILE) to use it as a template for the next adventure, there is a problem.

Although the HTML file has a new name, neither "title", "tw-storydata name", nor "_storySetTitle" are updated in the source code. I have to open the source code and do it manually every time.

Steps to reproduce:

I open an existing Twine file and save it under BUILD | PUBLISH TO FILE as a new file with a new name.

Expected behavior:

I expect "title", "tw-storydata name" and "_storySetTitle" to match the new file name.

Additional context on this problem.

No response

Twine version number

2.8.1

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

Windows

If this problem is occurring with the web version of Twine, what browser does it occur on?

None

Presubmission checklist

klembot commented 8 months ago

Can you upload an example problem file? I tried publishing a small story to file and I can see both that the <title> tag is set correctly and <tw-storydata> has the correct name attribute. I'll attach it here in case it helps clarify the situation. I don't know what _storySetTitle is, though.

Title Test.html.zip

greyelf commented 8 months ago

@klembot

I believe the OP is reporting that the project information in the saved HTML file doesn't match the name they gave that file.

eg. they have a Twine Project named Apple; they named the published Story HTML file banana.html; the project information in the HTML file still references Apple.

mmmsued commented 8 months ago

@klembot I open a file namend "neu.html" via LIBRARY | IMPORT. Then I save it with a new name (“cats adventure”). When I open this file (“cats adventure.html”) in a web browser, the tab at the top still says “new” and not “cats adventure” (see attached images).

When I try to import the "cats adventure" file back into Twine (LIBRARY | IMPORT), I can select it in the open dialog but can't actually open it. Because for Twine this file is still called "neu". The only way I could import the new “cats adventure” file is to overwrite the old file "neu" - which I don't want because I obviously want to keep both files.

I use Twine 2.8.1, Windows 10, as Storyformat SugarCube (v2.36.1)

pictures-and-files.zip

greyelf commented 8 months ago

@mmmsued The following are the steps required to achieve the "create a 2nd project based on an existing project" outcome you want.

note: the 1st step is only required if your Story List doesn't already contain a neu Project.

  1. Use the Library > Import options to import neu.html file into the Twine 2.x application. This will result in a Project named neu being created.
  2. Select the neu project in the Story list, then use the Story > Duplicate options to create a copy of that project. This will result in a Project named neu 1 being created.
  3. Select the neu 1 project and use the Story > Rename options to open the project rename dialog, then enter cats adventure into the field and select the OK button. This will result in the name of the neu 1 project being changed to cats adventure.
  4. Open the cats adventure project, find & select the first Passage you want to be shown, then use the Passage > Start Store Here option to make it such.
  5. While the cats adventure project is open, use the Build > Publish to File options to generate a Story HTML file named cats adventure.html.
  6. Open the cats adventure.html file in your web-browser, and review its contents. You will see that it has the correct project information.
mmmsued commented 8 months ago

@greyelf Thanks! It works!

klembot commented 8 months ago

Thanks for clarifying @mmmsued and thanks for the advice @greyelf! This is intended behavior. There are use cases where you'd want to publish to, say, index.html so that your story can be the default web page for a directory without changing its name.

I added some documentation around this here because the docs don't explain this.