Inputting name code?


#1

I keep having trouble figuring out how to input a name into the story, I mean I don’t want the reader to be nameless …

So I’ve read that I need to put: *input_text name (as a choice)
And so when I write ${name} in a paragraph, I get an error message saying: “Line 3: Non-existent variable ‘name’.”

Can someone please help? I’m new to this, and have tried looking this up already and find no solutions.

If I make no sense, can someone please tell me the code for naming? Thanks!


#2

Pretty sure you have to put
{text_name} Not {name}
You want CS to list the name inputed by the player which is the words “text name”
The text part will always be in something like that bc you want CS to read it as Text not as a variable.


#3

no you have to do ${name} it works perfectly fine for me


#4

Hmmm, in that case, @SweetKiss did you define it at the beginning? Maybe that’s the problem?


#5

here try is wat i did
what is your name?
*input_text name.
hi ${name}.


#6

Hmmm, now that’s odd, if that’s what @SweetKiss did then it should work, @irule9344 when you defined your variables in the start did you list the name as one?


#7

Did you *create name and *set it as players choice?


#8

yeah i did maybe @sweetkiss din’t make a name as stat


#9

@sweetkiss did you put name as a stat and was it in text? if you don’y know what i am saying then you don’t know the scripting lang which means you have to learn that first


#10

I’m gonna go out on a limb and assume @SweetKiss is either asleep or busy and will get back to us in the morning


#11

anyways headhunter how is your game going rise of a pirate right? i want to play it but can’t find it


#12

Wait u can’t find it? Hold up one sec.


#13

@irule9344 I found it it should be on the 3rd page, strange… Anyways it’s going good, a bunch of artwork is being done, i should get the OS for my desktop later this week so we can finally start coding…


#14

thnx i din’t look on the 3rd page was too far lol


#15

Odd im doing rise of the dead… similair names


#16

Two different genres though, well we might rename it @WiReDcHiMpAnZeE


#17

I was just stating that the names where similair


#18

I know, you didn’t cause me to want to change it.


#19

Ok


#20

@Wiredchimpanzee, you should avoid *create; try defining variables in mygame.js:


Also, @SweetKiss, the reason for that error is you’ve forgotten to actually create the variable named “name” (check the link for Mygame.js to see how it’s done).