Pure Squiffy Enter Name

I want to know how to give my player the option to input their name just with Squiffy coding. If it's not possible, then I'd need to know where a tutorial is to do it another way.

Would it just be easier at this point to use preset names? I didn't want to do that, but I can come up with like twenty of them and stick them in and then just add more as time goes on for people to choose from...

I just really want people to be able to type in their own name and I don't want to have to use html or java or anything. If that's not possible, that's fine, I will use the preset list instead.


Hello.

As far as I know, you'll have to mix in a little HTML and jQuery code, but it's not much.

Here is a working example, which you are free to use - altered or unaltered:

This is an example game which shows how to get user input and save it as a Squiffy variable.

[[ENTER YOUR NAME]]

[[ENTER YOUR NAME]]:
<div id="name-input"><input type="text" id="player-name">

[[SUBMIT]](Submit Name)

</div>

[[Submit Name]]:
    squiffy.set("playerName", jQuery("#player-name").val());
    jQuery("#name-input").remove();
    
You have entered "{playerName}".

If correct, [[CONTINUE]].

If incorrect, [[TRY AGAIN]](ENTER YOUR NAME).

[[CONTINUE]]:
Thanks, {playerName}!

Now we can proceed!

Here's a really easy version. Someone showed me this trick...

[[Start]]:

Enter a name...

<textarea id="text_first"></textarea>

[[Click here when done]](verify name)

[[verify name]]:
    
    squiffy.set("Name", jQuery("#text_first").val());

Verify : name={Name}

See if that works.


Bluevoss you are the bomb, thanks so much, that's perfect. I can even do the thing twice for a surname.

And Richard Headkid, the goal was to be as close to pure Squiffy code as possible, but thanks for the effort you put into your reply.


Rika, I forgot to mention, but this line...

squiffy.set("Name", jQuery("#text_first").val());

...MUST have four spaces in front of it. Tab should work too. This is that java-scripting stuff that I use when I must. Also, this sort of thing ALWAYS must be at the front of a section - you can't have squiffy code in front of it. There are all sorts of weird rules about this sort of thing, but then again, I don't think there's a way do do this pure-squiffy.

Again, I picked this up from someone else in the site. Great place to get answers.


BTW, here is a superb reference to squiffy coding. It goes above and beyond the standard reference information. I was reading it, thinking, "Yes, sections, yes passages, blah blah". And then I got to the part on Attributes and it blew me away. This made my coding a whole lot easier (I used them on my example in the "romantic interest" thread earlier.

Print this out. Worth every page!

https://dynalist.io/d/kocz1psBWP_sDFR0bk8wApfY


the goal was to be as close to pure Squiffy code as possible, but thanks for the effort you put into your reply.

I understood the goal, which is why I led in with, "as far as I know, you'll have to mix in a little HTML and jQuery code, but it's not much."

I can't tell if you were trying to be nice or condescending, so I'll simply thank you for the effort you put into your reply.

Happy gaming!


Richard Headkid, how is thanking you for your efforts condescending?

I was telling you why I would choose Bluevoss's answer over yours, in that it was closer to being pure Squiffy, and shorter and easier to do.

Why does everyone on the internet always react to my friendliness with hostility, like I'm constantly insulting everyone when all I'm doing is showing courtesy? Or asking if someone understands me because I have problems with communication, and then they mock me for it like I'm calling them d*mb.


the goal was to be as close to pure Squiffy code as possible

The way that was worded, it could easily be interpreted as unpleasant. You reiterated the goal after I thought I'd made it clear that I understood that you didn't want to add any non-Squiffy code by explaining why my example contained a little bit of HTML and JS.

Reiterating once it's clear that someone already understands something seems a little condescending; does it not?

Anyway, I thought you were just being funny. That's why I said, "I can't tell if you were trying to be nice or condescending," then I tried to be funny by saying, "so I'll simply thank you for the effort you put into your reply."

I even capped it off with a "Happy gaming!"

Was that hostile? I thought it would make you laugh . . .

Hrmm . . .

I'll admit that I could have (maybe) worded things (a little) differently to avoid miscommunication, seeming how neither my jovial tone of voice nor my friendly smile can be transmitted via text.


PS

Since you asked (and, again, I'm not being hostile):

Why does everyone on the internet always react to my friendliness with hostility, like I'm constantly insulting everyone when all I'm doing is showing courtesy?

Let's take this statement:

I was telling you why I would choose Bluevoss's answer over yours, in that it was closer to being pure Squiffy, and shorter and easier to do.

Okay . . .

First off, for the record, I agree that Bluevoss is the bomb and that his code is shorter and easier.

Second, if I truly thought you were insulting me, I would have ignored you. It all seemed like good-natured word play to me.

Anyway, to the point: any intelligent person could look at the two samples of code and tell that his was shorter and easier to do. Why would anyone deem it necessary to point out something obvious to an intelligent person unless said notable was either (A) trying to be funny, (B) trying to be unpleasant, or (C) assuming the other person lacks intelligence?

I always assume the answer is A, but there are quite a few online folk who will always assume BOTH B & C.


Well, now I feel bad for having joked around. After reading through this today, I can see how my words could be taken the wrong way.

Sorry about all that. (I've been watching a lot of Terry Gilliam stuff lately, and that has a strange effect on my sense of humor.)

Best regards and happy gaming!


This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums