Setting Up Variables In Ren’Py

Setting up Variables in Ren’Py

Hello Folks,

Today I’m going to take you through how to set up Variables in Ren’Py and what they would be used for in Interactive Fiction or Visual Novel games.

What is a variable?

A variable is basically just a way to store information or value as it is called in coding.

Some examples of that are Player Names, Pronouns, Stats, Health, Inventory. Honestly the list is endless and is only limited by your imagination.

You want a counter for every time you player sees a puppy. You can do that haha.

There are 3 main types of Variables I’ve found that come up the most in coding IF games. 

Boolean Values

Number Values

String Values

Setting Up Variables In Ren’Py

Things that are super important to remember. Variables have to be unique. This is because if you use the same variable name twice it will overwrite the input data to the new data. This works great if you want to add increases in Stat’s or decreases in health as it updates it but not for things like the Player Name for example. Steps

1. Create the Variable

You can set this up at the top of you main script.rpy Page or a separate variables.rpy 

My IF Template will come with a varaibales.rpy included for you to edit. 

Formula for True/False (Boolean) variable_name = False

Word Variables (String) You can set up Word Variables as None if you prefer it’s up to you. I always do false simply to save time when I writing a bunch of new variables some people prefer None so they can tell the difference between the 2 variables at a glance. variable_name = None or variable_name = False

Formula for Number Variables variable_name = 0

image

This is because Ren’Py will give you an error when it tries to run if it can’t find a variable. So it must be created first. You don’t have to type in init python: if you are listing the variables in the main script file as it already has it at the top. But if you create a new file for variables (like I have in the template) you need to type this at the top so Ren’Py can recognise it. 

2. Make the menu for the variable

If you want to see how to make a menu in Ren’Py please take a look at my Coding Choice Examples Post. I will be looking at doing a more in-depth post on Ren’Py in the future as well as having a few example menus in the template.

image

3. Set the variable in the menu. This is done by writing $ variable_name = “value”

image

And that’s it Voila! Your Variable is created and set, when the player chooses this menu choice it will set the string_name variable to words.

Want to display your variable? Simply type

[variable_name] 

So if we wrote

“Tell me the [string_name].”

The player would see the 

Tell me the words. I will show you different ways to display your variable soon.

Wait whats the difference between the Variables?

I will be going into more detail in a future post about variables but at the moment you can take a quick look at the top picture for a brief explanation. 

Variables are super important to Interactive Fiction so it’s great that Ren’Py makes it so easy to code. 

Hopefully this post made sense and gave you a basic idea about Setting Up Variables in Ren’Py. If you are an IF Dev and have been inspired to use Ren’Py for you IF Game let me know. I’m trying to put together some examples of games so people can see how versatile Ren’Py is. Thanks for reading till the end. :) 

More Posts from Cryptid-carrion and Others

4 years ago
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography
Todd Hido (American, B. 1968, Kent, OH, USA, Based San Francisco, CA, USA)  Photography

Todd Hido (American, b. 1968, Kent, OH, USA, based San Francisco, CA, USA)  Photography

4 years ago
The Whisper

The Whisper

4 years ago
Ludwig The Accursed

Ludwig The Accursed

3 years ago

“‘What is a ghost? A tragedy condemned to repeat itself time and time again? An instant of pain perhaps. Something dead which still seems to be alive. An emotion suspended in time like a blurred photograph, like an insect trapped in amber.’”

— Guillermo Del Toro, The Devil’s Backbone (via swordofdemeter)

4 years ago

i thought that “vein jewelry” was going to be. jewelry designed to look like veins, maybe? jewelry made out of real animal veins, at worst. it’s. it’s not. 

vein jewelry is jewelry you insert into your veins

I Thought That “vein Jewelry” Was Going To Be. Jewelry Designed To Look Like Veins, Maybe? Jewelry
I Thought That “vein Jewelry” Was Going To Be. Jewelry Designed To Look Like Veins, Maybe? Jewelry
I Thought That “vein Jewelry” Was Going To Be. Jewelry Designed To Look Like Veins, Maybe? Jewelry
I Thought That “vein Jewelry” Was Going To Be. Jewelry Designed To Look Like Veins, Maybe? Jewelry

there should be a german word for when you prepare to experience horror, but are still somehow shocked by how it plays out

4 years ago
Father Gascoigne X Vaal Hazak

Father Gascoigne x Vaal Hazak

4 years ago

halloween playlists

halloween: this year, we haunt our own houses. we haunt our own hearts.

vampire: eternity bites when you have lived for too long, when everything withers and you remain: when inside the sordid beauty of your wasted flesh the years flow together like poured wine or spilled blood. you have known the hunger longer than you have known anything else.

werewolf: even in the darkness the red eye is scorned: to escape the claws of the beast you must become it. under the moon you feel yourself crack open, your bones scrape against each other. every living thing must survive the curse of transformation.

ghost: everything becomes a ghost eventually. everything fades into the monochrome translucence of time. ah, but the ghosts remember: they shift silently through the dark. they hold the shape of all your memories. they carry the world like sisyphus. 

witch: you cannot burn what is already aflame. you cannot curse what holds all the curses in their mouth. you cannot condemn what has already kissed the dark. you cannot chain what has already mastered iron. you cannot tame a witch.

demon: everything comes with a price. your salt circles will not protect you when the deal has been struck. a red candle in the window attracts the things which creepy from the abyss. if you stare into the void, it may stare back.

4 years ago

What Exactly Gothic Is

(Let me preface with trigger warnings, because Gothic makes a point of delving into dark themes: murder, abuse, racism, homophobia, incest, ableism, misogyny)

I have seen certain posts about what the definite characteristics of gothic fiction are that, I hate to say…felt either incomplete or inaccurate. And that has bothered me enough to make my own post about, at the very least, my understanding of this genre. 

Some things to get out of the way:

Gothic does not have one fixed definition. It is fluid and nebulous, and while all literature reflects its society, genre changes massively depending on where it was written. Canadian Gothic is not Welsh Gothic is not American Gothic. Victorian Gothic is not contemporary Gothic is not Regency Gothic. Nineteenth century British gothic is often in response to the drastic technological changes of the industrial revolution. Welsh Gothic has a lot of focus on the disenfranchised and the coal mining industry. Where and when your WIP is, and where and when YOU are writing it, is going to define it. 

We cannot talk about Gothic as a genre without talking about the racism that much of it is rooted in. We cannot ignore Charlotte Bronte’s dehumanising description of Bertha Rochester, a creole woman. We cannot ignore that Edward Hyde’s physical description is less ‘white’ than Henry Jekyll’s. We cannot ignore Heathcliff’s identity as a racially ambiguous villain. We cannot ignore just how bigoted in every way Dracula is. We CANNOT ignore the whiteness of much of the ‘feminist’ gothic literature, either. This is something you must be aware of if you’re writing Gothic - it is not integral to gothic fiction but as I will explain, the traits of the genre lend themselves to antagonising marginalised groups.

Gothic is not just gothic horror. It can be horror, but it is still a genre in its own right and the horror is not mandatory.  

This post is about gothic as a literary genre. I will not be talking about Ostrogoths, Visigoths, gothic architecture or art, and - for once - I’m not talking about the Goth subculture either, the two actually have almost nothing in common.

Some frequent, though not all required, characteristics of the gothic (this is NOT a checklist. I cannot stress that this is a genre purposefully WITHOUT a clear definition):

Familial trauma - the ending of family lines (the presence of the aristocracy is common in Gothic, this trope perhaps most blatantly depicted in Edgar Allan Poe’s The Fall of the House of Usher), hauntings - not necessarily literal but metaphorical. There’s often a secret, or some kind of terrible incident that has been covered up, amongst a family that is inevitably unearthed. Marital trauma is very common - as seen in Jane Eyre with the original ‘madwoman in the attic’, the mystery surrounding the titular character in Rebecca, the secret room of The Bloody Chamber, the murdered husband being literally unearthed in House of America. 

The setting is everything in Gothic. It often has a presence enough that it is a character in its own right. Key things about the setting is that it’s typically old - or at least old enough to have a turbulent history - and typically remote, ‘feral’, in amongst nature and separate from civilisation. The latter is very often executed in a racist and/or xenophobic way in Gothic classics. Think very critically of what is considered ‘civilisation’ and what is not. Dracula being a novel about white Christian Britons being threatened by an Eastern European vampire? Don’t replicate that. You will also see the ‘sublime’ (see below) here, and motifs of decay (which can be linked to the ending of a family line easily!), and themes surrounding imprisonment and escape. Gothic fiction loves pathetic fallacy - whether a storm, fog, rain or bitter cold, the weather is absolutely there to set the tone.

Repression. This can be of a trauma, but repression of sexuality can feature too. I have seen it asserted that homoeroticism is a key component in Gothic, and while it can feature, I would not say entirely agree, for a number of reasons. There is often a focus on ‘taboo’ sexuality, a categorisation which places LGBT people with taboos such as incest (which features often in some forms of Gothic). Homophobic tropes such as the predatory gay villain (e.g. Dracula’s obsession with Jonathan Harker and Mrs Danver’s obsession with Rebecca) are fairly common, and a general treatment of homosexuality as immoral or depraved especially older texts, so let’s not act like it’s always been a LGBT friendly genre. Something either hidden away or repressed that is then discovered is a huge, huge, component to most gothic fiction. 

Misogynistic gender dynamics are often present: the combination of a young, vulnerable and innocent woman with an older male ‘Byronic Hero’ type love interest is common. The Victorian template of ‘bad’, ‘promiscuous’ or otherwise ‘improper’ woman reaching a sticky end is well loved. And then there’s Poe’s sinister obsession with ‘beautiful dead woman’. Don’t forget the intersection of ableism and misogyny with the ‘mad’ women like Bertha Rochester and Miss Havisham (though Eleanor Vance of The Haunting of Hill House is a sympathetic antidote of this trope.) The way women are written is something I’d very much like us to move beyond. 

The sublime: this is everywhere. That something, especially the wilderness, is beautiful and massive enough to be incomprehensible. 

