Some problems I'm having

Hello, everyone. I’m new to choicescript (just started creating my first game a few days ago) and I’m having some problems. I’ve already tried looking up solutions, but nothing I’ve found seems to work.

So, first thing - I can’t seem to get names and things to show up. Example 1:

	#Yes. But I told you not to call me "${creator_title}."
		*goto titleinput
		*finish

And Example 2:

You follow ${servant_name} down the corridors of your castle.

When I test the game out, the first example shows up as, "#Yes. But I told you not to call me “.”, and the second one shows up as “You follow down the corridors of your castle.”

In the startup page I have these two as

*create creator_title ""

and

*create servant_name ""

Similar things don’t work, either. Can anyone tell what I’m doing wrong? If you need to see more code, just let me know.

The second problem is this: I want the player to be able to choose whatever role they want to be - so it’ll be the same story, just told from different points of view depending on what they chose at the beginning of the game (it’s a little hard for me to explain). For this, I want different stats to show up for each different role, but I can’t figure out how to do that. Is it even possible? I can get stats to show up, but I can’t hide any. For example, say I want to experience the story from the servant’s point of view. I go to the stat page, and the servant’s stats show up…along with the stats for the other character (there’s only two characters at the moment, but I plan on having at least four). How do I change that?

Here is just one version of the code (I tried many, none of them worked):

*label stats

[b]Relationships[/b]

*if metServant = true
	text name
*stat_chart
		text Servant
		opposed_pair Hate
			Love

*if metCreation
*stat_chart

		text Creation
		opposed_pair Hate
			Love

*if metOutsider
*stat_chart

		text Outsider
		opposed_pair Hate
			Love

*line_break

[b]Relationships[/b]

*if metCreator = true
	text name
*stat_chart
			text Creator
			opposed_pair Hate
				Love
*if metCreation
*stat_chart
			text Creation
			opposed_pair Hate
				Love

*if metOutsider
*stat_chart
			text Outsider
			opposed_pair Hate
				Love

You didn’t assign any values to your variables. What were you expecting it to print? Tell us how you want it to look, and we can help you write the right code.

2 Likes

I think you may need to put an indent before each of those *stat_charts, so the game can see that it’s tied to the preceding *if command.

1 Like

Right, let me try… so for example, I used the roles of Servant and Creator. You will want this in the startup file:

*set servant false
*set creator false

Then in whichever scene deciding the role to play is made, it will need something like:

You want to play as...
*choice 
    #... the servant.
        *set servant true
    #... the creator.
        *set creator true
[b]Name:[/b]
*line_break
*if (servant)
        Tom
        *goto skills_servant
*if (creator)
        Bob 
        *goto skills_creator

*label skills_servant
[b]Skills:[/b]
*line_break
*stat_chart
    percent Intellect
    percent Brawn
    percent Speed
    percent Resolve

*label skills_creator
[b]Skills:[/b]
*line_break
*stat_chart
    percent Wisdom
    percent Combat
    percent Stealth
    percent Courage

One thing: I doubt you can use the same variable name for both skillsets, which is why i used different words. Thus in the startup page you will put something like

*comment ---servant---
*create Intellect 10
*create Brawn 10
*create Speed 10
*create Resolve 10

*comment ---creator---
*create Wisdom 10
*create Combat 10
*create Stealth 10
*create Courage 10

I should realy check my posts before posting.woops.

1 Like

… Sorry, but I’m really confused by this, so I hope I’m not misunderstanding. The reason that your characters names don’t show up is because you haven’t given your characters names yet. If the startup page said:

*create creator_title "Bob"

then the game would say, “Yes. But I told you not to call me “Bob.””

There needs to be something inside those quotations, or the stat will read as blank. Now, if what you want is to give the player the option to name the character, then the code would look something like this:

What is your name?

*choice
  #Bob
    *set creator_title "Bob"
  #Brian
    *set creator_title "Brian"
  #Barry
    *set creator_title "Barry"
  #Something else
    Then what is your name?
    *input_text creator_title
1 Like

Okay…I still can’t get it to work.

If it helps, here’s the startup page. I’ve edited it so many times some code may be unnecessary (and maybe some important stuff has been deleted…I really don’t know).

Honestly, I’m not sure I fully understand how variables are supposed to work…but as soon as I post this I’ll read more about them.

*title Sword of Damocles
*author Lycaon
*scene_list
	startup

*create met_Creator false
*create Creator 50
*create met_Servant false
*create Servant 50
*create met_Creation false
*create Creation 50
*create met_Outsider false
*create Outsider 50

*create characterone false
*create charactertwo false

*create hate 50
*create love 50

*create player_name ""
*create servant_name ""
*create creator_name ""
*create creation_name ""
*create outsider_name ""

*create creator_title ""

*create mc_isfemale false
*create mc_malefemale ""
*create mc_manwoman ""
*create mc_menwomen ""
*create mc_boygirl ""
*create mc_brothersister ""
*create mc_heshe ""
*create mc_hisher ""
*create mc_himher ""
*create mc_fathermother ""

*create servant_isfemale false
*create servant_malefemale ""
*create servant_manwoman ""
*create servant_menwomen ""
*create servant_boygirl ""
*create servant_brothersister ""
*create servant_heshe ""
*create servant_hisher ""
*create servant_himher ""

*create creator_isfemale false
*create creator_malefemale ""
*create creator_manwoman ""
*create creator_menwomen ""
*create creator_boygirl ""
*create creator_brothersister ""
*create creator_heshe ""
*create creator_hisher ""
*create creator_himher ""

