I keep getting a coding error. Could anyone help me find the problem?

the error is
line 15: invalid expression, couldn’t extract a token: 's_Transformations “??”

Here is the code that the error is in

\*title Trial of the Demon Hunter

\*create Name "??"
\*create Gender "??"

\*create Morality 50
\*create Courage 50
\*create Intelligence 50
\*create Relationship_with_Beckham 50
\*create Stealth 50

\*create Beckham's_transformations "??"
\*create Health 15
\*create Beckham's_health 10
\*create Beckham's_Manna 8

You can’t use apostrophes in variable names, just call it “beckhams_transformations”.

Ahhh. That would make it incorrect grammar xD so maybe I’ll just use “transformations”

No one sees the variables but you. It doesn’t matter if the grammar is incorrect on them.

@FairyGodfeather well, the grammar police might arrest him for crimes against the English language :stuck_out_tongue:

Personally, I don’t like to have long variable names as writing them out can be a bit of a pain. I’d use “bectran” or something, but if they’re too short you run the risk of forgetting them!

Oh I thought they had to match up with the stat names, which appear in the game.

Go back and try the code in your stats file that I suggested in the other thread. Like I said there, you can use “btrans” or whatever for the variable… it’s the code you use in your choicescript_stats screen that determines what the players actually see.

I’d recommend reading through this, experimenting with all the different things they talk about, and seeing the difference it makes in what you see in your own stats screen:

Alright, I’ll check it out. Know I’m coding the part where you choose Beckham’s transformations, but I can’t figure out how to let you choose three, as opposed to just one.

When in doubt search the wiki. Read this http://choicescriptdev.wikia.com/wiki/Choice your answer lies there.

"Multiple *choice

A little-known feature of ChoiceScript is the ability to offer the player multiple choices on a single page, each with two or more options. This is by no means easy to explain so the best thing to do is copy the following code into the first page of a work-in-progress and see the end result in-game for yourself, comparing it to the actual code."

This shows me how to code choices within choices, but I don’t want the reader to have to choose their boggart’s transformations out of a small pool of choices (like choose one out of these three, then one of of these three, then one out of these three.) I want them to be able to choose 3 out of 9.

\*choice Order Sash Emblem
  #Crimson Guard
    #Red Sash
      #Star Cluster
      #Crossed Swords
    #Purple Sash
      #Star Cluster
      #Crossed Swords
  #Knights of Centauri
    #Red Sash
      #Star Cluster
      #Crossed Swords
    #Purple Sash
      #Star Cluster
      #Crossed Swords

You know you could try it out, see if it works as intended. Investigate the various games, see how they do it and work it out yourself. Think of it like a puzzle. We all started in the same place without much of a clue how to do things.

I’ve never used that code before. So have fun with it, experiment with it. I use www.choiceofgames.com/forum/discussion/comment/67680/ to test small pieces of code.

We did all start out like that which sucks, but this is 4 years in the future where people have more experience and there are more game book writers.

I’d strongly advise avoiding multiple choices to begin with. They’re not particularly pleasant or intuitive.
Start small, work your way through COG’s tutorials and the wiki guide. You won’t be able to do everything you want to overnight, but it’ll all come in time if you keep at it.

I came to choicescript with virtually no coding knowledge. I read the resources that were out there though. I struggled through things. I searched the forum, the wiki, the various tutorials I could find. I read the code of games which did things in an interesting manner. I’m still learning new things. There’s still things I don’t understand. I’m trying though.

The best way to get experience is to try. Experiment. Try and work things out for yourself. That’s where most of us start.

There’s a number of ways I can think of to answer your previous question about a pool of choices. If I can think of them so can you.

Have you ever seen a game which uses those multiple choices? One that lets you pick several different choices at once?

@CJW @FairyGodfeather
Normally I’d be much more intuitive and self orientated in any other type of situation but coding is a whole different story:P I’ll try to look around more thoroughly, though.

Not at once, but one after another. Like in Zombie Exodus where you chose multiple weapons before going on a mission.

Then surely that’s the way you should implement things too.

Don’t think of it as coding then. Do you understand basic logic? If you can write out simply what precisely you want to do then it can make things easier to code, at least in choicescript. Tackle it like a puzzle. So in your case you have.

Goal: Choose 3 Beckham’s transformations.

What are his transformations?

Are you attempting to do
*set transform = transform1, transform2, transform3,

That won’t work.

Now if you were to do

*set transform1 true
*set transform2 true
*set transform3 true
*set transform4 false

then you know what transformations he can do. Then you just need to check

*if transform1
*if transform2

Here’s the thing you’re a bit vague and not too specific on what you’re trying to do in your posts. If you detail it out. If you break it down into the exact pieces of what you want to achieve you may be able to work it out for yourself.

i use this style:
edit or use fake_choice inside choices


…I already know all that. Even if I set the first transformation as true, I’d need to send the reader back to the same list of transformations as an effect of their first choice, and somehow count the transformations that they choose subsequently so that they choose exactly 3. So I’m trying to figure out a way to do that besides searching (most likely fruitlessly) through forums, wiki pages, and obscure codes. The point of being able to post discussions is to get feedback.


It’s not fruitless searching. Find a game that does the same thing you want to do, there’s plenty, copy it. Or explain in better detail specifically what you want to do. Detail it out step by step if need be.

Alright well I’ll take a look at some of the gamebook’s codes…Do you know how to get inside of the code?