Ultimate Noob Coding

It’s still not working for me but I think I know why - just for testing I only made one label, but all 20 *set’s. I’ll add in all the labels now… that should do it. Thanks though - I never thought of {} with no $!

Actually… I didn’t… Everything is set, yet it’s still not working…

I guess I should just post the code.
Variable:

Create notes_info "profiles1"

The labels, to go to. (just 2 of them as all 20 isn’t needed!)

*label profiles1
*set notes_info "profiles1"
*line_break
*line_break
1 ${p1}, male, 37, teacher
*line_break
*line_break
2 ${p2}, male, 21, student of mathematics
*line_break
*line_break
3 ${p3}, male, 40, yoga instructor
*line_break
*line_break
4 ${p4}, male, 45, accounting assistant
*line_break
*line_break
5 ${p5}, male, 61, school inspector
*line_break
*line_break
6 ${p6}, female, 31, personnel manager
*line_break
*line_break
7 ${p7}, male, 22, student of history
*line_break
*line_break
8 ${p8}, female, 29, catalog manager
*line_break
*line_break
9 ${p9}, male, 18, plumbing apprentice
*line_break
*line_break
10 ${p10}, male, 34, writer

*return
*label profiles2
*set notes_info "profiles2"
*line_break
*line_break
11 ${p11}, female, 27, jewellery designer
*line_break
*line_break
12 ${p12}, female, 46, telecommunications manager
*line_break
*line_break
13 ${p13}, female, 21, student of astrophysics
*line_break
*line_break
14 ${p14}, female, 20, student of modern art
*line_break
*line_break
15 ${p15}, male, 24, shop assistant
*line_break
*line_break
*line_break
*line_break
16 ${p16}, male, 28, student of dentistry
*line_break
*line_break
17 ${p17}, male, 43, artificial intelligence designer
*line_break
*line_break
18 ${p18}, male, 27, air steward
*line_break
*line_break
19 ${p19}, male, 30, junior doctor
*line_break
*line_break
20 ${p20}, female, 39, sous chef
*return

The gosub part

*gosub {notes_info}
1 Like

I think (although a more code-y type coder could correct me, heh) that {var} basically means ‘the value of var’ and ${var} means ‘print the value of var’?

Ah yes, sorry, maybe post the code then?

3 Likes

This looked beautiful, but upon attempting it, it’s going back to the previous screen with the greyed-out choice but is not then advancing past it with choice #2. It lets you pick all six then errors out saying there are no selectable options.

And the *temp timer 0 is above your *label? It’s hard to tell what’s wrong without seeing the code.

Or are you saying you tried my exact code, and that’s happening? I tried my code out just now and it worked correctly for me, so I’m not sure what’s going on, quite.

1 Like

You nailed it in your speculation. Everything was solid except I had the goto above the temp timer, so of course it set the timer back to 0 each go-round. Checks out 100% now, finally giving me the peace of mind to go to bed. Thanks as always!

1 Like

A habit I have gotten into is to place all my temp variable creations at the very top of each scene. This prevents that sort of error in case you need to do rewrites or anything like that. Also with them at the top, it is a convenient list of temp variables you are using.

@Fiogan does that demo you posted pass quicktest? It could be fine but just quicktest throwing up the error… (As it looks the same as mine).

In fact, I’m certain this is it. Quicktest is looking at it as text, not a variable. I’ve added the line *label {note} and it now passes quicktest. I now need to test the game to make sure it works.

Yes, Quicktest and Randomtest. What is the Quicktest error saying?

Edit: It passes Quicktest for me with just the text I put in my sample above.

Error: occupying_the_spaceship line 70: bad label {notes_info}

Hm, how odd. Er, you’re using the latest version of CS (not that I can see why it’d make a difference with {} ), and Quicktest is definitely checking the latest version of your file?

Oh also, what should notes_info be set to in the *gosub on line 70?

1 Like

I’m not and I was just thinking the same thing! haha. This is about 2 years old. I should probably update, although I will test it first.

1 Like

Oh, two years…maybe, then. XD Especially if you’ve check the value of notes_info at line 70 and it’s a valid label name.

1 Like

Notes_info is created as “profiles1”
It can be set to one of 20 different labels (profiles1 - profiles10 or profiles1b - profiles20b)

I’ve checked and double checked the spellings - no errors I can see.

1 Like

It looks like the use of {} to replace *setref and *gotoref was added in March 2015, so maybe it is the CS version.

2 Likes

I’ve tested my demo and it’s not treating {notes_info} correctly. I’ll update to the latest CS.

Thanks for all the help!

1 Like

Updating passes quicktest! Sadly it’s throwing up new errors (title too long - it exceeds 30 characters)

Well it had to be updated before publication anyway - More work to do.

1 Like

AAH!
What have I missed?!
:frowning_face:

Oh, oh :point_up:
And I call them “Loop”
I win :fist:


Yup. As a code-y type coder, I can confirm this.

Which can lead to code like this

this
*create text "dcba"
*if (text = "dcba")
*if (${text} = "dcba")

But not this: *if ({text} = "dcba")
*CMIIW

1 Like

So I’ve updated to the latest choicescript and it passes quicktest.

However, upon loading my game to test it, it says:

Script error.

I click okay and it loads.
Then when I select the first option to start playing it says

<div id=container1> is missing from index.html

Any ideas?

Have you tried downloading the latest version of CS again, this time to a different location, and copying your scene files into it there, and then testing? It sort of sounds like something might be up with the copy of ChoiceScript (although I’m not sure).

2 Likes

Probably it’s because you updated your CS but instead of moving your game scenes to the latest CS, you “pile up” the latest CS over the old CS, rewriting the files :thinking:

Unless I’m mistaken, ofc

2 Likes