*create player_creator ""
*create player_servant ""

*comment Sword of Damocles is only a working title.

*page_break

Welcome to Sword of Damocles! Play as either a creator, a creation, a servant, or an outsider.

*comment add more to this introduction later.

*page_break

What would you like to be?

*choice
	#I want to create life, of course!
		*goto_scene creatorstart
		*setref characterone
		*set Servant 50
		*set Creation 50
		*set Outsider 50
		*choice
	#I'll be a servant.
		*goto_scene servantstart
		*set charactertwo true
		*finish
	#Being brought to life may be fun...
		*goto_scene creationstart
		*finish
	#I'd rather not be part of the main story.
		*goto_scene outsiderstart
		*finish

You need to show us what came immediately before this section in order for us to help you. @Avery_Moore’s code is what you need in order to give your character a name, and like @Hazel said, we need to know what you want it to look like in order to give you the correct solution

Re: stats
If the MC is switching back and forth between two characters (creator and servant), then you definitely need two sets of stats. But if the player chooses their path at the beginning, and it never changes, then you only need one set of stats. Of course, if the two paths have different kinds of stats, then you’ll need to differentiate.

In startup

*create wisdom_creator
*create strength_creator
*create wisdom_servant
*create wisdom_servant

In stats page

*if (creator)
  *stat_chart
    percent wisdom_creator Wisdom
    percent strength_creator Strength

*if (servant)
  *stat_chart
    percent wisdom_servant Wisdom
    percent strength_servant Strength
1 Like

When you did *create player_name "" that’s perfectly fine.
But if ${player_name} is not displaying anything, it’s because the player_name variable is blank.
Anything in the quotes after a variable is what the variable is.

*create hello “Bob”
—> In the above example, typing ${hello} would result in the game displaying Bob because that’s what’s inside the quotes.

Back to your specific thing, *create player_name "" means that the player_name variable is blank. There’s nothing in the quotes. In order to change that, you can either type in a name from the start, for example *create player_name "Lycaon" or you can have the player put in a name.

What do you want to name your character?
*input_text player_name

Your name is now ${player_name}.

And now the player_name variable is whatever they typed in.

1 Like

Well, the first scene includes this:

*choice
	#I'm a man.
		*goto playernamemale
		*set mc_malefemale "male"
		*set mc_manwoman "man"
		*set mc_menwomen "men"
		*set mc_boygirl "boy"
		*set mc_fathermother "father"
		*set mc_brothersister "brother"
		*set mc_heshe "he"
		*set mc_hisher "his"
		*set mc_himher "him"
		*set creator_title "Sir"
		*choice

and this


*label playernamemale

And your name?

*comment will change "Cantrell" to something else later

*choice
	#Cantrell.
		*goto_scene creatorbeginning
		*set player_name "Cantrell"
		*choice
		*finish
	#Something else.
		*goto playernameinputmale
		*finish

*label playernameinputmale

What's your name?

*input_text player_name
*goto_scene creatorbeginning

So the next scene is:

You feel ${servant_name} come up behind you.

"${creator_title}," I believe tonight may be the night. Everything seems perfect."

*choice
	#Yes, you're right! We must start right away!
		*goto castleinfo
		*finish
	#Yes. But I told you not to call me "${creator_title}."
		*goto titleinput
		*finish

*label titleinput

What do you prefer to be called?

*input_text creator_title
*goto castleinfo

Now, to hopefully be a little more clear on how I want this game to be…at the start you make the choice between four characters - referred to as Creator, Servant, Creation, and Outsider for now. The basic story is the same, just with different scenes and things depending on the character. Once you’ve chosen you can’t switch to a different character. The choices you make affect your relationships with each character (and other things, of course, but right now I’m not concerned about that) - so if you chose “Creator,” for example, the relationships are Servant, Creation, and Outsider, but if you chose “Servant” the relationships are Creator, Creation, and Outsider.

The issue here is that you’re skipping most of your code because you’re reaching the *goto before everything else.

*choice
	#I'm a man.
		*goto playernamemale
		*set mc_malefemale "male"
		*set mc_manwoman "man"
		*set mc_menwomen "men"
		*set mc_boygirl "boy"
		*set mc_fathermother "father"
		*set mc_brothersister "brother"
		*set mc_heshe "he"
		*set mc_hisher "his"
		*set mc_himher "him"
		*set creator_title "Sir"
		*choice

Once the choice is selected, it will do the first command and go to the scene; the rest that is below it will be ignored and never reached.

The *choice command at the end is also incorrect and needs to be removed.

*choice
	#I'm a man.
		*set mc_malefemale "male"
		*set mc_manwoman "man"
		*set mc_menwomen "men"
		*set mc_boygirl "boy"
		*set mc_fathermother "father"
		*set mc_brothersister "brother"
		*set mc_heshe "he"
		*set mc_hisher "his"
		*set mc_himher "him"
		*set creator_title "Sir"
		*goto playernamemale

Now only after doing all the *sets that the code will jump to *label playernamemale.

This is the same issue in the following part, which is why the player name is never set to Cantrell:

*choice
	#Cantrell.
		*goto_scene creatorbeginning
		*set player_name "Cantrell"
		*choice
		*finish

Corrected:

*choice
	#Cantrell.
		*set player_name "Cantrell"
		*goto_scene creatorbeginning
6 Likes

The name problem is fixed! It seems like such an obvious mistake…I can’t believe I didn’t notice it. Thanks!