Script rpy

Coding and VN Engine > script_rpy

Starting point when a new game is created, sets up important variables.

init: # Declare images below this line, using the image statement. # eg. image eileen happy = "eileen_happy.png"
 * 1) You can place the script of your game in this file.

# Declare characters used by this game. $ save_day = "Day 1" $ save_title = "The Beginning" $ e = Character('Eileen', color="#c8ffc8", kind=nvl,who_prefix='[', who_suffix=']', ctc = anim.Blink("img/ctc_1.png")) $ aya_t = Character(None, what_color=("#E6E6E6"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ akyu_t = Character(None, what_color=("#FCF9CE"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ alic_t = Character(None, what_color=("#C8D7ED"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ chen_t = Character(None, what_color=("#F7E0B5"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ chin_t = Character(None, what_color=("#E1FFCB"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ cirn_t = Character(None, what_color=("#D3D6FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ eiri_t = Character(None, what_color=("#C5C9FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ flan_t = Character(None, what_color=("#FFABAB"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ hina_t = Character(None, what_color=("#C1FFEA"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ kagu_t = Character(None, what_color=("#FFC9C9"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ kana_t = Character(None, what_color=("#FFABAB"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ kein_t = Character(None, what_color=("#C8CBE7"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ koak_t = Character(None, what_color=("#E6E6E6"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ koma_t = Character(None, what_color=("#FFABAB"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ mari_t = Character(None, what_color=("#FFFFFF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ mima_t = Character(None, what_color=("#C8D7ED"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ moko_t = Character(None, what_color=("#FFABAB"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ myst_t = Character(None, what_color=("#F0B8C8"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ nito_t = Character(None, what_color=("#C3CEFF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ patc_t = Character(None, what_color=("#E1BCE5"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ ran_t = Character(None, what_color=("#DDC7FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ reim_t = Character(None, what_color=("#FFC9C9"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ reis_t = Character(None, what_color=("#C8CBE7"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ remi_t = Character(None, what_color=("#FFC9C9"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ rumi_t = Character(None, what_color=("#E6E6E6"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ saku_t = Character(None, what_color=("#C5C9FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ sana_t = Character(None, what_color=("#E5F4E6"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ siki_t = Character(None, what_color=("#C5C9FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ suik_t = Character(None, what_color=("#F7DCBD"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ suwa_t = Character(None, what_color=("#A8F8B3"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ tewi_t = Character(None, what_color=("#FEE6F3"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ wrig_t = Character(None, what_color=("#91E5D5"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ youm_t = Character(None, what_color=("#9DD0C8"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ yuka_t = Character(None, what_color=("#D8B4FF"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ yuuk_t = Character(None, what_color=("#DDFFDE"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ yuyu_t = Character(None, what_color=("#C9E9FC"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ prot_t = Character(None, what_color=("#FEE6F3"), kind=nvl,what_prefix='"', what_suffix='"', ctc = anim.Blink("img/ctc_1.png")) $ narrator = NVLCharacter(None, kind=nvl, what_prefix='   ') $ _game_menu_screen = "overlay" $ style.nvl_window.background=Image("img/dia_box.png") $ style.nvl_window.xpadding= 40 $ style.nvl_window.ypadding= 40 #$ style.nvl_menu_window.background=Solid((0,0,100,100)) $ style.nvl_menu_window.ypos=0.5 $ style.nvl_menu_window.yanchor=0.5 $ style.nvl_menu_window.xpadding=10 $ style.nvl_menu_window.ypadding=10 $ style.menu_caption.size=18 #$ style.nvl_menu_choice_button.background=Solid((100,0,0,100)) $ style.nvl_menu_choice_button.ypadding=5 $ style.nvl_menu_choice_button.xpadding=5 $ style.nvl_menu_choice_button.left_margin=50 $ style.nvl_menu_choice_button.right_margin=10 $ style.nvl_menu_choice_button.hover_background=Solid((0,0,75,100)) $ style.nvl_menu_choice.size=18 $ style.nvl_menu_choice.color=(255,255,255,200) $ style.nvl_menu_choice.hover_color=(255,255,255,255) #$ style.nvl_menu_choice_chosen_button.background=Solid((0,100,0,100)) $ style.nvl_menu_choice_chosen_button.ypadding=5 $ style.nvl_menu_choice_chosen_button.xpadding=5 $ style.nvl_menu_choice_chosen_button.left_margin=50 $ style.nvl_menu_choice_chosen_button.right_margin=10 $ style.nvl_menu_choice_chosen_button.hover_background=Solid((0,0,75,100)) $ style.nvl_menu_choice_chosen.size=18 $ style.nvl_menu_choice_chosen.color=(200,200,255,100) $ style.nvl_menu_choice_chosen.hover_color=(255,255,255,255) $ style.nvl_label.minwidth=150 $ style.nvl_dialogue.size=18 $ style.nvl_vbox.foreground=Solid((100,100,100,100)) #$ style.nvl_entry.xfill=True $ style.menu_window.background=Frame("img/back1.png", 6, 6) $ style.menu_window.xpadding=20 $ style.menu_window.ypadding=20 $ style.button.background=Frame("img/back1.png", 6, 2) $ style.button.ypadding=10 $ style.button_text.size=18 $ style.window.background=Frame("img/say_window.png", 32, 32) $ style.window.xpadding=25 $ style.window.ypadding=30 $ style.window.yminimum=176 $ menu = nvl_menu $ config.adv_nvl_transition = None $ config.nvl_adv_transition = None $ config.nvl_page_ctc = anim.Blink("img/ctc_1.png") $ config.keymap['dismiss'].append('K_F5') image bg lake = "img/lake.png" image bg house = "img/house1.png" image cirno normal = "img/Cirno.png" image eirin normal = "img/Eirin.png" image kaguya normal = "img/Kaguya.png" image keine normal = "img/Keine.png" image exkeine normal = "img/EXKeine.png" image alice normal = "img/Alice.png" image ran normal = "img/Ran.png" image mokou normal = "img/Mokou.png" image momiji normal = "img/Momiji.png"

