Norbert wrote:SuavePrince wrote:i wanna use sdlpop in my mods,and all mods ..is possible create a options easy such as apoplexy?...you can create this Norbert??
The next SDLPoP release will most likely allow its users to modify SDLPoP.ini to specify custom starting minutes, starting hitpoints, and to enable triggering of any tile. Falcury worked on these options.
Adding extra CusPop options as INI settings is fortunately not very hard, now that the basic system works (although there are a LOT of options!). Of course, it is necessary to find the correct spot in the code for each hack. (Is there a reference somewhere for what each of the hacks exactly does at the byte level?)
To see how similar options can be added to SDLPoP with relatively little work, you can for example take a look at
this commit. (So far I did a few options going from the top down, on the
CusPop page) The commit does the following:
- Pick a name for a new global variable in data.h (for example, "max_hitp_allowed" for maximum life points) and specify the unmodified value.
- Modify the relevant code so that it makes use of the value of this variable (for example, in seg001.c, "if (hpmax > 10) hpmax = 10;" becomes "if (hpmax > max_hitp_allowed) hpmax = max_hitp_allowed;")
- In options.c, in the function ini_callback(), specify how the option in the INI file should be read and then used to set a new value for the newly added global variable when the game starts
- Add the option to SDLPoP.ini
I wonder what should be done with array data. For example, should a guard hp setting be defined in the INI file as follows...?
Code: Select all
guard_hp = {4, 3, 3, 3, 3, 4, 5, 4, 4, 5, 5, 5, 4, 6, 0, 0}
Or should we maybe split this up, like so:
Code: Select all
guard_hp_level1 = default
guard_hp_level2 = default
...
The first option is perhaps cleaner, but using "default" to refer to the unmodified value then becomes a bit unwieldy:
Code: Select all
guard_hp = {default, default, default, default, default, default, default, default, default, default, default, default, default, default, default, default}
So perhaps another option is something like a single character "wildcard" for unmodified values in arrays?
Code: Select all
guard_hp = {*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *}