The Name command


#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.


#21

You created gender as a boolean, change it to a string, instead of true it should be “”.

Edit: And the same is true for name.


#22

Actually there is a reason, capitalization of variables is strongly discouraged. It’s easier to make logical mistakes otherwise.

The same is true for labels.


#23

I think you might be confusing variables with values. Capitals are avoided in values because string values are case sensitive. Variables themselves are not.


#24

As I recall it, while variables aren’t case sensitive in CS, they are in javascript? I believe it had something to do with that, could be wrong though.


#25

I think I may have to go and look that up in a panic… The make your own games tutorial on the main site specifically says feel free to play as they are case insensitive. If it turns out that only holds true till you actually want to publish I might need to do some serious editing…


#26

Why’re you doing this? *input_text name should work fine. The second won’t work. It’s also a bit pointless since it’s telling the game to set a variable as itself.

If you do want to set a variable as another variable, say you have a nickname stat and someone says they don’t have a nickname so you just want it the same as their name it’s just

*set nickname name


#27

The problem here is your curly inverted commas. You really need to use a text editor. You need to have " not “ ”

I would also suggest set it to female not Female.

If you’re on a PC I’d suggest Notepad++
If you’re on a Mac use Textwrangler.
If you’re on an Android I’m using DroidEdit there.


#28

*input_text name
*set name “$!{name}”

The second line tells it to replace name with the capitalized version of it’s self. It does work fine, although is only really useful for naming as far as I can see.


#29

Oh that’s awesome! I didn’t realise that. You learn someone new every day. If the name is capitalised does it leave things in place? I’m going to go add that to my tutorial since it’s a neat little trick.


#30

Yep, if it’s already a capital it actually does nothing. But it makes the stats screen look much better if they are automatically capitals.


#31

thanks guys, i fixed the problem. @FairyGodfeather was right i was doing " " instead “”. The program i was using also had a role in why it wasn’t working.