The Hundred Line -Last Defense Academy-

The Hundred Line -Last Defense Academy-

Not enough ratings
Adding Nozomi to auto-selected commander executions (Modding Part 3)
By ph0ne (greatijedi)
A guide for adding Nozomi to commander execution selection, when you're not allowed to choose who executes.
   
Award
Favorite
Favorited
Unfavorite
Getting Started
I'm naming this Part 3, but you can skip Part 2 and only read Part 1 for this: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3501114862

The type of mod created in this guide does not touch the mbe files at all. Instead, it touches the lua files.

The lua files in the game are compiled. To decompile them into something editable, you will need to use a lua decompiler. I know of two options for this:

Unluac: https://sourceforge.net/projects/unluac/ (You need Java's JRE to use this)
Online decompiler: https://luadec.metaworm.site/ (Don't need to install anything)
Finding and Decompiling the lua
This mod will be adding Nozomi to the execution that occurs on Day 21, when you choose "Kill" on the second playthrough.

I'll mention which lua file must be changed at the end of this section, but I'll describe how I found it first, just in case you want to find a particular event yourself.

First, decompile app_0.dx11.mvgl to a folder, and then decompile patch_0.dx11.mvgl . Overwrite the contents of the decompiled app_0 with patch_0. Then, decompile patch_1.dx11.mvgl , and overwrite app_0 with those contents as well. Delete patch_0. You should now have two folders - app_0 (the repository of all the relevant game data in the app_X line of data), and patch_1 (the relevant information to recompile in the app_X line of data, for the English version of the game). Make another copy of patch_1 if you want to make separate edits to it, but this guide will assume that you'll be operating on patch_1.

Enter app_0/lua. You will notice a very significant number of scripts in here. First, some rules of thumb:

  • First playthrough scripts have a prefix of r00. Second playthrough scripts use sYY, where YY refers to the chapter of the script.
  • Unique events that happen on a certain day are referred to by PYY_X_[routename]_[route branch path]_d[day number]_m[story stage]_[substage]
  • Overall event info for a certain day is referred to by by PYY_X_[route branch path]_d[day number]
  • The game's Chapter Select won't help you too much here. The text in underscores has very little to do with the script you're searching for. In fact, some of the days before the routes truly start are considered routes of their own.
  • The path to the 2nd Scenario takes naming priority over other routes.

So how do we find it? For this, we'll use the day. We know that the execution we want to change happens shortly after a decision on Day 21 respectively, and we can use that to our advantage.

The decision happens to occur on the 2nd Scenario line of routes, except for the latest decision. Let's check the overall event info first - this means the lua file s00_0_00_d021.lua . In there, we can see a reference to s09.

We can then conclude that the file we want has "s09" and "d021" in it. Since it will start its branch, it will be the first of its kind, as well. We can then find the first such entry - s09_0_boknoclt_00_d021_m010_010.lua .

After that, it's a matter of going down the file list until TodomeSelectInBattle() is called. This occurs in s09_0_boknoclt_00_d021_m010_020.lua .

When the file is decompiled, it's time to edit it to use Nozomi instead.
Editing and repacking the lua
In s09_0_boknoclt_00_d021_m010_020.lua , replace the name there with NOZOMI.


When done, place the edited file in the patch/lua folder, like this. You do not need to recompile the lua file:


After that, repack the patch folder into a patch_1.dx11.mvgl file, and overwrite the file in gamedata.
Checking the changes ingame
Now, load up the game. You can't go to the section after the choice is made; if you do that, the game will skip the execution. Instead, go to right before the choice on Day 21, and choose the option that leads to the execution.

A quick video of this mod in action:

I figured out how to let any of the playable characters perform an execution - that's in the next part of this modding series.