Catst's profile picture

Published by

published
updated

Category: Web, HTML, Tech

My First Coding Project: A Horror Story

I decided my first blog post would be something I thought was a little funny. I will try to write this in a way that somebody who has no coding experience could understand. Though, I think you would find it funnier if you do have some code experience.

Background Information

I took my first coding class somewhere around 2019 to 2020 as a senior in high school. I didn’t take that class before because I thought it was going to be a math oriented class. I am terrible at math. As a result, I didn’t get to go on to do the advanced coding class because I graduated before I could take it. I regret that. Especially as I would have had an easier time in university if I had gotten a full grasp of the introductory subjects.

Before that, likely 2018 summer to 2019, I unknowingly created my first coding project. I never questioned what RenPy was. I just knew that it was used for Doki Doki Literature Club, and thought I could use it for an idea I had. If I described the idea here, it would destroy the tone of this post. Therefore I’ll (maybe) leave that for a different blog with a content warning.

What’s RenPy?

What RenPy does is create the user interface, all the things that the player can see. When you create a project, it automatically will have the text box at the bottom with some controls (skip, save, load, etc), a placeholder sprite to represent the character, and a black background. This can be changed via the script and GUI file. It also comes with a built-in tutorial on how to do things such as changing what appears on screen

The Visuals

I would have liked what I did to compensate for lack of assets if it was consistent. The screen is completely black besides the text. If the main character is thinking, the text in the bottom left is the same as any other visual novel. But when the first action was taken, the text was moved to the center of the screen and the name of the main character was removed. For some reason, I like that. Especially because the first action that was taken was a tension building scene, so it helped with the impact for me. This is also done for "the person". But to make it clear that it's "the person" talking or performing an action. I also changed the text color to red. Since the main character was not expecting "the person", I think this helps make them feel out of place, just like the main character was feeling. I don't know if I'd pick red though. That's a little bit too on the nose. I wish I could send a screenshot but I don't know how to do that on this website yet. 

After that though it went off the rails. Sometimes dialogue is centered and other times it’s not. Same with actions. If I were to do it now. I would have actions and anything from “the person” at the center of the screen, and everything else should be in the bottom left. 

First Version of the Script

Sadly, I no longer have this version of the script. So this section will be all from memory. The second version I do actually have the code and can show a bit more. When I made this game, the only thing I did for research was the RenPy documentation and built in tutorial.

Somewhere on RenPy’s documentation was “lineto”. This allows you to go to a line of code. So when anybody does an action. I would type something like “lineto 140”. This means that you have to go to several different lines of code to figure out what the code is doing. “140” does not tell you what it does. I couldn’t tell where the first choice ends and the second one starts. The worst thing was when I was finally able to find the line that I wanted to edit, that would add or remove lines of code. That means what was “140” would now be “139, “141”, or however many times lines were removed or added. This breaks EVERYTHING. I remember spending a lot of time after adding a single line of code that I would have to go to all of the “lineto”s and manually edit every single one every single time I wanted to make a change

This is the one thing that isn't in any other version of the game. I used “label {name}:” from this point on. My instincts now are to use a function. However, based on what I read on RenPy’s website, this might actually be the right choice for dialogue.

Second Version

I had no idea what a variable was in coding. If you take algebra, it’s the same variable that you use there with “x”, just that you’re not only limited to numbers. It’s a placeholder where a value is stored. You can name this placeholder anything. Although it’s good practice to name it based on what the variable does, so you can easily find it later. Here are some examples

   $ trust = true
   $ points = 45
   $ secretDialogue = “I see that you’ve been somewhere you shouldn’t have”

I just directly copy and pasted from the example on RenPy’s website, so I was not aware that you could have different variable names. So, here are my variables for the entire program.

   $ randomnum = renpy.random.randint(1,2)
   $ ran = renpy.random.randint(1,2)
   $ menu_flag = True or False
   $ gift = "1" or some other number

Gift and menu flag don’t describe what they do, as mentioned above. One of the usages of gift is to find out whether the player trusts the npc, 1 as true and 0 as false. Should have just used true or false then. Because I put the number quotations, it’s treated as if it’s a word in a sentence rather than a number. The second usage of gift is how much trust there is. This should have been a separate variable. The menu flag doesn’t do anything. It’s set to true or false several times in spite of it not affecting anything. Randomnum and ran do the same thing. With the exception of two renpy.random.randint(1,4), the value is also the same.

The last thing is that with the exception of the ending labels. All of them are too vague. Continue and skip are both skip the menu. But if I just looked at the label, I wouldn’t know what was being skipped. Since both of these refer to scenes, I’d rather have something that describes what happens in that scene rather than where it is placed in the code.

Highlights

Considering this was a project for myself, I can’t blame myself too much for not spell checking or rereading what I wrote. But let’s just admire it and its glory both for its grammar and its code.

   "ok so this game is not fair"

   "you can literally"

   "and i'm using that word correctly"

   "get some good and bad endings just by share luck"

   "{b} IMPORANTLY THOUGH {/B}"

   "strong subject matter"

   "don't copycat any of the events in this game"

   "subject matter that take place in this game is not expexted to be in any way accrate"

   "other than {b}maybe{/b} my own"

   "you can quit the game at any time by pressing esc and pressing quit at the left bottom of the screen"

   "don't blame you if you deside you need to stop playing"

   "do you understand and accept the things listed above"


if randomnum==2:

    $ gift = "0"

    jump skip1


$ ran = renpy.random.randint(1,2)

if ran==1:

jump s

elif ran==2:

jump say2

label say2:

 menu:

  "say--":

      jump say1

  "JUMP FOR PEET'S SAKE":

      jump jump2


$ randomnum = renpy.random.randint(1,2)

if randomnum==1:

   m "..."

   jump person_silence

elif randomnum==2:

   m "..."

   jump person_talking

 

label person_silence:

h "..."

$ randomnum = renpy.random.randint(1,2)

if randomnum==1:

   jump cant_think_ending

elif randomnum==2:

   jump person_silence2


centered "the ground looks like map"

centered "paper"




2 Kudos

Comments

Displaying 1 of 1 comments ( View all | Add Comment )

Jack

Jack's profile picture

wow love ur profile looks awesome ✨✨✨


Report Comment