Doubles or doppelgangers. Often as a ‘darker’ reflection of the protagonist - such as the hero and villain having close parallels, or the heroine as a foil to her husband’s mysterious dead first wife. It doesn’t have to exist just in this way, but the motif of the doppelganger is one Gothic fiction likes a lot.

‘Otherness’ or monstrosity. ‘Otherness’ and ‘Othering’ is something that is a crucial part of literary theory - what the narrative deems strange, unfamiliar, not like us, and so most depictions of monsters will also be Othered. Considering how almost all of the time in the Western literary canon this is a vehicle for racism, please think critically. Frankenstein’s monster has a more nuanced approach to what society defines as strange, or monstrous, how monstrosity is created, and self fulfilling prophecies. 

Cultural anxiety. This is by no means unique to Gothic but the genre is shaped by what the society of its creation is afraid of. This - like Frankenstein or The Strange Case of Dr Jekyll and Mr Hyde - can be scientific advancement and new discoveries we do not yet understand, but the problem arises that for a lot of Western Gothic this has been marginalised groups. 

The Uncanny. As found in various forms of horror - same with the fear of the unknown, but often in Gothic - that something resembles something else enough to recognise at least what it ‘tries’ to be, but not enough for it to be truly familiar. This is a really effective way to make any person, place, or thing unsettling.

I think I’ve covered most of my notes - please take my first bullet point into consideration as this will inevitably be a bit UK centric. The thing about gothic is that it doesn’t really have one fixed meaning, so you have a lot of freedom. Bonus: if you want to read a really good gay feminist Gothic short story, ‘The Resident’ by Carmen Maria Machado is one of the best pieces of fiction, ever. 

4 years ago
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For
Here’s A New Set Of Hi-res Phone Wallpapers/lockscreens Made From Some Of My Latest Artwork, Free For

Here’s a new set of hi-res phone wallpapers/lockscreens made from some of my latest artwork, free for you to use if you’d like! (If you’re on mobile, you can find a link to the full-size files in my FAQ) Love youuu ♥ 

  • variablecemetery
    variablecemetery liked this · 1 year ago
  • creamated
    creamated liked this · 2 years ago
  • lovaboy
    lovaboy reblogged this · 2 years ago
  • sulkcubus
    sulkcubus liked this · 2 years ago
  • stingrayghost
    stingrayghost liked this · 2 years ago
  • latlok
    latlok liked this · 2 years ago
  • cowpng
    cowpng reblogged this · 3 years ago
  • butchbarbie-psd
    butchbarbie-psd liked this · 3 years ago
  • im-thecream
    im-thecream liked this · 3 years ago
  • 118mmm
    118mmm liked this · 3 years ago
  • nowecouldnt
    nowecouldnt liked this · 3 years ago
  • dlina
    dlina liked this · 3 years ago
  • stup1dgl00my
    stup1dgl00my liked this · 3 years ago
  • pliumorsmth
    pliumorsmth liked this · 3 years ago
  • sirenwalker
    sirenwalker liked this · 3 years ago
  • umbralultimanium
    umbralultimanium liked this · 3 years ago
  • iceboxflapper
    iceboxflapper reblogged this · 3 years ago
  • insanemoonfish
    insanemoonfish liked this · 3 years ago
  • nolivesleft
    nolivesleft reblogged this · 3 years ago
  • doreiyakii
    doreiyakii liked this · 3 years ago
  • lostsaturnsong
    lostsaturnsong liked this · 3 years ago
  • kotilokiki
    kotilokiki liked this · 3 years ago
  • eveningrelics
    eveningrelics liked this · 4 years ago
  • th3-d3m3nt3d-1
    th3-d3m3nt3d-1 liked this · 4 years ago
  • mushroommortem
    mushroommortem liked this · 4 years ago
  • yoursnailprince
    yoursnailprince liked this · 4 years ago
  • tayareum
    tayareum liked this · 4 years ago
  • cinnermanspyce
    cinnermanspyce liked this · 4 years ago
  • kiddosapiens
    kiddosapiens liked this · 4 years ago
  • yaoi-creator
    yaoi-creator liked this · 4 years ago
  • dissociatingthoughtss
    dissociatingthoughtss liked this · 4 years ago
  • clowniestjoke
    clowniestjoke liked this · 4 years ago
  • 1000sunnyships
    1000sunnyships liked this · 4 years ago
  • 20somethinganxiety
    20somethinganxiety liked this · 4 years ago
  • bring-the-homo
    bring-the-homo reblogged this · 4 years ago
  • bakanekiprice
    bakanekiprice liked this · 4 years ago
  • foolishfancies
    foolishfancies reblogged this · 4 years ago
  • otomeuwu
    otomeuwu liked this · 4 years ago
  • zestecitron
    zestecitron reblogged this · 4 years ago
  • sarinarayne
    sarinarayne liked this · 4 years ago
  • r017
    r017 liked this · 4 years ago
cryptid-carrion - Spooky shit I like
Spooky shit I like

209 posts

Explore Tumblr Blog
Search Through Tumblr Tags