Co może być potrzebne?
- Edytor tekstu obsługujący kodowanie tekstu utf-8. Na przykład Notepad++. W żadnym wypadku nie używaj Microsoft Office, Libre Office: ich narzędzia są zbyt inteligentne do naszych zadań i… mogą zepsuć kod.
- Mapa zasobów gry [EN].
- Jeśli mapa zasobów nie jest dla ciebie wystarczająca, możesz uzyskać dostęp do zawartości pakietów rpa za pomocą tego narzędzia [EN]. W momencie edytowania tej strony, aktualna wersja rozpakowywarki jest odpowiednia.
- Dokumentacja silnika Ren’Py (jest głównie w języku angielskim, ale na YouTube i w innych zasobach często można znaleźć wskazówki w języku ojczystym).
- Skrypt napisany przez ciebie lub twoich przyjaciół (opcjonalnie oparty na fanficu).
Pierwsze kroki. Wskazówki dotyczące dodawania historii do gry
- Utwórz folder dla swojej historii. W tym celu… W folderze gry znajdź folder game, a następnie folder stories i utwórz w nim folder o nazwie zawierającej znaki alfabetu łacińskiego bez spacji, na przykład: harry_and_first_lesson. Powinien on otrzymać następującą ścieżkę: game/stories/harry_and_first_lesson/. W tym folderze zostaną umieszczone wszystkie pliki twojej historii.
- Dodaj plik z opisem swojej historii. Musi on mieć rozszerzenie rpy (możesz utworzyć nowy plik tekstowy, a następnie zmienić rozszerzenie z txt na rpy). W tym pliku należy zawrzeć informacje w formie słownika (kod-wartość). Pozwoli to grze zobaczyć i uruchomić twoją historię.
Oto szablon:
init -100 python:
mods_list.append({
"name": "Name of your story", # Title. This is a comment to the code
"tech_name": "unique_story_name", # All labels and variables of your story should start with this!
"description": "Description of your story", # Description of your story
"language": "en", # Language of the story (e.g, 'de', 'en')
"start_label": "label_start", # Label for start
})
label label_start:
"Your text or actions here. Your story starts in this block of code."
return
3. Jeśli chcesz użyć dodatkowych zasobów: muzyki, tła, postaci, możesz dodać dla nich foldery w folderze swojej historii. Ich nazwy mogą być następujące: images, sounds, music, characters.
Wskazówki:
- Upewnij się, że nazwy plików, folderów i etykiet są unikalne, aby uniknąć konfliktów. Zawsze zaczynaj je od „unique_story_name”. Przykład można zobaczyć w folderze stories/example_story
- Dla wygody używaj komentarzy w kodzie: dodaj symbol #, a po nim określ, do czego służy ten fragment kodu. Będzie to przydatne, gdy za pół roku zdecydujesz się przypomnieć sobie, co tam napisałeś…
Testowanie
Upewnij się, że historia jest poprawnie wyświetlana na liście tych właśnie historii w grze i działa bez błędów.
Lekcja profesora Flitwicka
Tak mógłby wyglądać kod krótkiego opowiadania z wykorzystaniem tła i postaci.
init -100 python:
mods_list.append({
"name": "Professor Flitwick's school for creating stories",
"tech_name": "flitwick_school_en", # Unique name for the story
"description": "Professor Flitwick will teach you how to create stories for this game!",
"language": "en",
"start_label": "flitwick_start_en", # Starter Label
})
label flitwick_start_en:
scene bg chants day
show fl norm:
xalign .32 ypos 30 zoom .4
show chants_tumb
show chants_tables day
with Dissolve(1, alpha=True)
fl "Welcome to my School for creating stories! Today I'm going to tell you how to create a story for this game."
fl "It's very easy if you follow my instructions. Shall we get started?"
fl "First, create a folder for your story."
fl "It should be placed in the {color=#6495ED}game/stories/{/color} folder, and named so that it is clear what kind of story you are creating."
centered ""game/stories/your_story/""
fl "Second, you need to add a script file. Let's name it, for example, {color=#6495ED}your_story.rpy{/color}."
fl "This file should contain information about your story. For details on how it is written, see the README.md file."
show fl lecture3
fl "Note the {color=#6495ED}"tech_name"{/color}! This is a unique name to avoid conflicts. All your variables and labels must start with it."
show fl smile
fl "Next, create a label with your start script. It should match the {color=#6495ED}"start_label"{/color} from the dictionary."
fl 'label label_start:n "Your text or actions are here."n return'
fl "If your story uses resources - images, music, and so on - put them in the same folder as your script."
fl "For example, images can be put in the {color=#6495ED}your_story/images/{/color} folder."
fl "After that, test your story. Make sure it shows up in the stories list and runs without errors."
fl "That's it! Now you know how to create stories for this game. Good luck!"
fl "And remember: unique variable names are the key to successful stories creation!"
return
Tłumaczenie: Giesche