CusPop options in SDLPoP
Posted: October 15th, 2016, 11:14 am
Quite a few CusPop options are being added to SDLPoP in the new release.
However, the options that edit the special events of the game are still missing as of yet.
I have been wondering how we should handle these options...
Most special event options are tied to a particular level in the code using a comparison with the current_level variable, like so:
So, say that we want to allow using a checkpoint in another level than level 3, for instance:
The easiest option would be to allow current_level to be compared with other values, and add an option to the [CustomGameplay] section of SDLPoP.ini like this:
But, suppose we would like to use a checkpoint in more than one level. We could quite easily add this functionality. We could maybe create an SDLPoP.ini option like this:
One way to implement this would be to use a bitfield (with 1 bit for each level) to store the level information for a specific special event, write a small function to extract the information, and then use that like so:
So, do we want this (multiple levels for each special event) to be possible? And if yes, would this be a good way to implement it?
However, the options that edit the special events of the game are still missing as of yet.
I have been wondering how we should handle these options...
Most special event options are tied to a particular level in the code using a comparison with the current_level variable, like so:
Code: Select all
// Special event: set checkpoint
if (current_level == 3 && Char.room == 7) {
checkpoint = 1;
hitp_beg_lev = hitp_max;
}
The easiest option would be to allow current_level to be compared with other values, and add an option to the [CustomGameplay] section of SDLPoP.ini like this:
Code: Select all
checkpoint_level = 3
Code: Select all
; If desired, you may enter multiple level numbers (separated by commas)
checkpoint_level = 3, 4, 7
Code: Select all
// Special event: set checkpoint
if (is_special_event_level(checkpoint_level) && Char.room == 7) {
checkpoint = 1;
hitp_beg_lev = hitp_max;
}