It looks like you're new here. If you want to get involved, click one of these buttons!
{ (print: "<script>$('html').removeClass(\)</script>") (if: (passage:)'s tags's length > 0)[ (print: "<script>$('html').addClass('" + (passage:)'s tags.join(' ') + "'\)</script>") ] }|newGame>[I was born at sea.] (live: 2s)[(replace: ?newGame)[I was born at sea for a reason. (live: 2s)[(replace: ?newGame)[I was born at sea, to live at sea. (live: 2s)[(replace: ?newGame)[To fight at sea. (live: 2s)[(replace: ?newGame)[To rule the sea... (live: 3s)[(replace: ?newGame)['Oh, he's a lovely young boy, isn't he!' exclaimed your mother.(live: 2s)[ 'Yes, he most certainly is.' agreed your father, looking down at you as a baby and smiling, just as your mother did. (link: "'But what to call him is the question.'")[(replace: ?newGame)[(color: "red")[ {(link: "(either: 'Daniel','Francis','Charles')")[(set: $name to (prompt: "Please Enter A First Name:"))]} {(link: "(either: 'East','Kenway','Drake')")[(set: $sname to (prompt: "Please Enter A Surname:"))]} {(link: "(either: 'Ruler of Seas','Killer of Kings','The Champion','Death','Ruler of Seas','Killer of Kings','The Champion','Death','Ruler of Seas','Killer of Kings','The Champion','Death','Ruler of Seas','Killer of Kings','The Champion','Death','Ruler of Seas','Killer of Kings','The Champion','Death','Ruler of Seas','Killer of Kings','The Champion','Death','The Black Pearl')")[(set: $ship to (prompt: "Please Name Your Ship:"))]}] (if: $name is 0)[](else:)[(if: $sname is 0)[](else:)[(if: $ship is 0)[](else:)[ [[Accept ->Story]]]]]]]](stop:)]](stop:)]](stop:)]](stop:)]](stop:)]](stop:)
Comments
1. The <script> related code you have at the start (first five(ish) lines) of your example looks like it may of come from the Basic Harlowe Passage Tag Based Styling thread, it is not meant to be used within a standard passage, it is meant to be used within a header tagged special passage. You should remove it from this passage.
2. A (stop:) macro must be used within the associated hook of the (live:) macro it is stopping.
3. It is generally not a good idea to have multiple (live:) macros on a single page/passage, a better way to implement the effect you want is to use a single (live:) macro and to use (if:)/(else-if:) macros to check how much 'total time' has passed.
4. The (prompt:) macro returns an empty String value if the Reader/Player does not enter their own value. The following test can be used to check this, just leave the field empty and click on either the Ok, Cancel or little X button to close the prompt dialog.
** The next two points are semi-related to each other and to point 4.
5. Don't use an (if:) macro with an empty associated hook combined with an (else:) macro to test if a condition is not true (false), that is what the not Boolean operator is for.
6. You can use the b]and[/b] Boolean operator to test multiple conditions one after another.
7. An (if:)/(else-if:) macro is not automatically re-evaluated if the associated variable is changed, this means that you need to do that yourself manually.
So based on the above information a possible solution could look something like the following, it is made up of two passages.
A. Your story's first passage:
B. The Choose Name and Ship passage, this is where the 'tricky' stuff happens. lol
The first three (if:) macros are catering for the case where the Reader/Player does not enter a value for a prompt, this would cause nothing to be shown for the related link which would make it difficult to click on.
If you need anything explained, just ask.
Thank you so much! That's really important.
note: This is what I use to change the background colour, font and stuff like that along with a tag. It works perfectly.
When that code is placed within a header tagged passage it will allow you to do Tag Based Styling on every/any navigable passage in your story. If you use that code like you have (placing it within a navigable passage) then it only works in the passages you have placed a copy of the code in, which is an inefficient way to use that code.
Please, when will you write your twine book?