Angels with Scaly Wings

Angels with Scaly Wings

Modtools
Blue  [developer] 6 May, 2018 @ 5:41am
Creating your first mod
So I guess it's time to write up some basic instructions on how to create a mod for Angels with Scaly Wings. This thread will be on setting up your basic environment and creating a minimal mod that will get detected by the game.

I'll be assuming you understand the basics of Ren'py for this as there are plenty of tutorials for it out there. Documentation on it can be found here[www.renpy.org] for reference, but this is probably unsuitable for just starting. If you're unsure on it, you can look at the core game files after this tutorial and see how it looks in general. The code for the game itself is not the best and plenty of things could be done better.

Decompiling the game

The first thing you'll need to do to start writing mods it to decompile the game if you've not done so already. I've already written a tool for this that can do it for you automatically with little to no input from you. It can be downloaded here[cdn.discordapp.com]. Just double click the program and it should automatically find the rpa file for the Steam installation. If you want to decompile the default Steam installation, the place it gives you by default should work fine but you can choose a different install if you want to.

Note that whenever an update is released for the game, you'll need to repeat this step to get it as the game engine, Ren'py, prefers to use the decompiled code over the packaged code.

Installing an editor

I'd recommend using Atom[atom.io] or Pycharm Community Edition[www.jetbrains.com] for coding Ren'py. Notepad++ works as well, but it requires some configuration so as to not mix tabs and spaces. Whilst I use Pycharm, Atom is probably the best solution for a beginner. You can install a Renpy linter[atom.io] for it, but I've not tried it personally and I'm not sure how well it supports the version AwSW uses.

Installing the modtools and enabling Developer mode

Well, this is a rather important step. You'll want to install the latest version of the modtools, which you can do by subscribing to a mod on Steam. I'd recommend having the Dev Mode mod installed for this regardless because it can make your life easier. Just be careful with it and make sure you don't do anything too silly with it because it can break your game if misused, just like writing a regular mod can. It allows you to open up the developer console ingame with shift-o and run Ren'py code such as jumping to some code or changing some variables.

You'll need to be ingame (as in actually in the game, not the main menu or splash screen) for the jump command to work but the format is simply
jump label
and
variable=value
for regular variables and
persistent.variable = value
for persistent ones. To find labels, simply go to the file the scene you're interested in jumping to is part of and find some text starting with
label <name>:
These are points where you can simply jump to.

Creating a barebones mod

Navigate to the mods folder. It should be in `...\game\mods`. You can find your game install by using the Browse Game Files button[cdn.discordapp.com] in Steam if you don't know how to get to the game's install location.

Create a new folder in the mods folder and call it something descriptive about your mod.


Now in your editor, create a new project in the game folder and a new file in the folder you just created. Call it "__init__.py".

Next we'll create the very basics of your mod, which will show it up as installed in the mod menu.

Simply paste this code into your __init__.py file:
from modloader.modclass import Mod, loadable_mod @loadable_mod class AWSWMod(Mod): def mod_info(self): return ("Mod name", "version number", "Author") def mod_load(self): pass def mod_complete(self): pass

The first line imports the required modtools files to create a mod. We'll add more to this later as we add more content to our mod, but this'll be in another tutorial if I get around to it.

The lines
@loadable_mod class AWSWMod(Mod):
create a class for your mod to live in and register it with the modtools.

def mod_info(self): return ("Mod name", "version number", "Author")
This tells the modtools some information about your mod. The version number should be something like "v0.1" or something in that format. If your mod is going to be NSFW, use the following structure instead:

def mod_info(self): return ("Mod name", "version number", "Author", True)

Note that NSFW mods are NOT allowed on the Steam platform so you'll have to distribute them elsewhere.

def mod_load(self): pass
This code runs in the initialisation step. Here you'll want to add your hooks between the core game and your content. We're leaving it empty for now but it's the first thing you'll want to change to actually get your mod working

def mod_complete(self): pass

This function can normally be left empty. It's called after every mod has been detected and initialised. Here you can do stuff like integrating with other mods if you want to but in most mods, it's not needed to be anything other than this. Here's a screenshot of the mod menu with the mod installed[cdn.discordapp.com]
Last edited by Blue; 6 May, 2018 @ 5:51am
< >
Showing 1-4 of 4 comments
Blue  [developer] 6 May, 2018 @ 5:50am 
If there's any confusion over this, feel free to reply. If anyone wants to me to write some more stuff on how to write a tutorial on a modtools related topic, comment what you want me to try and go over. Currently I'm thinking of going over the process of doing a simple hook from the game to a custom scene as well as uploading a final mod.

I'll probably be writing these in the modtools topic rather than the workshop one to make it more organised and have left a link from there to this particular topic
Last edited by Blue; 6 May, 2018 @ 5:53am
Zortex 5 Jan, 2019 @ 11:29am 
Looks pretty good. I'm a novice coder, but this seems easy enough to understand. I'll be interested in seeing exactly how AWSW is structured, but that's a little out-of-scope, as I'd need to learn Renpy and optimally pick apart some mods or actual game code. I'm pretty happy with this tutorial, and I'll be trying my hand at some modding in the future, probably.
Thanks for writing this, I now know where to start.
EDIT: I'm using linux. Is there an extractor I can compile on here or should I use Wine?
Last edited by Zortex; 5 Jan, 2019 @ 11:32am
Blue  [developer] 7 Jan, 2019 @ 2:47pm 
If you look at the modtools documentation, you can find the decompilation instructions that use 2 python scripts to decompile - the exe is just an combination of the two with some extra logic to automatically find the correct folder.

https://awsw-modding.github.io/AWSW-Modtools/decompiling.html

There is a list of folders and their purpose on that page also, and what the code in the game is used for is fairly obvious, aside from the evilendings file being used for some seemingly random other functionality
Deadvenom56 21 Jan, 2020 @ 4:21pm 
im extremly confused with all of this no idea what decompling is
< >
Showing 1-4 of 4 comments
Per page: 1530 50