Priw8 / sht-webedit

a tool for editing .sht files used in various Touhou games
20 stars 5 forks source link

# sht-webedit a tool for editing .sht files used in Touhou games - https://priw8.github.io/sht-webedit/

Supported games

the tool will be updated with support for more games.

Features

TODO

How .sht files work

TH10+

Basically there's a header (the "main" table) which stores the basic information. After the header, there are option positions for each power level (power level = option count). Then there's the shooterset offset array, which stores offsets of shootersets in the shooterset array. The shooterset array comes right after the shooterset offset array, and consists of shootersets separated by 4 FF bytes. Basically, if pwr_lvl_cnt (max power level) is 4, there should be 10 shootersets - 5 for each power level of the unfocused shot and 5 for each level of the focused shot (0 power shooterset exists, despite power starting at 1 in the game. It's used in HSiFS during the Okina finals). In some cases, there can be more shootersets (TD has one more for trance mode). A shooterset itself is a set of shooters (duh). A shooter contains data of a single bullet the player/option fires, and the frequency it should fire at. So if you want an option to shoot 2 bullets at once, you have to assign it to 2 shooters.

TH07, TH08 (TH06 doesn't have .shts, shot data is probably hardcoded)

It's quite a bit different than TH10+. Most notably, option table doesn't exist (options probably hardcoded), and there's no focus/unfocus split in the file itself - there are 2 .shts per shottype, 1 for unfocused shot and 1 for the focused shot. There are also more things that can be modified there, such as at what height PoC is. Power levels work differently too, as the .sht controls when the switch to the next shooterset occurs. This and there are up to 129 power levels available (0-128 inclusive)

Brief usage instructions

main table

option_pos table

(I think it doesn't require explaining)

sht_off table

the shooterset offset array, you can ignore it as the offsets are recalculated automatically when exporting

sht_arr tables

shootersets for each power level of focused/unfocused mode. There's also "extra" at the end, this is where unusual things like TD trance shootersets go

shooter tables

more about fire_rate/start_delay