Revert mod

This commit is contained in:
Nutbuster 2021-10-12 06:31:39 +11:00
parent e1b0979e6c
commit 48913f8a83
5 changed files with 31 additions and 89 deletions

View File

@ -7,17 +7,6 @@ Examples include:
- You want to replace the entire story route
You can still call the vanilla game's chapters like the intro (call chapter_1) for example but you might want to either copy the vanilla scripts and mix in your edits to have full control
Run the convert.py included in the `mods/` folder
story.py -> one-liner exec('') rpy
for a 'debug' file you can still use rpy and call into it
```
'Name': "Mod Name", 'Label': (the exec string) or label in your rpy
```
for maximum compatibity with other mods (creating no conflicts with names) you will have to use the one-liner exec script
`python yourmod.rpy newmod.rpy`
Keep a `yourmod.rpy.original` included with the `newmod.rpy` as the game does a hash check between both of the contents files to confirm it's the same character for character the exact same for verification reasons.
We also recommend to license the script under `AGPLv3` just like Snoot Game.
You will need to learn bit of Ren'Py & bit of actual Python anyways but you don't have to think too hard in learning anything new other than familiarizing with this game's script.rpy's already defined Character objects and images, you can freely ignore most of the UI and so on for the inexperienced but passionate artist and/or writer.
Textbox limitation: ~300 characters / four lines, the maximum in the vanilla game's script is around roughly ~278 and that only barely overflows to four lines, so <200 characters / three lines of text should be fine.
@ -25,52 +14,42 @@ Textbox limitation: ~300 characters / four lines, the maximum in the vanilla gam
--- Ideal file structure of your mod ---
In the root of the mods folder:
folder_of_your_mod_name
- storyline.rpy
- name_of_storyline.rpy
-> asset_folder
-> images
- asset.png
-> sound
- song.png
- asset.png
-> script_folder
- script.rpy
`name_of_storyline.rpy`
name_of_storyline.rpy
```
init python:
# Modding Support variables
# All mod rpy files must have title of their mod (this shows up on a button)
# and finally the label that controls the flow of dialogue or the execstring
# and finally the label that controls the flow of dialogue
#mod_loader.add_mod(name, label/execstring) #return 'pointer' to your mod
#mod_loader.add_image(name, filename)
#mod_loader.add_variable(name, default)
#mod_loader.get(_id)
mod_menu_access += [{
'Name': "Mod Name",
'Label': "mod_storyline"
}];
mod_loader.add_mod("Mod Example", "mod_storyline")
mod_loader.add_image("asset", "mods/folder_of_your_mod_name/asset_folder/asset.png")
image template_sample = Image("mods/folder_of_your_mod_name/asset_folder/asset.png")
label mod_storyline:
call chapter_1_new
```
`script_folder/script.rpy`
script_folder/script.rpy
```
label chapter_1_new:
python:
mymod = mod_loader.get("Mod Example")
renpy.show(mymod['asset'])
renpy.say("Sample Text")
show template_sample at scenter
"Sample Text"
hide template_sample
play music 'audio/OST/Those Other Two Weirdos.ogg'
show anon neutral flip at aright with dissolve
A "Sample Text"
return
hide template_sample
play music 'audio/OST/Those Other Two Weirdos.ogg'
show anon neutral flip at aright with dissolve
A "Sample Text"
return
```
Do note that we do not write in the normal ren'py way (this also means you would have to translate the original script to a certain degree if you want to add in routes or whatever), save files are indepdenent from other mods and the main game, for example: you can't use the main game save file into your new mixed in mod.
You have to write the dialogue in the python way, all of the ren'py related stuff is possible as it's just syntax sugar for the actual python functions.
The funny thing is I don't even like 'fanfictions' to begin with but this mod support allows these 'fanfictions', ironic.

View File

@ -1,16 +1,13 @@
label chapter_2_new:
python:
mine = mod_loader.get(myid)
renpy.show(mine['template_sample'])
show template_sample at scenter
"Sample Text"
$ exec("renpy.hide(mine['template_sample'])")
hide template_sample
play music 'audio/OST/Those Other Two Weirdos.ogg'
show anon neutral flip at aright with dissolve
A "Sample Text"
F "Sample Text"
Lucy "Sample Text"
Ro "Sample Text"

View File

@ -1,18 +1,15 @@
init 100 python:
init python:
# Modding Support variables
# All mod rpy files must have title of their mod (this shows up on a button)
# and finally the label that controls the flow of dialogue
myid = mod_loader.add_mod("Example Mod Name", "storyline_ex")
mod_loader.add_image('template_sample', "mods_example/template/img/sample.png")
mod_menu_access += [{
'Name': "Example Mod Name",
'Label': "storyline_ex"
}];
#renpy.image('template_sample', mod_dir+"template/img/sample.png")
#mod_variable[0]["template_sample"]
#image template_sample = Image("mods_example/template/img/sample.png")
image template_sample = Image("mods_example/template/img/sample.png")
label storyline_ex:
call chapter_2_new

View File

@ -13,42 +13,11 @@
#Why yes all my code was formerly in one massive file called "script" thats 28k lines long, how could you tell?
#Licensed under the GNU AGPL v3, for more information check snootgame.xyz or the LICENSE file that should have came with this work.
init -3 python:
init -1 python:
# Modding Support variables
# All mod rpy files must run a small init python script
class ModLoader():
def __init__(self):
self.mod_dir = "mods/"
self.mod_menu_access = []
self.mod_id = -1
self.mod_variables = []
def add_mod(self, name, label):
#renpy.random.randint(a, b)
self.mod_menu_access += [{
'Name': name,
'Label': label
}]
self.mod_id += 1
self.mod_variables.append({})
return self.mod_id
# name, filename
def add_image(self, name, filename):
s = str(self.mod_id)+name
renpy.image(s, Image(filename))
self.mod_variables[self.mod_id][name] = s
print(self.mod_variables[self.mod_id])
def add_variable(self, name, default):
self.mod_variables[self.mod_id][name] = default
def get(self, _id):
return self.mod_variables[_id]
mod_loader = ModLoader()
mod_dir = "mods/";
mod_menu_access = [];
init python:
import random

View File

@ -67,7 +67,7 @@ screen mod_menu():
#buttons are messed up but that's ok
use mod_menu_button("gui/button/menubuttons/template_idle.png", "Return", ShowMenu("main_menu"))
if len(mod_loader.mod_menu_access) is not 0:
use mod_menu_buttons("gui/button/menubuttons/template_idle.png", mod_loader.mod_menu_access )
if len(mod_menu_access) is not 0:
use mod_menu_buttons("gui/button/menubuttons/template_idle.png", mod_menu_access )
else:
use mod_menu_button("gui/button/menubuttons/template_idle.png", "You have no mods", None)