# Statchart problem

**URL:** <https://forum.choiceofgames.com/t/statchart-problem/7480>\
**Category:** ChoiceScript Help\
**Created:** [February 12, 2015, 4:27am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480 "2015-02-12T04:27:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 4:27am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/1 "2015-02-12T04:27:53Z")

</div>

Unfortunately, this proves to be something beyond my capabilities of fixing. The game itself passes all the tests that I run on it. When I play through the game it is also. The problem I have is with stat chart. This is how it looks in code:

```
*set Race "Vampire"
*set Race "Hekan"

*stat_chart
	text Name
	text Gender
	text Race

*if Race = "Vampire"
	*stat_chart
		text Class

*if Race = "Hekan"
	*stat_chart
		text Specialization

*stat_chart
	text PP Political Power
	text Strength
	text Intelligence
	text Willpower

```

The problem is that when I play through the game and choose the race vampire and class aristocrat, stat chart does not follow that and gives me this:

Name: Lisbeth  
Gender: Female  
Race: Hekan  
Specialization: unknown  
Political Power: 10  
Strength: 5  
Intelligence: 5  
Willpower: 5

Name, gender and the rest of the stats are correct, but the Race is wrong and Specialization is not even meant to appear with vampire race. I have the same issue if I choose the path of human race. The only time the stat chart is correct is when I actually choose hekans.

Any idea what I might be doing wrong?

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 4:36am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/2 "2015-02-12T04:36:20Z")

</div>

> [@Returner](#):
>
> \*set Race “Vampire”  
> \*set Race “Hekan”

Is what you’re doing wrong. You shouldn’t have that at the top of the stat chart because it’s over-riding any other race set with “Hekan”

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:04am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/3 "2015-02-12T05:04:32Z")

</div>

@FairyGodfeather  
Got rid of the \*set command, but it didn’t solve the issue. Now, it give me race as false:

Name: Lisbeth  
Gender: Female  
Race: false  
Political Power: 10  
Strength: 5  
Intelligence: 5  
Willpower: 5

---

<div class="post-metadata">

**Author:** ![CoelSmythe](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CoelSmythe](https://forum.choiceofgames.com/u/CoelSmythe)\
**Post date:** [February 12, 2015, 5:07am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/4 "2015-02-12T05:07:08Z")

</div>

would using \*temp race work? Or is there an issue with the code on the start-up?

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:07am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/5 "2015-02-12T05:07:26Z")

</div>

Do you have \*create race “false” anywhere?

Are you checking the stat chart after the choice where you choose your race and it’s still showing as false?

Can you copy and paste in the code from where you choose your race, etc?

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:16am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/6 "2015-02-12T05:16:22Z")

</div>

@CoelSmythe  
Unfortunately \*temp doesn’t sort it

@FairyGodfeather

This is at the top of startup.txt that I want to show in statchart

```
*create PP 0
*create Strength 0
*create Intelligence 0
*create Willpower 0
*create Gender "unknown"
*create Name "unknown"
*create Race "unknown"
*create Class "unknown"
*create Specialization "unknown"   

```

This is from the bit where you choose the race, along with classes for vampires and specialization for Hekans.

```
*choice
	#Stuff here
		Stuff here
		*set PP 5
		*set Strength 5
		*set Intelligence 5
		*set Willpower 5
		*set Race "Vampire"
		*choice
			#Stuff here
				*set PP 10
				*set Intelligence 5
				*set Class "Aristocrat"
				*goto gender
			#Stuff here
				*set Strength 10
				*set Intelligence 5
				*set Class "Soldier"
				*goto gender
			#Stuff here
				*set Intelligence 5
				*set Class "Common_individual"
				*goto gender
	#Stuff here
		Stuff here
		*set Race "Human"
		*choice
			#Stuff here
				*set Class "dead"
				*goto_scene death
			#Stuff here
				*set Willpower 5
				*goto gender
	#Stuff here
		Stuff here
		*set Intelligence 10
		*set Race "Hekan"
		*choice
			#Stuff here
				*set Strength 10
				*set Specialization "Manipulation"
				*goto gender
			#Stuff here
				*set Intelligence 10
				*set Specialization "Illusion"
				*goto gender
			#Stuff here
				*set Willpower 10
				*set Specialization "Life Forcing"
				*goto gender
```

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:17am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/7 "2015-02-12T05:17:39Z")

</div>

If you look at the stat chart after you’ve set your race to Vampire do you still have the same problem?

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:23am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/8 "2015-02-12T05:23:08Z")

