Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

About your default name problem, but maybe I misunderstood what exactly the problem is:

You can just do the same with the default name as you did with other variables like magic, by typing a default name inside the quotation marks instead of leaving them empty. For example:
(set: $firstname to "Alix")(set: $lastname to "Dalton")

You can also have a default text displayed in the text input boxes by writing it in the quotation marks of the value segment. That will not yet set the variable to the displayed text though. That only happens upon executing the confirm button:
<input class="box" type="text" name="firstname" value="Alix">

(+1)

See, I was doing the (set:) but it would only set ONE of the names for some reason? The second name will ALWAYS be 0. I tried both setting the value on click to the next passage, and setting them at the start of the next passage, and either way it would always set the first name and never the last. And then if I try setting a default value then it'll for sure show up in the box, but unfortunately if that "confirm" button isn't clicked then nothing is set and the whole name is 0.

Thanks for suggesting the value thing though, I hadn't thought of that. I think that would work but it's something to do with how the javascript is being made to work with Twine. It might be inevitable that those 'confirm' MUST be clicked. I could always set a default name when I initialize the variables... thanks again 🧡

(+1)

Have you tried out a combination of (set:) and (prompt:) yet? It's a bit intrusive as (prompt:) makes a text box pop up instead of it being smoothly set inside of the text. And cause the prompt pops up as soon as it's loaded, I combined it with a (link:) that only reveals/loads the rest of the passage upon clicking it. You can leave the part where I wrote "Charlie" empty, that'd just be the default text displayed.

I don't have that much experience with Harlowe though, I've so far mostly worked with SugarCube. Might be that there are better ways for this:

You've always held the deeply insignificant belief that the text is wrong: your (link: "first name...") [==
(set: $firstname to (prompt: "Your first name...", "Charlie"))

...seems to be a little larger than your (link: "last name...") [==
(set: $lastname to (prompt: "Your last name...", "Birmington"))

...but when you'd asked if maybe a mistake had been made, the man at the desk had said it didn't matter...

(+1)

I actually specifically did it this way to avoid using prompt because I hate the timing of the prompt (ie I have to give names their own passages because they will pop up right away) and I hate that it clashes with the aesthetic of the game and breaks immersion. This isn't a perfect solution but I have used prompt and wanted this code on purpose to avoid it 😅😅 

(+1)

Okay, my last attempt! This must be annoying, I'm sorry.
First, the variables $firstname and $lastname have to be set/created somewhere so that the variables actually have a value, even if it's "".
(set: $firstname to "", $lastname to "")

Then on the passage where the player inputs their name, I tried to figure out how to force the player to do so. Allowing the player only to continue once they hit those "Confirm" buttons.

My solution now was to turn [that was that.] into a named hook.
Then I created an (even:) that checks whether $lastname and $firstname have the value "" or not.
Once both variables have a value that is not "", the named hook gets replaced with a passage link.
Meaning the player can only continue once both names have been set.

See below:

...but when you'd asked if maybe a mistake had been made, the man at the desk had said it didn't matter, and [that was that.]<goto|
(event: when ($firstname is not "") and ($lastname is not ""))[(replace: ?goto)[[[that was that.->prologue_6 start]]]]

(+1)

Oh no it's not annoying !! I'm glad to have another set of eyes on it !! And it probably would be good to at least be able to inform people when they haven't hit the right buttons huh, although I still would rather just set a name for them. I think my big issue isn't so much worry that people will forget, more or less that there's a subset of readers who aren't interested in picking a name at all and would usually opt for a default.

am initializing first and last name to be blank, but I did so with the intent of setting a name if the names had not been set using confirm, which circles us back around to "it only works for ONE of the variables for no particular reason". My prior idea to set a "default" name while initializing the variables and then allowing them to be overwritten with the confirm button yielded results though !! Not functioning results, but I'm finding that regardless of how first and last name are intialized, the javascript will always overwrite them with null value 0 if the confirm button isn't clicked. Even setting the value in the HTML is moot if the confirm buttons aren't clicked.

OH I JUST DID IT !! I made the (set:) on the subsequent page check for both a variable that was equal to zero and a variable that was completely unset. I think the reason for it only working for one or the other when I attempted one way or another is because I think the code is meant to serve one name box on one page, s I think one name was being set t value blank, or whatever value was in the HTML, and the other one wasn't being set at all.

Or, whatever. I'm going to upload that change, thanks for talking through it with me !!

I usually use (link:) on twine when I'm using the prompt macro and then stick the variable there so it prints their name once they've entered it- (link: "Change")[(set: $name to (prompt: "Your name", "whatever"))$name]

I also use the (if:) macro for making sure they've changed their name from the default I set earlier, and only let them continue once they have, with the help of (live:), so that they have to open the link in order to continue.

The HOOPS that Harlowe makes us jump through to set custom string variables smh 😩 I usually just punish naughty users who don't set their name by giving them a default one. I figure that does double the work because then if people don't want to bring out the ol name generator they can just take whatever I give them 😂

Yeah, when I started playing I forgot to click confirm on my name so I just reloaded the page :)