Codes: Changing Stubble (lol)

I’ve been having a few discussions with people lately about custom RenPy commands, and generally recommending them because you get the ability to lint your game scripts.

For example, the fact that I have lint checks on my commands to show sprites, and change their expressions, helped me catch a bunch of typos and misordered arguments during sprite staging, which would have been a huge pain to track down later (and that would have resulted in exceptions during gameplay).

Given the benefits of lint, I wanted to share an extremely small example for something that I could have easily done manually: Changing characters’ facial hair in the game.

First off, the code:

python early:
def parse_showstubble(lex):
who = lex.simple_expression()
level = lex.rest()
return (who, level)
def lint_showstubble(o):
who, level = o
if len(o) != 2 or who is None or level is None:
renpy.error("Invalid showstubble declaration")
return
if who != "adam" and who != "james":
renpy.error("Invalid person " + who)
return
try:
lvlint = int(level)
if lvlint < 0 or lvlint > 3:
renpy.error("Invalid level " + level)
except ValueError:
renpy.error("Invalid level " + level)
def execute_showstubble(o):
who, level = o
if not who in store.spposes_data:
store.spposes_data[who] = CharPoses()
lvlint = int(level)
if lvlint == 1:
store.spposes_data[who].stubble = "_sblight"
elif lvlint == 2:
store.spposes_data[who].stubble = "_sbheavy"
elif lvlint == 3:
store.spposes_data[who].stubble = "_sbbeard"
else:
store.spposes_data[who].stubble = ""
renpy.register_statement("showstubble", parse=parse_showstubble, execute=execute_showstubble, lint=lint_showstubble)

This then gets used in game code like

showstubble adam 1

It’s worth noting I could have easily not added this command, and simply written

$ sposes_data['adam'].stubble = "_sblight"

However. the benefit of doing it this way, again, is the lint checks. If you accidentally try to set stubble on someone else (say, Jake), or if you fat-finger the stubble value (23), you’ll get a pre-runtime error. Versus if you do that directly (say, “sblightr”), you’ll get an ugly runtime error only when you hit that line of code.

I’d argue there’s very little that isn’t worth making a custom command for. In addition to this, I have them for Instant Messaging in addition to Sprites and even the day transition code. In addition to linting, this gives you the ability to easily change something en masse (like when I wanted a day transition to also update the save identifier string).

March Updates

March was full of Nanoreno 2018 awesomeness, and we got our game done! Whale’s Waldo is available for your downloading pleasure, now.

I had the pleasure of working with six other amazing people, and also learning a lot of new RenPy things in the process, like ATL and transitions and getting more experience with screens (some of which I’ve detailed on this blog).

The best part was probably working with people that approach writing and gamedev in such a different way than I do. It made me think a lot about my own writing, and the kinds of things I tend to focus on, and I think it’ll make me a better writer and gamedev in the future.

As far as YAGS goes, March involved getting Jake’s final sprite into the game, and getting awesome Dan inks from my sprite artist @stollcomics. Hopefully we’ll have his final sprite soon, so I can push a new game build.

I’ve also been continuing my series of YAGS fics. There’s been a few pieces this month that I particularly like (including the background fic of Chris coming out to Janet), although the theme has seemed to be more around pre-game-timeframe backstory fics. In April, I want to divert more back into the few remaining in-game backstory fics.

Other than that, the current plan for April is to actually get work done on At First Sight. It’s going to be a busy month IRL, so we’ll see how much progress I make there.

Fic: Realizations

Hey, look. It’s another fic! (See all of them here.)

There’s a lot of things, in terms of backstory with the other characters and things that you don’t see, that I have specced out in my mind. I thought it would be interesting to present them in text form to fill in some of the gaps, as it were, in the main YAGS storyline.

Needless to say, these pieces will be highly spoilerific, so I recommend you do not read them unless you have finished the game at least once. (Likewise, they may not make as much sense if you haven’t played the game at least once.)

Seriously. Spoilers ahead! Do not continue if you haven’t played the game! (Also, credit to @randomnobodyandfriends for the topic suggestion.)

Continue reading “Fic: Realizations”

Fic: The First Step

Hey, look. It’s another fic! (See all of them here.)

There’s a lot of things, in terms of backstory with the other characters and things that you don’t see, that I have specced out in my mind. I thought it would be interesting to present them in text form to fill in some of the gaps, as it were, in the main YAGS storyline.

Needless to say, these pieces will be highly spoilerific, so I recommend you do not read them unless you have finished the game at least once. (Likewise, they may not make as much sense if you haven’t played the game at least once.)

Seriously. Spoilers ahead! Do not continue if you haven’t played the game! (Also, credit to @randomnobodyandfriends for the topic suggestion.)

Continue reading “Fic: The First Step”

Fic: A Proposal

Hey, look. It’s another fic! (See all of them here.)

There’s a lot of things, in terms of backstory with the other characters and things that you don’t see, that I have specced out in my mind. I thought it would be interesting to present them in text form to fill in some of the gaps, as it were, in the main YAGS storyline.

Needless to say, these pieces will be highly spoilerific, so I recommend you do not read them unless you have finished the game at least once. (Likewise, they may not make as much sense if you haven’t played the game at least once.)

Seriously. Spoilers ahead! Do not continue if you haven’t played the game!

Additional warning: This fic is highly explicit, and NSFW, and all of that stuff. R18+, NC-17, XXX, etc, etc.

Continue reading “Fic: A Proposal”

Braindump fic: End of the Line

I had a super depressive and upsetting YAGS dream last night, and for some reason I felt the need to write it down in fic form.

Needless to say, this fic is absolutely non-canon and also requires warnings for depression, suicide attempts, and general sadness and terribleness. Also warnings for adult situations(nothing too explicit, but let’s stick an NC-17 on here anyway to be safe).

Also also even calling it a fic is generous, thanks to its incoherence and lack of any redeeming qualities. Apologies, beforehand, if you actually read this. 😛

Continue reading “Braindump fic: End of the Line”

Fic: The Betrayal

Hey, look. It’s another fic! (See all of them here.)

There’s a lot of things, in terms of backstory with the other characters and things that you don’t see, that I have specced out in my mind. I thought it would be interesting to present them in text form to fill in some of the gaps, as it were, in the main YAGS storyline.

Needless to say, these pieces will be highly spoilerific, so I recommend you do not read them unless you have finished the game at least once. (Likewise, they may not make as much sense if you haven’t played the game at least once.)

Seriously. Spoilers ahead! Do not continue if you haven’t played the game!

Continue reading “Fic: The Betrayal”

Fic: Unintended Consequences

Hey, look. It’s another fic! (See all of them here.)

There’s a lot of things, in terms of backstory with the other characters and things that you don’t see, that I have specced out in my mind. I thought it would be interesting to present them in text form to fill in some of the gaps, as it were, in the main YAGS storyline.

Needless to say, these pieces will be highly spoilerific, so I recommend you do not read them unless you have finished the game at least once. (Likewise, they may not make as much sense if you haven’t played the game at least once.)

Seriously. Spoilers ahead! Do not continue if you haven’t played the game!

Continue reading “Fic: Unintended Consequences”