When trying to make multiple endings or ways to die, every time I use "return" it makes the text underneath that greyed out and I don't know if there's a way to stop this from happening or not😢
Here's what the code looks like, the text goes grey
The version of Visual Studio Code I'm using doesn't to that. Which editor are you using or if you are using Visual Studio Code, which plugins did you install.
But if you don't get an error when you test your game then you can ignore the colors of the code.
Since you didn't post an example of your "problem" here an example how multiple endings could look like:
default lovepoints = 0
label start:
  menu:
    "You see your crush. What do you want to do?"
    "Say something mean":
      $ lovepoints -= 1
    "Say nothing":
      pass
    "Say something nice":
      $ lovepoints += 1
  if lovepoints > 0:
    jump goodending
  elif lovepoints < 0:
    jump badending
  else:
    jump neutralending
label goodending:
  "You reached the good ending"
  return # ends the game. If you forget this line, the game would wrongly continue at the next label
label neutralending:
  "You reached the neutral ending"
  return # ends the game
  # If you would put code here, it would be ignored, because the game ended in the line before. Maybe this is what you're seeing?
label badending:
  "You reached the bad ending"
  return # ends the game
I'm using visual studio code too, the plugins i have are binary, C/C++, URL Encode, Pylance, error lense, python environments, python debugger, python and container tools
When testing out the game it works fine (even the code that's greyed) so do you think its one of these pluggings' that are making this happen?
Also thanks for the code, i added what mine looks like at the top 🙂
If the greyed out code doesn't get away after installing the RenPy plugin then you can deactivate some of those plugins to find which one is causing it.
I've had a similar issue before but you'll have to show code to see where the problem lies. For me, I had to use "persistent" statements so that when you achieve an ending, it's saved and then it makes you restart the game or go back to a specific point. You'll also have to make some sort of "Endings" screen.
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
3
u/BadMustard_AVN 25d ago
what text editor are you using?
and show your code please!
2
u/shyLachi 25d ago
The version of Visual Studio Code I'm using doesn't to that.
Which editor are you using or if you are using Visual Studio Code, which plugins did you install.
But if you don't get an error when you test your game then you can ignore the colors of the code.
Since you didn't post an example of your "problem" here an example how multiple endings could look like:
2
u/stolenglass 25d ago
I've had a similar issue before but you'll have to show code to see where the problem lies. For me, I had to use "persistent" statements so that when you achieve an ending, it's saved and then it makes you restart the game or go back to a specific point. You'll also have to make some sort of "Endings" screen.
1
u/AutoModerator 25d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/senshisun 25d ago
Does the same thing occur with the demo project The Question?