Ultimate Noob Coding


#1

I struggle to thing of someone more noobish than myself when it comes to coding anything. So I figured one thread may be best to contain all my inane queries.

First up: I decided to try and code the first little intro chapter I have, but I literally have gotten stuck on the first line. I’ve never used Notepad++ before, and the line I’m typing seems to go on forever. Should I hit return to jump to the next, and if so, how often?


#2

For a non-command line, it won’t make any difference, so just hit return whenever you want to.


#3

Thanks muchly! Might as well do it as early and often as voting, just to make it easier on the eyeballs.


#4

It may help if you have Word Wrap checked.
View --> Word Wrap


#5

Done and done! 20 characters in search of a point.


#6

Also, have you tried CSIDE or Chronicler instead of a text editor / browser? Both are dedicated development tools for ChoiceScript. Check out this forum thread for CSIDE, and this one for Chronicler.


#7

I have seen CSIDE mentioned in other threads (though not Chronicler), but I apparently misunderstood what it was. I thought it was just to test your code, not a repository to create the whole kit and caboodle.


#8

Yep when I started I used a word processor too. But @Vendetta is right, you save a ton of time using CSIDE and Chronicler. Both have great features since they’re dedicated platforms and it’s really a great time saver!


#9

Okay, been working on my intro scene and keep getting “it is illegal to fall out of a *choice statement, you must *goto or *finish before the end of the indented block”. I am using CSIDE (which it took me longer than I want to admit to get the name’s pun), and it looks like the *finish is centered right below the text like in the ChoiceScript example online. But honestly this Smart Indent is either screwing me up or I’m just not sure which way things should be. Should I turn it off?


#10

Could you show us what the code looks like?


#11

In your choice body, you must have a place for the script to go once it is finished with that level of script … this version requires a manual command (*goto label) or finish command. The finish in the main body is not seen by the script which is in a deeper level then the finish command below it currently

That is how I understand after having the same error and shown the solution.


#12

I will just paste the code, not sure any other way to show it:
*choice
#A direct report of the battle’s result.
Humanity had dealt their foes heavy losses, but in the end the few surviving ships were forced to bug out and retreat planetside.
*finish
#A colorful and brief summation of events.
We got spanked and sent crying back to Momma
*finish
#Something crazy and unsubstantiated
The moon men came and took our toys away, no doubt in response to our secret assassination of the Head Chancellor of Planet X by an undercover dentist hit squad!
*finish

It did look better than this, but I have it all jacked up trying to find some combination of spacing that allows me to avoid the error.


#13
*choice
    #A direct report of the battle's result.
         Humanity had dealt their foes heavy losses, but in the end the few surviving ships were forced to bug out and retreat planetside.
        *finish
    #A colorful and brief summation of events.
     We got spanked and sent crying back to Momma
    *finish
    #Something crazy and unsubstantiated
     The moon men came and took our toys away, no doubt in response to our secret assassination of the Head Chancellor of Planet X by an undercover dentist hit squad!
     *finish

Okay, it looks like you’ve got some weird indents in there. The “H” in “Humanity” should line up with the * in *finish, and similarly for the other two post-choice lines.

(As a second point, it would probably be better to use a *fake_choice here, since then you wouldn’t need to use *finish, but can just continue writing the story in the same document by resetting the indent.)


#14

@hustlertwo Use *fake_choice instead of *choice

or

*choice
    #A direct report of the battle's result.
         Humanity had dealt their foes heavy losses, but in the end the few surviving ships were forced to bug out and retreat planetside.
        *finish
    #A colorful and brief summation of events.
         We got spanked and sent crying back to Momma
        *finish
    #Something crazy and unsubstantiated
         The moon men came and took our toys away, no doubt in response to our secret assassination of the Head Chancellor of Planet X by an undercover dentist hit squad!
         *finish

#15

Still running into the issue, even after copy-pasting the code y’all have. And since the next line is supposed to be determined by which choice you make, would it work as a fake choice? I thought those were just for ones where text was unchanged, like the ice cream scene in the example.

Dur, I am realizing part of my problem is that my scene doesn’t end there, so *finish might not be right. I toyed with it using *goto and was able to get this part to flow (although I am wanting a line break between the item being filled in by their selection and the rest of the story and only the third choice has that for whatever reason).

Here’s where I am now for the intro; the first choice works, the second craps out with an error stating it expected an option, not *finish for line 44.

