Shattered Stars jumping scenes with no code to do it?

Yeah. Else is just… else. No condition needed.

Alrighty. Standby. Gonna remove all *finish before I put that in.

  #"Polanski, do you mind if I speak with you privately?" 
     *if (Polanski >= 50)
      *goto PolanskiPrivate
     *else 
      *goto ClarkIntervention
 #"Clark, you have a moment to talk?" 
    *goto ClarkPrivate
 *selectable_if (Engineering >= 40) #"Check the transformer. Fleet Engineers tend to miss that." 
    *set Polanski +2
    *set Clark +2
    *goto LaunchEngineeringImproved
 #"Just checking in on you two. I'll get going now." 
    *goto Preparations

Like this?

If possible, I highly recommend you start using CSIDE. Not only will it catch some of the formatting errors (like an extra indentation), but it also has a feature called “stepping” that shows you, line-by-line, where the code is going.

Whenever I find my game skipping over a section, it’s because I failed to properly set up my if/choice stack. The code, when it can’t find what to do, just skips down to the next thing on the list, in that case.

Pro tip: make sure your variables (such as Polanski and Clark) are all LOWERCASE! The same is true for your labels.

Out of curiosity, why lowercase?

It’s general good coding practice, because many coding languages are highly case sensitive. ChoiceScript has been built to be less so; variables and labels are not case sensitive (just double checked this using CSIDE). So I don’t think it would cause trouble here. But it’s a good habit to get into and if nothing else will increase your typing speed on variables.

3 Likes

Gotcha. I doubt I’ll ever use anything aside from C-Script honestly. Well, ladder logic but that’s not really a “coding” language.

I have another error in the code that was working before I moved everything into scenes. Someone said C-Side? Does anyone have a link?

Edit:

Asking because I highly doubt that a sports team or hip hop group is what I’m looking for which is what Google shows me.

 #"Wondering if you wanted to do something other than work out right now." 
  *if (Peters >= 60)
   *goto PetersDate
  *else
   "No." 
   *goto PetersChoices
 #"Carry on, Peters."
  "Affirmative. I'll get back to beating the locals until they understand that messing with a human isn't a wise decision." 
  *goto StationChoices

This is the code in question. It’s telling me that it’s illegal to fall out of a *choice statement. I’ve tried messing around with the indents. Didn’t work. Either it tells me it expected a # option or the above. It was working before when everything was in a single file as a side note.

@RascaldeesV2 I recommend going through this entire interactive tutorial, start to finish, without skipping or skimming anything, even if you think you already know it: ChoiceScript Guide

I’d also recommend making a list of notes to help you remember and to act as reference later so you don’t have to go flipping through tutorials or guides that someone else wrote.

1 Like

Yeah. That’s the tutorial I learned from.

The code above wasn’t broken until after it was moved into a scene file rather than the startup file. Nothing about it changed aside from that.

This is the official CSIDE thread.

2 Likes

Can you post the choice in question fully? The part you’ve quoted should be working.


*choice
     *hide_reuse #"Get back to the ship. You're now on extra duty." 
      "Of course I am. Shove it up your ass, Cap'." she replies though she does head back to the ship with her 'shoretime' cut short. 
      
      "Run along, human. Your kind aren't welcome here. Your 'daddy' even agrees." a nearby alien says with a triumphant look on his face. Perhaps there was more to this than you thought. It is too late to change it now. 
      *set Peters -2
      *goto StationChoices
     #"Why don't you tell me what's going on? Now."
      "Just some alien bastard that thinks humans shouldn't be allowed to access the academy because 'we are far too weak and lack souls blessed with Latimer's light'. Or something along those lines, anyways. I couldn't really hear him after I started to kick in his fuckin' teeth." she responds as she takes the towel and wipes off her face which glistens with sweat. 
      
      "You always beat on the aliens that don't agree with what you think?" you respond. 
      
      "Not always, Captain. Not always. Just the ones I dislike or the ones that try to lay their hands on me against my will. Something else I can help you with, Captain?" 
     *hide_reuse #"Wondering if you wanted to do something other than work out right now." 
       *if (Peters >= 60)
         *goto PetersDate
       *if (Peters < 60)
         "No."
         *goto PetersChoices
     *hide_reuse #"Carry on, Peters."
      "Affirmative. I'll get back to beating the locals until they understand that messing with a human isn't a wise decision." 
      *goto StationChoices


As a note, this isn't triggering quick-test sometimes and other times it is after the inclusion of *hide_reuse

It’s also worth noting that my computer is physically damaged and quite badly. It’s very possible it’s something on my end.

#"Why don't you tell me

Is missing a goto.

#"Wondering if you wanted

Has two *ifs instead of if/else.

No idea how I missed that. Does quick-test always point to the line after if that’s the case?

Also, why is *else required? Or is it just cleaner?

Edit:

Understanding the why can help me avoid future errors in my experience.

Quicktest tests for all possibilities. Even the ones that are impossible to achieve in a game.

Else (as in, everything else that’s not mentioned) tells quicktest: “Alright, those crazy impossible conditions you’re trying to test, they all go right here.”

In case of falling out of choice statement, yes, the line after. Because the error proper happened at that line i.e. quicktest was expecting something different at that following line.

1 Like

Gotcha. So in the future, editing the line the error is happening on (this specific one anyways) isn’t necessary?

Again, depends on the error, aka ‘use your judgement’. Most errors point to the line where you’d want to go and fix them. Falling out of statement is different in this case.

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.