it ain't rocket science to be honest.
the theory.
game level has an object.
this object has a certain script assigned via TRG file, gappolyhit in paricular. (trg files are somewhat like nodearrays in level qb files in th3 and onwards)
when you hit the object, it triggers that gap script.
the gap script has some params, gap index in particular. just a number.
how do we know the name of the gap, knowing the index?
if you open the original executable at 0x13e718 you'll find the array of gap structs: gaptype (air, manual, rail, etc), carrer specific flags (like denotes if that is a goal gap), the index we need, score and gap text. this is a huge array of all gaps in the game.
when you run the game via launcher it reads levelpatch.ini and this particular line: 0x0053E718=(file)thps4_gaps.bin reads the file given and writes it to the address given, the one where gaplist is located.
basically, we simply replace the th2 array with a custom one.
so your goal is simple, generate the gap list in the proper format.
how do we get that? now that's a different story.
the original executable had some thps1 gaps, but they were broken.
so i had to read ps1 gap array from the corresponding game.
the array is somewhat similiar, except it stores a pointer instead of an actual text.
so it's one extra step to learn ps1 memory adressing and find proper names.
once done, you have a proper gap list.
this is what i did for thps1 and thps3.
then for thps4 vicarious visions changed format and now it's not a single array anymore.
even more, it's not even in the executable, but rather splitted in chunks over some data files.
so basically there are 2 ways to restore thps4 gaps.
either you dig data files, find some pattern and restore correct gaps directly (which is far harder than th1-3)
or you can add a dummy list of indices with random names and hope they'll trigger once you hit the gap.
alternatively you could search trg file for indices, but i believe it doesn't fully match for some reason.
at least that's what i vaguely remember from the last attempt.
i only added college and it was like 1 by 1 manual work for every gap
as of mhpb levels, it's different. whoever developed mhpb, they changed trg calls and included all the gap names there. so th2 exe can't parse that correctly, since it expects index there instead of a name. to fix that you'd either require to rebuild all mhpb trg files or patch the game code to parse gappolyhit params for mhpb in a different way. both are rather unrewarding and require too many things to make it work.
i could check if i have any helper tools left.