Closed FredrikLindgren closed 9 years ago
Thanks!
I didn't consider the possibility of overwriting existing MOS v2 files. The current pseudo code implementation overwrites the target MOS file only and allocates a new block of PVRZ indices. Theoretically, by repeatedly calling INSTALL_MOS with the same parameters, the game will be flooded with the same PVRZ files over and over.
I can only think of three possible solutions. Each one has (more or less) severe drawbacks however:
This is a working implementation of PVRZ-based BAM/MOS install routines: pvrz_funcs_v2.tph
It includes the necessary functions and a few examples how to use them properly. I have also uploaded two mods for testing purposes (Test mod 1 and Test mod 2).
I'm not familiar with your policy how to handle unexpected situations, so I have tried to handle them as unobtrusive as possible by using LOG or WARN rather than FAIL depending on the situation.
I'll try to look this over and integrate this no later than next weekend. I will make some minor changes. Notably, public, documented symbols will be put into the UPPERCASE_NAME_SPACE_WITH_UNDERSCORES. There may have been one or two other things, but I forget (either way, I'll be keeping you informed).
For unexpected situations, I try to use FAIL when the problem is such that the mod cannot be successfully installed without problems arising during game play. WARN should inform the user there may be a problem. He or someone knowledgeable will have to decide if it is a problem (e.g., "special whatever not possible; using default whatever instead") and LOG should be informative for those who look at debug files (which is typically the modder) but preferably not contain anything the player should be made aware of (not that PRINT is much good for that, anyway).
I've discovered a small bug in pvrz_funcs_v2.tph at line 387.
The line PATCH_IF (min_index = "-1" || max_index == 100000) BEGIN
has to be replaced by PATCH_IF (min_index == 100000 || max_index == "-1") BEGIN
.
Included. Thanks. I only ended up changing an additional few details concerning variables (e.g., you never need to enclose integers in percentage signs when you use them as integers).
Feature requested here.