image yuka normal = "img/Yuka.png" image reisen normal = "img/Reisen.png" image rumia normal = "img/Rumia.png" image sikieki normal = "img/Sikieki.png" image sanae normal = "img/Sanae.png" image flandre normal = "img/Flandre.png" image mystia normal = "img/Mystia.png" image kanako normal = "img/Kanako.png" image nitori normal = "img/Nitori.png" image hina normal = "img/Hina.png" image koakuma normal = "img/Koakuma.png" image letty normal = "img/Letty.png" image reimu normal = "img/Reimu_48.png" image Day 1 The Beginning = "img/Day 1 The Beginning.png" image Day 2 The Beginning = "img/Day 2 The Beginning.png"

label start: $ renpy.clear_game_runtime show Day 1 The Beginning show Day 2 The Beginning hide Day 1 The Beginning hide Day 2 The Beginning scene bg house show reimu normal at left ## ""    ##  hide cirno with dissolve ## show eirin normal at left ## ""    ##  hide eirin ## show kaguya normal at left
 * 1) The game starts here.

## ""    ##  hide kaguya ## show keine normal at left

## ""    ##  hide keine ## show exkeine normal at left

## ""    ##  hide exkeine ## show alice normal at left

## ""    ##  hide alice ## show ran normal at left

## ""    ##  hide ran ## show mokou normal at left

## ""    ##  hide mokou ## show momiji normal at left

## "Momizi" "Hmm? Can I help you?" ## hide momiji ## show yuka normal at left

## ""    ##  hide yuka ## show reisen normal at left

## ""    ##  hide reisen ## show rumia normal at left

## ""    ##  hide rumia ## show sikieki normal at left

## ""    ##  hide sikieki ## show sanae normal at left

## ""    ##  hide sanae ## show flandre normal at left

## ""    ##  hide flandre ## show mystia normal at left

## ""    ##  hide mystia ## show kanako normal at left

## ""    ##  hide kanako ## show nitori normal at left

## ""    ##  hide nitori ## show hina normal at left

## ""    ##  hide hina ## show koakuma normal at left

## ""    ##  hide koakuma ## show letty normal at left

## ""    nvl clear

e "You've created a new Ren'Py game." e "Once you add a story, pictures, and music, you can release it to the world!" e "testing random" $ chance = renpy.random.random

if chance < .5: e "less than .5 ( %(chance)s )" else: e "more than .5 ( %(chance)s )" $ temp = (8 * (page-1) + 8) narrator "%(data)s" narrator "%(temp)s" nvl clear narrator "She turns around to face me. Contrary to her tone in the conversation we just held, her expression shows no elation, no sense of hostility. Only a calm certainty that whatever it was she told me, I wouldn't mind hearing it, even a thousand more times." narrator "Such a childish, innocent trust, so unfitting to her usual nature, her outbursts, malice, selfishness, it amazes me so much I find myself rooted in place, stopping just a few steps behind her." narrator "Am I really that soft?" reim_t "Stay with me." narrator "She asks - no - tells me to... Stay with her? It wasn't a plead, not even a request, yet the sound of her voice reveals some hidden, concealed determination." narrator "Maybe even hope." menu: "\"I...\"" "\"I'll stay here.\"": prot_t "I'll stay here." "\"I can't stay here.\"": prot_t "I can't stay here..." "\"...\"":           pro_t "..." narrator "And my answer is silence." nvl clear hide reimu narrator "Hakurei Shrine" reim_t "Reimu" suik_t "Suika" mima_t "Mima" narrator "Forest of Magic" alic_t "Alice" mari_t "Marisa" narrator "Human Village" kein_t "Keine" moko_t "Mokou" akyu_t "Akyu" narrator "Eientei" kagu_t "Kaguya" eiri_t "Eirin" reis_t "Reisen" tewi_t "Tewi" nvl clear narrator "Scarlet Devil Mansion" chin_t "Chuugoku" saku_t "Sakuya" patc_t "Patchouli" koak_t "Koakuma" remi_t "Remilia" flan_t "Flandre" narrator "Moriya Shrine" sana_t "Sanae" kana_t "Kanako" suwa_t "Suwako" hina_t "Hina" nito_t "Nitori" aya_t "Shameimaru" nvl clear narrator "Border of Death" yuka_t "Yukari" ran_t "Ran" chen_t "Chen" yuyu_t "Yuyuko" youm_t "Youmu" siki_t "Sikieiki" koma_t "Komachi" narrator "Youkai and Faeries" yuuk_t "Yuuka" cirn_t "Cirno" wrig_t "Wriggle" myst_t "Mystia" rumi_t "Rumia" nvl clear menu: "      While you were sleeping, you got transported to Gensokyo, and now that you have woken up, what are your plans?" "Get lost in the Forest of Magic so I can live with Alice.": jump lost_in_forest_1 "Visit the human village": call notdone jump lost_in_forest_1 "Find Reimu's shrine": call notdone jump lost_in_forest_1 nvl clear