First & Last Names?


#1

Oh hi. Nice to meet everyone here.

Getting right to it, I’m having some trouble placing the character’s first and last name in the coding, and yes, granted, there has been a thread about this before, but since this problem persists and I’ve found no such solution so far, I thought I should make a new thread… I’ve tried, specifically:

*create firstname “”
*create lastname “”

But it tells me that it won’t work, and that no such variables exist. I’m not sure what to change it into, as well as what to place in the stat chart. I’ve gotten far enough with just putting in:

Name: $!{name}

But I’m not sure if that can work with the lastname variable, if there is one, either. Plus, I’ve seen the other, recent thread with all that coding supposedly to be placed in the stat chart, but at that point, I get confused and I did try it out, but I think I did it, er, wrong.

Help, please? Thank you.


#2

Just a stab in the dark, but would this work:
*create firstname " "
*create lastname " "
*create name " "
*set name firstname&" "&lastname

I’m not sure, however!


#3

You need to put *create in the file startup.txt not the actual stats chart. choicescript stats is what appears when you click the show stats button in your game.


#4

Well, I did place the *create firstname “” & *create lastname “” in the startup text and it still said it didn’t work, however, I did not try putting the *create name"" after that. I’ll try it out now.

Okay, well… I tried it, and it works! So thank you! :smiley:

However, now I have another problem.

I’ve been using CoD as a reference to my coding, and to make sure that everything is right, and with the input name thing, I’ve done the capitalization check, which is as follows:
#None of these.
What is your name?
*input_text firstname
*if ("{firstname}" != "!{firstname}")
*goto last_name

Note that the *input_text firstname and the *if line has the same indent spaces.

However, now it says that the it “expected at least one line in ‘if’ true block”, and then the next page is blank, and I’m not sure what it means. However, if I pick one of the default names, it goes on as per normal.

Help again please? Thank you once more, sorry to be asking so many questions.


#5

@Random

I think you are making things more complicated than they need to be.


#None of these.
  *goto custom_name

*label custom_name
What is your first name...
*input_text firstname
...and your surname?
*input_text lastname
So you are $!{firstname} $!{lastname}.


#6

*create firstname
*create lastname
*create name
#None of these.
  What is your firstname?
  *input_text firstname
  What is your lastname?
  *input_text lastname
  *set name "$!{firstname} $!{lastname}"

I think I got it?

@Nocturnal_Stillness Damn you beat me!


#7

Ah… Alright then, sorry for making things so complicated, I’m just a bit confused xD

Thank you~


#8

@Random

It’s okay its how we learn.


#9

@2Ton now, when using the *create command, you have to specify a starting value:


*create variable

This will not work as no value has been specified


*create variable 50

This will work as the value has been specified

Unless you haven’t updated to the latest version of choicescript, in which case old commands will still work- although to get your game published it has to be compatible with the newest versions, I believe :slight_smile: