Renpy-Tutorial【#11】Let's write a visual novel together【Part 2】

This is the second half of the 10th chapter

Although after reading the above one, you can already make a visual novel but to make your visual novel look even better, there are still many things that can be done/improved


    First of all, this is the final result of the last article

    The Tutorial included in it is

    - Basic Renpy code/scripting (like defining characters, pictures, etc.)

    - Let the player enter their own name

    - Favorability system

    - According to the player's image/selection to decide the subsequent plot (IF function)


    This article will mainly improve the display and make the whole game look more nice

    Then straight ahead! 

    ------------------ Divider  ------------------

    1. Disappear characters who don't speak / Make characters who speak more obvious

    You can use transition effects + hide to make the character exit the scene - Preview VIdeo

    The code I use:

    m "Then I'll leave first"

    hide mika

    with dissolve

    l "I should leave too"

    hide lia with moveoutleft

    -----------------------------------------

    My view is that I prefer to keep the characters on the field - it just makes the characters who are not talking look a little darker so that the player can visually see who is talking.

    To show this feature, you need an normal stand image

    Like this, here is the stand image I used in this project:


    And here's the image I used to show when she wasn't talking:



    This is what it will look like later - Preview Video

    When you have these 2 pictures ready, you can open your script.rpy

    Delete the line that originally defined the picture and replace it with this code:


    image name of the image =ConditionSwitch("_last_say_who == 'character code'","path to the image", #(the image used when the character speaks) "not _last_say_who == 'character code''", "path to the image") #(the image used when the character IS NOT speaks)


    So the code I use in this project looks like this:

    image lia =ConditionSwitch("_last_say_who == 'l'","images/character/lia.png","not _last_say_who == 'l'", "images/character/lia dark.png")

    image mika =ConditionSwitch("_last_say_who == 'm'","images/character/mika.png","not _last_say_who == 'm'", "images/character/mika dark.png")


    Note! _last_say_who == 'Character ID' and not _last_say_who == 'Character ID' 

    The word that follows is the character's code, not the character's name.

    My character's name is Mika and the codename I use when defining the character is m so I'm going to take m instead of Mika

    (( This line-->  define m = Character('Mika', color="#000000")


    2. Add more possibilities (extension of If Function)

    For the code in the previous article, it will automatically choose a character with a higher favorability to accompany you

    And I want to add more selections in this article - that is, the player's favorability must be greater than a certain value to go with a certain character, when the relationship between the player and each character is not high or does not reach a certain value. just go by yourself

    So now to go back to the final label

    label final:

    if lia_aff >= mika_aff:

        jump lia

    else:

        jump mika


    I would change the above code to this:


    label final:

    if lia_aff >= 3:

        jump lia

    elif mika_aff >= 3:

        jump mika

    else:

        jump alone

    ------------------ Divider  ------------------

    if lia_aff >= 3:- If lia's favor is greater than 3

         jump lia- Then jump to the label called lia

    elif - If the If clause in the above sentence does not right

     elif mika_aff >= 3:- Enter the If clause of this sentence (if mika's favor is greater than 3)

        jump mika - Then jump to the label called mika

    else:- If none of the If clauses in the above 2 sentences are valid

        jump alone- Then jump to the label called alone


    The effect shown later  -  Preview Video

    The first paragraph is when all 3 choices are selected in the choice menu that will increase lia's favor, so lia's favor will be greater than 3, then the player will follow lia.


    The second paragraph is when  2 of the 3 choices are in the place that will increase lia's favor, but the third choice increases mika's favor, whether it's mika or lia's favor is less than 3, so the player has to go by himself


    Add one's affection point and reduce one's affection point 

    Another way to use the If sentence is when the player chooses a certain image, it will increase Mika/Lia's favor but also reduce the other character's favor.

    This is the code sample I used this time :

    m "Question 1 - Do you prefer apple or banana?"

    menu:

        "apple":

            $ lia_aff += 1

            $ mika_aff -= 1        

            jump q2

        "banana":

            $ mika_aff += 1

            $ lia_aff -= 1            

            jump q2

    ------------------ divider ------------------

        "apple":-If the player chooses a selection like "apple"

            $ lia_aff += 1- Then lia's favorability will increase by 1

            $ mika_aff -= 1        - But mika's favor will be reduced by 1

        "banana":- If the player chooses a selection like "banana"

            $ mika_aff += 1- Then mika's favor will be increased by 1

            $ lia_aff -= 1            - But lia's favorability will decrease by 1


    3. Add a floating icon after a dialogue

    An icon appears in the dialog when the character finishes speaking

    like this:


    First you need to prepare a small image (here I used a 24x24 image)
    Then add this piece of code to the script:
    image ctc_blink:
           "Path of this image"
           linear 0.25 alpha 1.0
           linear 0.25 alpha 0.0
           repeat

    The numbers after linear and alpha can be changed freely according to requirements

    After adding the above code, add ctc="ctc_blink after the code of the character definition.

    example:

    define m = Character('Mika', color="#000000", ctc="ctc_blink")

    define l = Character('Lia', color="#9e3bad", ctc="ctc_blink")

    After that the dialogue will look like this - Preview Video


    If you change linear to 0.75

    The icon jumps a little slower - Preview Video


    ----------------------------------------- Divider -------------------------------------

    If you finished your game, dont forget to create a landing page or website for that game!

    I recommend you to use Wordpress AND using Elementor Website Builder (A nice Wordpress plugin) to help you! 

    Elementor Website Builder
    Renpy-Tutorial【#11】Let's write a visual novel together【Part 2】 Renpy-Tutorial【#11】Let's write a visual novel together【Part 2】 Reviewed by NingNing on September 10, 2021 Rating: 5

    1 comment:

    Leave A Message!

    Powered by Blogger.