The Name command


#1

I’m trying to have the player pick his/her name, but i keep getting this error message: (startup line 28: Invalid create instruction, no value specified: name)

my startup page looks like this:

*choice
  #Deus.
    “I will forever be know as Deus, Kneel before me!”
    *set name “Deus”
    *goto gender
  #Dea.
    “I will forever be known as Dea, kneel before me!”
    *set name “Dea”
    *goto gender
  #Wait a minute, let me think.
      What would you rather be called master?
      *label input_name
      *input_text name

      *comment check the capitalization
      *if (“${name}” != “$!{name}”)

          Your official name is “ $!{name} ,did I get that right master?”
        
          *choice 
              #Yah, whatever.
                  *set name “$!{name}”
                  *goto gender
              #No, Stupid.
                  *goto input_name

My variables page looks like this:

*set magicPower %+10
*set gold 5
*set health 100
*set name
*set gender

I don’t know what i’m doing wrong? The gender thing is also the same issue. Please help.


#2

The startup txt spaces aren’t that close together, i have the right amount of spaces in the file.


#3

Um assuming you have a goto for the input_name label that I can’t see. You set the name after the if check.
*input_text name
*set name “$!{name}”

Those two lines will both set the name and auto capitalize. I think… well it does when I tried it. After that you can if check to your hearts content.


#4

thanks, i’ll try that


#5

@Pyromanci i’m still getting the error:

startup line 28: Invalid create instruction, no value specified: name.

when i try to play test the game.


#6

Um, hang on. What is on line 28 of the startup file? Is it

*create name “Random”

Or something similar?


#7

@Pyromanci In line 28 I have this:

*create name


#8

Ohhh. You need to give it a value so the startup knows whether it knows the value is boolean or a monkey. When you create a value add

*create name "placeholder"
or
*create name false
or
*create name 50

So it knows what kind of value it will be.


#9

In startup, at the beginning, you need to define all the variables. That means you need the line:

*create name “Andy”

Without this line (you can change the name), no matter what is on line 28, it won’t work.


#10

@andymwhy @Pyromanci I added the name “Deus” as the characters default name and I got this error message.
I did *create name “Deus”

startup line 28: Invalid expression, couldn’t extract another token: “Deus”

This is what is at the beginning of my startup file.

*create name “Deus”
*create health 100
*create magicPower 0
*create gold 0
*create fire 0
*create water 0
*create air 0
*create light 0
*create dark 0
*create gender “unknown”


#11

Um, I can’t actually see anything wrong with what you did. The error message usually indicates that you used a non alpha numeric character. Is there some kind of accent on the u or something that I can’t see?


#12

@Pyromanci no Deus is latin for God.
I really want to make this game. This is annoying the hell out of me. I’m going to try putting a number and see if it’ll let me change it to a name afterwards.


#13

Could try just setting it to “unknown” The set command should alter it anyway.


#14

@Pyromanci I tried that already. it gave me the same error only it put “unknown” at the end of it.
I tried putting numbers and it fixed the error, but in the stats it now says “name 0” and “gender 0”


#15

Oh wait, are you using a word processor program instead of a text editor to write? If you are then it will auto substitute brackets brackets for open brackets close brackets. Which are non standard characters. If this is the problem I would really suggest switching to notepad++. It’s free and will eliminate the 2000 problems a word processor program will cause


#16

@Pyromanci
the program i’m using could be a problem. I’m using Textedit for the mac.

I fixed my problem btw but i had to put it as 0 and change the name later. Its not letting me put things in “” and it keeps saying “could’t extract another token”

Now its giving me a problem for the gender, because the default choices are “Male” and “Female”


#17

It must be automatically changing the brackets. Try Notepad++ and you should be able to put the values back as you wanted them. All the helpful little changes most word processor programs make to keep you writing english can really screw you over when coding.


#18

A few things,

I would change magicPower to magic_power instead.
You can’t use the percentage increment if you start out at 0, so you need to set magic_power to 1 when you create it instead if you want to use percentage math.

As for the rest, you need to post more of the code. Use <(pre)> <(/pre)> Without the ()s, and paste the code between those brackets.


#19

@MutonElite