title Nuclear Powered Toaster
*author Matt Simpson
The year is 2338. Centuries ago, political tension gave way to nuclear hellfire: the Cataclysm, or Clysm for short.
After a long and difficult struggle, humanity crawled back from the brink.
World powers came back to prominence, we began our first tentative steps into the universe beyond our planet, and mankind became full of hope once more.
But old vendettas, like old habits, die hard. So naturally the bombs came once more: the second Clysm.
Fortunately, rebuilding was a bit quicker this time out. Like everything else, surviving extinction is a learning experience.
Time passed, and as life on Earth finally reached normalcy once more, we ventured back out into the stars in our quest for meaning.
But this time all we found was an even bigger threat to ourselves than…ourselves. The Salians.
Io was the first colony to go dark. It wasn’t until they had gotten all the way to Phobos that a vidclip finally snuck past whatever interference had jammed broadcasts from the other stations.
The Phobos Massacre became the second-most viewed clip in post-Clysm history, right behind the remixed video of the massacre that replaced the screams with fart noises.
Shadowy, shrunken shapes moving impossibly fast. Flashes of gunfire. Then darkness. The only spoken word from the attackers sounded something like “Salia!” so that’s what we called them. Earth believed it would take the invaders weeks to get here, based on all existing propulsion methods. They got to us in five days. We met them with as great a force as we could muster, almost every armed spaceworth craft on the planet. Two hours after the Battle for Earth began, it ended.
The next sentence of the report is…
*choice
#A direct report of the battle’s result.
Humanity had dealt their foes heavy losses, but in the end the few surviving ships were forced to bug out and retreat planetside.
*goto After
#A colorful and brief summation of events.
We got spanked and sent crying back to Momma
*goto After

#Something crazy and unsubstantiated
     The moon men came and took our toys away, no doubt in response to our secret assassination of the Head Chancellor of Planet X by an undercover dentist hit squad!
     
    *label After 

After the fleet was obliterated, the Salians moved fast. Reports came in all over the world of orbital bombardment laying waste to monitoring stations, satellites, and even high-powered telescopes. In hours the Great Blackout rendered us completely unable to track any activity beyond our own atmosphere. Humanity waited, certain that a third and undoubtedly final extinction-level event was coming, And waited. And waited. Days turned into weeks, and one of the few spaceworthy military vessels remaining attempted a stealthy recon beyond our stratosphere. It was almost immediately destroyed. The same happened to the second, and then the third. No stealth craft, one-man zip fighter or hulking 'nought could achieve orbit intact. It was through this trial and error process that we learned the rules set forth by our silent conquerors: they would not tolerate attempts to monitor their activity or leave the planet. Beyond that, we had no sign of their presence. Every now and then some conspiracy theorist or random nut would claim they had left our orbit and gone back to their home world, possibly due to incompatible atmospheres, a sudden change of heart after our heroic defense attempt, or just not finding anything good on the tube to watch. These theorists would often mount an expedition to scout the upper reaches of our atmosphere, and promptly returned to the planet’s surface as superheated ash. Reports of landing craft coming from space occasionally came in but were always unverified.
Your conclusion…
*choice
#ends with an inspirational message.
That was twelve years ago. During that time almost every country has united under the benevolent leadership of the Global Peace Accord, or GloPAc. Even now we continue to slowly build up forces, material and tech enough to eventually break this silent siege.
*goto You

#focuses on adaptive technology.
    Since that time we have spent the last twelve years adapting our technology and culture around the limitation of being earthbound, creating a massive network of land-based communication relays, suborbital "satellites" held aloft by remotely adjusted weather balloons, and other new devices.  Aside from uniting under GloPAc control, life has largely remained the same.
    *goto You
#might get you committed
    That was twelve of your Earth years ago.  Since then I've quite enjoyed living amongst your populace, sampling your food, entertainment and various lovemaking positions.  However, the time has come to emerge from the shadows and rule you puny humans like the cattle you truly are.  Now bow before me!  Salians 4 Lyfe!
    *label You

You sit back in your chair, satisfied. With a wave of your hand the completed report is sent on its way for review. You’ve always enjoyed history class, and your grades in that course show it. You look around the meager surroundings of your dormitory cubicle, trying as ever to ignore the nearby sounds of other trainees snoring, muttering to themselves or engaging in stealthy self-gratification. Other than the docking station for your Palmcomm, all your belongings have been collected in a rucksack. You know that you will likely be departing this modest living arrangement for good in the near future, one way or the other.
An alert from the head of the facility chimes in, snapping you out of your reverie. You have been summoned to their office immediately, and since you know how hard to deal with they can be, you rise quickly to depart. The alert flashes in the corner of your terminal’s display. Next to it is your bio profile. It shows you are…
*choice
#Fiorella Branford, 23: a special forces cadet who possesses a mysterious power.
#Alexi Beaumont, 29; would-be smuggler, and owner of a modern rarity: a fully-functioning spaceship.
*finish


#16

Well, I still haven’t fixed the rest of the scene, but I feel absurdly proud that the stat block is coming along nicely. It too was screwy at first, but only because I included the name variable in the example when that wasn’t something I had populated yet (they’ll get a chance to name the character, but not sure if it will be during the intro or in the first chapter). Much like the spacing issue with the text above, I need to figure out how to separate the stats into two stat blocks (one for mental and one for physical) since right now there are just eight stats. But they look good doggone it!


#17

Arck… my eyes :tired_face: :zap: :zap:

By the way, you can use the </> button to turn your texts into preformatted text. This way, we can see the indentation, and thus will be able to identify your problem earlier.


Speaking of problem, do you still encounter the same problem?
Need any help on other areas?


#18

Thanks. And yeah, this would be evidence of why I didn’t name it Kind of a Noob Coding. I just looked at the example of the startup scene in Choice of the Dragon in the tutorial and I’m aware how out of my depth I am. Hopefully once I start to get the hang of things it will progress faster, but I can’t devote a great deal of time to practice coding while balancing 2 young kids, a full-time job and a part-time job. Most of the time I do find is coming in the early morning before they get up. Here’s my more recent efforts, still gets an error message after choice #2. I’m trying to focus on getting the intro done, since then I can probably make a WIP thread to get some preliminary feedback on the game without being forced to just describe it in nebulous terms. Right now I need to figure out the best way to alter the text presentation to have more spaces, insert something in to show the stat gains for each choice (and would it be considered cricket to let readers know which stat a choice is tied to beforehand? That’s my predilection but I don’t know if that is feasible or advisable), and have the final choice direct them to a different scene based on it (since I am doing this game with two separate MC choices). Right now it has name and gender locked, but the final game will not.

*title Nuclear Powered Toaster
*author Matt Simpson
*create Intelligence 10
*create Ingenuity 10
*create Influence 10
*create Insanity 10
*create Strength 10
*create Marksmanship 10
*create Endurance 10
*create Special 10

The year is 2338.  Centuries ago, political tension gave way to nuclear hellfire: the Cataclysm, or Clysm for short.  
After a long and difficult struggle, humanity crawled back from the brink.  
World powers came back to prominence, we began our first tentative steps into the universe beyond our planet, and mankind became full of hope once more.  
But old vendettas, like old habits, die hard.  So naturally the bombs came once more: the second Clysm.  
Fortunately, rebuilding was a bit quicker this time out. Like everything else, surviving extinction is a learning experience.
Time passed, and as life on Earth finally reached normalcy once more, we ventured back out into the stars in our quest for meaning.  
But this time all we found was an even bigger threat to ourselves than…ourselves.  The Salians.
Io was the first colony to go dark.  It wasn't until they had gotten all the way to Phobos that a vidclip finally snuck past whatever interference had jammed broadcasts from the other stations.
The Phobos Massacre became the second-most viewed clip in post-Clysm history, right behind the remixed video of the massacre that replaced the screams with fart noises.
Shadowy, shrunken shapes moving impossibly fast.  Flashes of gunfire.  Then darkness.  The only spoken word from the attackers sounded something like "Salia!" so that's what we called them.  Earth believed it would take the invaders weeks to get here, based on all existing propulsion methods.  They got to us in five days.  We met them with as great a force as we could muster, almost every armed spaceworth craft on the planet.  Two hours after the Battle for Earth began, it ended.
The next sentence of the report is…
*choice
    #A direct report of the battle's result.
        Humanity had dealt their foes heavy losses, but in the end the few surviving ships were forced to bug out and retreat planetside.
        *set Intelligence +2
        *goto After
    #A colorful and brief summation of events.
        We got spanked and sent crying back to Momma
        *set Ingenuity +2
        *goto After
         
    #Something crazy and unsubstantiated
         The moon men came and took our toys away, no doubt in response to our secret assassination of the Head Chancellor of Planet X by an undercover dentist hit squad!
       *set Insanity +2  
        *label After 
After the fleet was obliterated, the Salians moved fast.  Reports came in all over the world of orbital bombardment laying waste to monitoring stations, satellites, and even high-powered telescopes.  In hours the Great Blackout rendered us completely unable to track any activity beyond our own atmosphere.  Humanity waited, certain that a third and undoubtedly final extinction-level event was coming,  And waited.  And waited.  Days turned into weeks, and one of the few spaceworthy military vessels remaining attempted a stealthy recon beyond our stratosphere.  It was almost immediately destroyed.  The same happened to the second, and then the third.  No stealth craft, one-man zip fighter or hulking 'nought could achieve orbit intact.  It was through this trial and error process that we learned the rules set forth by our silent conquerors: they would not tolerate attempts to monitor their activity or leave the planet.  Beyond that, we had no sign of their presence.  Every now and then some conspiracy theorist or random nut would claim they had left our orbit and gone back to their home world, possibly due to incompatible atmospheres, a sudden change of heart after our heroic defense attempt, or just not finding anything good on the tube to watch.  These theorists would often mount an expedition to scout the upper reaches of our atmosphere, and promptly returned to the planet's surface as superheated ash.  Reports of landing craft coming from space occasionally came in but were always unverified.
Your conclusion…
*choice
    #ends with an inspirational message.
        That was twelve years ago.  During that time almost every country has united under the benevolent leadership of the Global Peace Accord, or GloPAc.  Even now we continue to slowly build up forces, material and tech enough to eventually break this silent siege.
        *set Influence +2
        *goto You
    #focuses on adaptive technology.
        Since that time we have spent the last twelve years adapting our technology and culture around the limitation of being earthbound, creating a massive network of land-based communication relays, suborbital "satellites" held aloft by remotely adjusted weather balloons, and other new devices.  Aside from uniting under GloPAc control, life has largely remained the same.
        *set Ingenuity +2
        *goto You
        
    #might get you committed
        That was twelve of your Earth years ago.  Since then I've quite enjoyed living amongst your populace, sampling your food, entertainment and various lovemaking positions.  However, the time has come to emerge from the shadows and rule you puny humans like the cattle you truly are.  Now bow before me!  Salians 4 Lyfe!
        *set Insanity +2
        *label You
You sit back in your chair, satisfied.  With a wave of your hand the completed report is sent on its way for review.  You've always enjoyed history class, and your grades in that course show it.  You look around the meager surroundings of your dormitory cubicle, trying as ever to ignore the nearby sounds of other trainees snoring, muttering to themselves or engaging in stealthy self-gratification.  Other than the docking station for your Palmcomm, all your belongings have been collected in a rucksack.  You know that you will likely be departing this modest living arrangement for good in the near future, one way or the other.
An alert from the head of the facility chimes in, snapping you out of your reverie.  You have been summoned to their office immediately, and since you know how hard to deal with they can be, you rise quickly to depart.  The alert flashes in the corner of your terminal's display.  Next to it is your bio profile.  It shows you are…
*choice
    #Fiorella Branford, 23: a special forces cadet who possesses a mysterious power.
*finish Chapter 1: Prickly When Wet
    #Alexi Beaumont, 29; would-be smuggler, and owner of a modern rarity: a fully-functioning spaceship.
*finish Chapter 1: Getting the Contraband Back Together

#19

Hmm. :eyeglasses:
I believe, the Choice number 2 is this one?

If that’s the case, the culprit is perhaps… something you’re not expecting.

Replace the *label You (the one at the bottom of your Choice 2) into *goto You. And don’t indent the *label You afterwards.
:ballot_box_with_check:


And the final choice should be look like this :ballot_box_with_check:

What I did there is indenting both *finish's line. Doesn’t matter what command you use, you’ll want them nested inside the #Option (unless you’re using *fake_choice, which things can go different way)

BTW, it’s quite interesting at how you conclude the chapter. :astonished:
It never occured to me to have the *finish button saying different things depending on your choice. May I… “borrow” this technique, sir? :yum:


Oh, another by the way, if you found yourself struggling with all of these coding stuff, let me introduce you to a tool dedicated to write story in CScript.
Chronicler: a “mind-map” based writing tool that sorts all of those *labels and *gotos for you. All you need to worry is the writing itself (and the stats balancing).

However, I personally don’t use Chronicler, so I can’t say much about it :sweat_smile:
Except for it’s looking PRETTY COOL. Quite handy if you really hate the nitpicks of coding.
Of course it will take another time to learn the Chronicler itself, but doing that can save you the time needed for those coding business. Perhaps.


#20

Thanks on several different levels! I have yet to try the code fix because I spent the girls’ naptime downloading Chronicler (which required me to redownload it for each new update individually, which is weird). It won’t let me upload my stuff in progress so far, but I haven’t done much so I may retype it or something. As for the text in *finish, that’s actually in the Choice of the Dragon code example on the tutorial. But I’ve seen it in other games too, I think. Either way, it’s all yours of course. And it says different things also because this game will have two distinct MCs. Their paths do join later, but the first couple chapters are almost wholly unique based on who you picked. I may also split chapter 3, which I am currently writing, based on a location selection. Not sure yet, since there will be a touch more redundancy there than with the first couple chapters. I will have to insert in the code a redirect to send the user to a different scene based on the last choice, but no sense mucking with that until those scenes exist, eh?