</div>

@FairyGodfeather  
Actually, I think I might have found a glitch. I always play the game to the end when the stat chart shows as last part before you click next to play again. On that screen the stats are wrong, but if I look at the stats during the game, they are correct. I might have just caused this humbug for nothing \>.\< But how is that possible anyway?

---

<div class="post-metadata">

**Author:** ![CoelSmythe](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CoelSmythe](https://forum.choiceofgames.com/u/CoelSmythe)\
**Post date:** [February 12, 2015, 5:24am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/9 "2015-02-12T05:24:53Z")

</div>

I just thought of something that might work. \*if (race\_vampire=true) you’d have to set up some of your code a little different but having separate race\_hekan false race\_human false etcs. might work out

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:26am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/10 "2015-02-12T05:26:03Z")

</div>

Do you have any sort of \*set race right before the last stat chart? Check over your code again, using find to look at all the instances where you set the race.

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:32am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/11 "2015-02-12T05:32:02Z")

</div>

@CoelSmythe  
How much of an overhaul are we talking?

@FairyGodfeather  
No, there is no \*set race right before the last stat chart.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:37am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/12 "2015-02-12T05:37:21Z")

</div>

Do you have a link to the entire file? I can have a look over it to see the problem.It is likely something very simple, a stray \*set race in the wrong place that you might be overlooking. Are you certain that the only three set races are those in that choice tree you pasted here, and that \*create race is right at the top of the startup file?

I’d suggest against doing what @CoelSmythe’s suggesting. You don’t need to.

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:40am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/13 "2015-02-12T05:40:31Z")

</div>

@FairyGodfeather  
Now, you might need to walk me through how to get a link to the entire file as I have no clue how to get that xD But if you wouldn’t mind doing that, that would be great and I be so grateful!  
And yeah, I am certain that what I pasted here is the only choice tree where you can choose your race and the \*create race command is right at the top of start up.

---

<div class="post-metadata">

**Author:** ![CoelSmythe](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CoelSmythe](https://forum.choiceofgames.com/u/CoelSmythe)\
**Post date:** [February 12, 2015, 5:42am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/14 "2015-02-12T05:42:38Z")

</div>

Go with what @FairyGodfeather is saying.

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:43am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/15 "2015-02-12T05:43:13Z")

</div>

@CoelSmythe  
But thanks for trying to help too 😄

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:44am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/16 "2015-02-12T05:44:49Z")

</div>

If you’d rather not email if you’ve a dropbox account upload it there, or use a pastebin and just copy/paste in there.

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:51am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/17 "2015-02-12T05:51:19Z")

</div>

@FairyGodfeather

Dropbox is probably the best idea.

Here is the link for the statchart:

> **[choicescript\_stats.txt](https://www.dropbox.com/s/v6cygui0k9qztb7/choicescript_stats.txt?dl=0)**
>
> Shared with Dropbox

And here is the link for startup:

> **[startup.txt](https://www.dropbox.com/s/zv3e8y0hokypvh4/startup.txt?dl=0)**
>
> Shared with Dropbox

Thank you so much again! I have been trying to figure this out for the past night without any success. I guess it is like you say and I am just missing something small. I really appreciate your help, thank you!

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [February 12, 2015, 5:58am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/18 "2015-02-12T05:58:38Z")

</div>

I’d suggest against capitalizing your variable names, but that’s just a stylistic choice really. As long as you’re consistent it shouldn’t matter.

I can’t see anything wrong on that page. Do you have links to those future scene files?

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 5:59am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/19 "2015-02-12T05:59:58Z")

</div>

@FairyGodfeather  
I capitalized them so that they’d look better on stat screen. So original none of that was capitilized.

Anyways, I don’t, not yet, as these files are empty so far.

---

<div class="post-metadata">

**Author:** ![Returner](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/returner/32/198887_2.png) [@Returner](https://forum.choiceofgames.com/u/Returner)\
**Post date:** [February 12, 2015, 6:00am UTC](https://forum.choiceofgames.com/t/statchart-problem/7480/20 "2015-02-12T06:00:35Z")

</div>

Actually apart from the death scene…if you want a link for that one, it’s here:

> **[death.txt](https://www.dropbox.com/s/f1evlufds7xeltq/death.txt?dl=0)**
>
> Shared with Dropbox

[Next page](https://forum.choiceofgames.com/t/statchart-problem/7480.md?page=2)