*comment Copyright 2010 by Dan Fabulich.
*comment 
*comment Dan Fabulich licenses this file to you under the
*comment ChoiceScript License, Version 1.0 (the "License"); you may
*comment not use this file except in compliance with the License. 
*comment You may obtain a copy of the License at
*comment 
*comment  http://www.choiceofgames.com/LICENSE-1.0.txt
*comment 
*comment See the License for the specific language governing
*comment permissions and limitations under the License.
*comment 
*comment Unless required by applicable law or agreed to in writing,
*comment software distributed under the License is distributed on an
*comment "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
*comment either express or implied.

*title The Quest for Ultimate Power
*author Aria-senpai
*scene_list
  startup
  animal
  variables
  gosub
  ending
  death

*create name true 
*create gender true
*create health 100
*create magic_power 1
*create gold 0
*create fire 0
*create water 0
*create air 0
*create light 0
*create dark 0


Welcome to Quest for Ultimate Power. Embark on your quest for magic strength, and strive to become the most powerful sorcerer or sorceress in the land. 

Copyright 2010 by Dan Fabulich.

Dan Fabulich licenses this file to you under the
ChoiceScript License, Version 1.0 (the "License"); you may
not use this file except in compliance with the License. 
You may obtain a copy of the License at

*link http://www.choiceofgames.com/LICENSE-1.0.txt

See the License for the specific language governing
permissions and limitations under the License.

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.

*page_break 

*label start
A small ball of pure magic energy floats over an a silver alter that sits on top of a pyramid shaped staircase. Mysterious men in long black and white cloaks circle the alter at the top of the stair case. 

One of the cloaked men walked up to the alter with a white waked candle that has a bright blue flame on top. The ball of energy gets more and more unstable as he walks closer. It finally siphons all of the man’s energy until nothing but his bones and cloak are left, tumbling down the stairs and past the other member’s feet. The candle falls as well, setting the temple ablaze.

*page_break 

The other members stand in shock as the blue flames engulf the surrounding stair case. As they try to escape the room the energy ball speaks. “How dare abandon me here in this poor excuse for a temple. Finish the ceremony!” One of the men walk up to you. 

“What is your name, oh great one?” 

*choice
  #Wait a minute, let me think.
      What do you want to be called master?
      *label input_name
      *input_text name
      *set name "$!{name}"

      Your official name is “ $!{name} ,did I get that right master?”
        
      *choice 
        #Yah, whatever.
            *goto gender
        #No, Stupid.
            *goto input_name

*label gender 
The room gets hotter and hotter. But, being a ball of energy you do not feel the rising temperature. But your subjects do. 

The man in front of you fans his collar.
“What is your gender master?”
*choice
    #Male
      “Ok, thats great and all, but i’m going to die *cough-cough* if i don’t get out of               here soon. 
        *set gender “Male”
        *goto rebirth
    #Female
        “We have to find you a body soon, before I *he summons a dome over you and himself, covering the alter.* Pieces of the ceiling fall on the shield.  
        *set gender “Female”
        *goto rebirth 
    #I am an un-gendered deity
        “Fine, fine can we leave now, I’m going to die soon!?”
        *set gender “Neutral”
        *goto rebirth

*label rebirth
“foolish human! You don’t get to leave until i acquire a body to take form.”
Pieces of the ceiling come crumbling down in a fiery blaze. 

*page_break

It comes to the point were the front entrance isn’t even noticeable anymore. The man runs down the staircase and up to the walls trying to escape. How inconvenient, you still need a body. What do you do?
    #Kill him and take his body
        You zap him with a stream of cosmic energy, ultimately killing him. His body gets covered in your energy as it floats in your direction. In a flash of light you fuse with his body, molding it like clay until you find a look that suites you.
        *finish
    #Ask him for his body
        “I need your body as my own so that I may begin my rule over this planet. Come here at once.” The man cowers towards you, unable to see now that the fire as covered the entire room in a blanket  of black smoke. 
        *finish

The error message is this,
startup line 99: Invalid expression, couldn’t extract another token: “Female”


#20

This is big enough to see it’s open brackets and close brackets. Sorry I should have spotted it earlier. All you need is a new program for now. You also don’t need to set magicpower to 1 unless you intend to set it as a percentage. If its a value it’s fine as it is. There is also no real reason to change the name, you could call it danceswithmonkeys and it wouldn’t affect the function as long as you could remember what it was and use it properly.