Coder Fail

I’m having trouble setting up personalized stats and ensuring that with each choice that you make actually changes the stats on the stat screen. I know I messed up, like badly, I wasn’t smart enough to catch it before I went, oh, this works, I finally found the perfect solution. I literally worked on this for hours straight and got nowhere.

I have 16k down in words, not code, I suck at coding. But I really want to make this game work, and to tell a story…and yeah. I’m at my wits end and about to smash my head into my computer. I’ve tried searching, looking at various variables, setting, template, create, etc. If anyone could even help the slightest bit it would mean a lot. I think I’ve tried everything at this point, and I’m barely at the tip of the iceberg in terms of coding. I hope there’s even a solution to how badly I messed up/uninterpreted coding.

My stat code looks like this:
[b]Personaliy[/b]
*stat_chart
	percent strength Kicker
	percent strength Grinner
	percent strength Promiser
	percent strength Threatener
	percent strength Hider
*choice
	#Skills
		*goto_scene skills_stats
	#Tiredness
		*goto_scene tired
	#Popularity & Relationships
		*goto_scene Pop_Rel
	#Police Records
		*goto_scene Police_Records
	#Study Stats
		*choice
			#Peronality
				*goto_scene Expl_Pers
			#Skills
				*goto_scene Expl_Skil
			#Tiredness
				*goto_scene Expl_Tire
			#Popularity & Relationships
				*goto_scene Expl_Pop
			#Police Records
				*goto_scene Expl_Pol

Game code looks like this

*scene_list
	startup
*create returning_label ""
*create poetic true
*create strength 0
*create leadership 3
*create kicker 0
*create grinner 0
*create promiser 0
*create threatener 0
*create hidden 0
*create power 0

Chief Mingo lets out a sigh. “Listen, kid, I understand that you don't like your new school, but you can't run away.” A dried chuckle rang out. “There's not much you can do if I catch you the next time you run. Especially seeing as this is your first day here.“
 
*choice
	#You huff and kick the seat, foot digging in. "Yeah right. Who'd wanna go to a crap school like that anyway?"
		*set power +1
		Chief Mingo shakes his head. "That school happens to be your new home. And they're the only school that's left that'll take you in." He looks at you through the rearview mirror. "The other ones expelled you, and they won't accept your record. This is your best shot, your only shot." He looks away as his fingers tighten on the wheel. "So try not to screw it up more than you already have okay? I don't want to see you throw your life away. There's still a chance y'know?"
		*finish
	#You grin. "Wanna bet?" You lean back in your seat, cool leather soothing your skin. "I bet I can outrun you even while running backward old man."
		Chief Mingo grins back at you through the rearview mirror. "I would hold you to that, but it's my civic duty as an officer to not bet with convicts." You see that his expression has turned a comic still stoic, yet you see the corners of his lips turn up. "When the badge is off I'l race you. How about that?" 
		*set grinner +1
		*finish
	#You cast your eyes down as your hand goes to scratch the back of your neck. Your other hand lays against your leg and your fingers twitch as you say, "Yeah, it won't happen again. Promise."
		Chief Mingo smiles at you through the rearview mirror. "Thanks." He releases a breath and his grip relax on the wheel. "I hope you mean it this time." He blinks and it looks like he's reeling himself in. "What about a truce? I think that this day will go by a lot faster if you're sitting instead of running across town." 
		*set promiser +1
		*finish
	#You stare at him in the rearview mirror and speak with a flat tone, "You can’t run with broken legs.”
		Chief Mingo doesn't react at first, but when he does you see his eyes change, full of what you think is disbelief. "Did you just-" A laugh barks out of him. "You must be a confident kid if you’re going to threaten a cop like that.” His body does a light shudder. He seems to shake it off when he cocks his head as he looks at you in the rearview mirror. He opens it mouth then it shuts. "Impossible. There's no way a kid can break a grown man's legs.”
		*set threatner +1
		*finish
	#You lock eyes with him and say nothing while you reach into your pocket and find a “hidden” middle finger. 
		Chief Mingo frowns at you. "You're not the nicest kid are you?" He looks between your face and your proud standing middle finger. He seems to withhold utter despair and he closes his eyes, opens them, blinks then runs a hand trough his hair."What am I going to do with you?" He breathes and he again looks back to see it. He narrows his eyes at you through the rearview mirror. "I'm not going to play this game you have going on here." 
		*set hidden +1
		*finish

Just on the first glance I see that you have several *goto_scene but you don’t have them listed on the *scene_list besides startup

1 Like

All right first things first you are doing displaying the stats wrong its just showing the value of strength variable in all. Its supposed to be

*stat_chart
	percent Kicker
	percent Grinner
	percent Promiser
	percent Threatener
	percent hidden Hider

On to next, I think you meant to use *goto rather than *goto_scene here as, if that’s intentional then that will just create a lot of hassle.

*choice
	#Skills
		*goto skills_stats
	#Tiredness
		*goto tired
	#Popularity & Relationships
		*goto Pop_Rel
	#Police Records
		*goto Police_Records
	#Study Stats
		*choice
			#Peronality
				*goto Expl_Pers
			#Skills
				*goto Expl_Skil
			#Tiredness
				*goto Expl_Tire
			#Popularity & Relationships
				*goto Expl_Pop
			#Police Records
				*goto Expl_Pol

Now on to game code
You cannot use *finish if you don’t have next scene declared in *scene_list consider using *goto or *goto_scene

Its not actually necessary unless he is planning on using *finish it works just fine without declaring them in *scene_list but its probably better if he does.

2 Likes

Huh. I just realized that right now. I’ll get started on it. Thanks!

1 Like

I fully agree. It would most definitely make things neater and in general easier accessibility if I actually organized them in *scene_ list.

I don’t know if you have had a look at this post, but it can be really handy to learn a lot about choicescript.

Otherwise, maybe you could look at the code of another game to see how things are generally done and compare it to what you have done already. It’s a little hard at the beginning, but it’ll get easier, don’t worry.

2 Likes

Also one massive mistake I made was listing all the stats under the same category under the thought that they’d somehow be different from each other??? I barely realized once I finished that they only reacted to strength, rendering them impossible to be separate stats/singular. I think another problem may be the create and set, as I’m pretty positive I used those incorrectly as well.

Thank you. You’ve literally been my hero for a bit now, so I do appreciate the help. I have read it but I’ll look it over again, maybe I missed or misread something that I can understand better given time. I’ll certainly do that! I feel like that’ll make things a lot easier if I can compare and contrast.

1 Like

Jajaja I think that a hero is maybe too much, but thank you.

The mechanic is simple once you understand the function of the commands. And there is a wiki listing all of them and what they do with examples. Just keep trying, you are making progress, you’ll get there.

I don’t know what you are using to code, but with cside you can test your game inside the same program and see the result of what you’ve done, it’s super useful to debug and try different codes and see how the outcome changes, you should take a look at it. I personally write all in notepad++, but when I need to test and debug something more complex I use that program, it just makes your life easier.

1 Like

Another thing to add to my increasing list of knowledge revolving around coding. Thanks! You’re the best!

1 Like