How Can Him Go Inside But Me Not

how can him go inside but me not

More Posts from Cryptid-carrion and Others

4 years ago

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. :) 

4 years ago
Zillow House Listings
Zillow House Listings

Zillow house listings

4 years ago
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”
Avatar: The Last Airbender | 1.02 - “The Avatar Returns”

Avatar: The Last Airbender | 1.02 - “The Avatar Returns”

4 years ago
The Sign Hung Awkwardly, Nailed To The Trunk Of An Old, Warped Tree.

The sign hung awkwardly, nailed to the trunk of an old, warped tree.

“the woods are full”

They tossed it aside as they made their way to the camp site, never questioning what the woods might be full of, or who had written the sign. They’d look back on that moment, later.

4 years ago
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art
MTG Dragon Art

MTG Dragon Art

4 years ago

tell me something nice

3 years ago
Statue Of A Saint Damaged By The Sea Air, Parish Of St. Hilda, Hartlepool England

Statue of a saint damaged by the sea air, Parish of St. Hilda, Hartlepool England

4 years ago
Some Weird Dreams I’ve Had 
Some Weird Dreams I’ve Had 

some weird dreams i’ve had 

4 years ago
Color Out Of Space (2019) Directed By Richard Stanley
Color Out Of Space (2019) Directed By Richard Stanley
Color Out Of Space (2019) Directed By Richard Stanley
Color Out Of Space (2019) Directed By Richard Stanley
Color Out Of Space (2019) Directed By Richard Stanley

Color Out of Space (2019) Directed by Richard Stanley

4 years ago
There Was A Crooked Man And He Walked A Crooked Mile. He Found A Crooked Sixpence Upon A Crooked Stile.
There Was A Crooked Man And He Walked A Crooked Mile. He Found A Crooked Sixpence Upon A Crooked Stile.
There Was A Crooked Man And He Walked A Crooked Mile. He Found A Crooked Sixpence Upon A Crooked Stile.

There was a crooked man and he walked a crooked mile. He found a crooked sixpence upon a crooked stile. He bought a crooked cat which caught a crooked mouse, And they all lived together in a little crooked house.

There was a crooked man and he walked a crooked mile. The crooked man stepped forth and rang the crooked bell. And thus his crooked soul spiraled into a crooked hell. Murdered his crooked family and laughed a crooked laugh.

THE CONJURING 2 (2016) dir. James Wan

  • wurlitzerwolf
    wurlitzerwolf reblogged this · 1 month ago
  • asexual-thot
    asexual-thot reblogged this · 1 month ago
  • belowaverageintelligence
    belowaverageintelligence liked this · 1 month ago
  • phoneheadedtrans
    phoneheadedtrans reblogged this · 1 month ago
  • phoneheadedtrans
    phoneheadedtrans liked this · 1 month ago
  • zzz-doodles
    zzz-doodles reblogged this · 1 month ago
  • zzz-doodles
    zzz-doodles liked this · 1 month ago
  • acediaooc
    acediaooc reblogged this · 1 month ago
  • danny-and-hisshadow
    danny-and-hisshadow reblogged this · 1 month ago
  • caranthira
    caranthira reblogged this · 1 month ago
  • serotoninslutsyndrome
    serotoninslutsyndrome liked this · 1 month ago
  • madc0w
    madc0w liked this · 1 month ago
  • soapypartiallycleandishes
    soapypartiallycleandishes reblogged this · 1 month ago
  • davvid-b
    davvid-b liked this · 1 month ago
  • oojamaflip-whatchamacallit
    oojamaflip-whatchamacallit reblogged this · 1 month ago
  • sentientmoths
    sentientmoths reblogged this · 1 month ago
  • goosekid
    goosekid reblogged this · 1 month ago
  • thatonewildstar
    thatonewildstar reblogged this · 1 month ago
  • thatonewildstar
    thatonewildstar liked this · 1 month ago
  • cool-loser
    cool-loser reblogged this · 1 month ago
  • anothersaint
    anothersaint liked this · 1 month ago
  • kistaria
    kistaria reblogged this · 1 month ago
  • its-desdemona-but-call-me-des
    its-desdemona-but-call-me-des liked this · 1 month ago
  • templarcat
    templarcat reblogged this · 1 month ago
  • fruityhappiness
    fruityhappiness reblogged this · 1 month ago
  • fruityhappiness
    fruityhappiness liked this · 1 month ago
  • nearlysurvived
    nearlysurvived reblogged this · 1 month ago
  • nefariouscornweevils
    nefariouscornweevils liked this · 1 month ago
  • delyriosis
    delyriosis liked this · 1 month ago
  • wise-tortoise
    wise-tortoise reblogged this · 1 month ago
  • shhhhhgobacktosleep
    shhhhhgobacktosleep reblogged this · 1 month ago
  • crossedwithblue
    crossedwithblue reblogged this · 1 month ago
  • crossedwithblue
    crossedwithblue liked this · 1 month ago
  • chaoticeddie
    chaoticeddie reblogged this · 1 month ago
  • ikeberry
    ikeberry liked this · 1 month ago
  • azraanth
    azraanth liked this · 1 month ago
  • stardust-bitch
    stardust-bitch reblogged this · 1 month ago
  • crochetturtle
    crochetturtle reblogged this · 1 month ago
  • crochetturtle
    crochetturtle liked this · 1 month ago
  • redoftheturks
    redoftheturks liked this · 1 month ago
  • kae-karo
    kae-karo reblogged this · 1 month ago
  • trazzythegreat
    trazzythegreat liked this · 1 month ago
  • unclassyfied404
    unclassyfied404 liked this · 1 month ago
  • catatowastaken
    catatowastaken reblogged this · 1 month ago
  • catatowastaken
    catatowastaken liked this · 1 month ago
  • miko24
    miko24 liked this · 1 month ago
  • mira-mira-0n-the-wall
    mira-mira-0n-the-wall reblogged this · 1 month ago
  • mira-mira-0n-the-wall
    mira-mira-0n-the-wall liked this · 1 month ago
  • leodoesnt
    leodoesnt reblogged this · 1 month ago
cryptid-carrion - Spooky shit I like
Spooky shit I like

209 posts

Explore Tumblr Blog
Search Through Tumblr Tags