Mod RPGM Sana Revamped [v0.1 Test, v0.1 Light Version] [WIP] [DevLog Thread]

5.00 star(s) 2 Votes

ElDonBigotes

Member
Nov 22, 2020
218
62
Mod Support Devlog 2: Creating Game Settings

Trying to post devlogs more frequently, I wanted to continue the last devlog about scripts, like I said, I have been refactoring the mod's code to allow other mods to interact with the systems easier. This one won't be as long as the first one tho.

As for this devlog, I have been working on modifying the mod's game settings module to allow any installed mod to create custom game settings and categories (a settings page) on the game's without too much hassle. Thankfully I had a solid foundation to work on due to the last modification I did for the game settings in a previous devlog.

All settings must be created using a script, this can't be done in another way, taking advantage of the initialization event the sana revamped sends you can make your mod create any number of settings and add them to the mod's settings module right after the game launches.

There are also some other changes I have made to the original Settings menu I shared some time ago, I have modified the script to allow to change the value of any slider setting in increments/decrements of 10 if SHIFT is pressed while changing the value, this is something that was needed, especially for sliders that allow large number ranges.

Here's an example of a settings page, I have created two mods, each of them creates a page on the settings menu with their own settings:

You can interact with the settings menu with the confirm key ('Z') that cycles through all possible values, left and right arrow keys to change to the prior and next value.

The supported type of settings are:
  • List Setting
Allows the user to select a string value from a fixed list of values ("English", "Spanish", "German", etc...)
  • Slider Setting
Allows to select a number value from a fixed range of numbers (-100..100, 0..10, 0..100, 0..1000, etc...)
  • Switch Setting
Acts as a toggle, basically ON/OFF => true/false

However, there is one drawback, and that is that the code to create a page within the game settings menu is quite long and verbose.

As an example, here's the code that creates the settings page for the "Side Stories" mod that appears on the menu:
You don't have permission to view the spoiler content. Log in or register now.

Each setting needs to set a few handlers so it can work properly, I have created some default handlers, but you can also set it to your custom ones if desired.

Moving on, the settings menu is now able to reset a setting default value by pressing 'R' on the current highlighted setting, as you can see in this gif all settings are reset to the default value in different pages (whether they are created by a mod or by the game itself)

Like I said, I'm trying my best so the mods don't need to save data into save files, to avoid the possibility of the files becoming corrupted, that's why I have done this so mods can save any setting in a external file easily without modifying save files.

Here's is a piece of contents of the JSON file generated with all settings:

JSON:
{
    "sr_dev_console_enabled": true,
    "sr_dev_logging_enabled": true,
    "sr_language_id": "english",
    "sr_audio_master_volume": 32,
    "jd_first_mod_enabled": true,
    "jd_first_mod_extra_content": true,
    "jane_doe_side_stories_mod_enabled": true,
    "jane_doe_side_stories_on_off_value": true,
    "jane_doe_side_stories_list_value": "Hard",
    "jane_doe_side_stories_slider_value": 8
}
Also, I have changed how the settings are saved and loaded to avoid deleting setting IDs that may not exist in the game, which means that you will be able to add and remove mods and their settings won't be deleted from the JSON file, it will persist inside of it, in case the mod is installed again in the future, it will be able to load the old settings back without problems (as long as their IDs has not changed)

Just in case, I also added a function to the Settings module to perform a cleanup on the JSON file to delete settings that does not exist currently, just in case anyone wants to clean their JSON file.

I'm currently making the same changes to the In-Game console module so any mod can create and add their own commands to debug the game, but it's not currently finished so I will talk about this in the next devlog!


My god this is pure gold, if I had any programming knowledge I would be trying to increase the content, this is one of my favorite h games.
(English is not my mother tongue)
Thank you very much for your work
 
  • Like
Reactions: tygct

tygct

Member
Jun 6, 2017
123
517
Mod Support Devlog 3: Creating Console Commands

Hey, it's me again :), Let's try to keep up this devlog weekly posting

I have finished working on the console module to allow mods to create custom commands.

The downside of this is that I had to change the way commands were created to support mod commands, which has resulted in many commands that I had previously created being missing now (like the teleport command), but at least modders can create commands without too much trouble, just a script call, I'll have to bring them back, but it's not a priority now.

While I was doing this, I have made some improvements to the console, some of them are purely aesthetic and others are necessary to avoid problems in the future.

As you can see, the console window can show text with colors on the screen, also, the window size is now bigger, so the output text is clearer.

The help command (man) has been modified to support mods

console overview.gif

I have also made a modification to allow you to type long commands in the console input, previously, when the length of the command exceeded the width of the window, it was cut off, now you can type long commands and you can actually see what you are typing.

console long commands.gif


Now to the code part :geek:

The code needed to create commands is much simpler than the one needed to create mod settings, you can take a look in the spoiler below.

You don't have permission to view the spoiler content. Log in or register now.

stdout.png

You can define the command logic to run inside a block or declare a new module and create the functions there, which is tidier, it's up to you.

All the arguments that are sent to the command when called, are strings, that means, you will have to interpret the string and cast it to the type you need, to avoid having to copy and paste code, the mod has a module (Utils) that you can use to perform this cast (Utils.convert_to), you can check it out on the cmd3 function in the code above.

The console module also allows text to be written in its output buffer, the text will be split by each newline character ("\n") into a new line.

console mod commands 2.gif
Calling the cmd3 command to test the casting


console mod commands 1.gif
Using other mod commands (jdversion and jane_ss_ver)​

All commands (optionally) can have information, this information is automatically used by the help command (man) to display it on the console.

console mod help 1.jpg
You are not obliged to set the information of each command (#set_info) but it is a good practice, to know how to use it.

In order to avoid modders overwriting the vanilla commands, all mod commands will be added once all sana revamped commands are created, so they all will appear in that order on the manual, as you can see on this pic

console mod help 2.jpg

That's it for now :geek:

For the next devlog, I was planning to work on the localisation module to allow mods to add their translations and modify the current ones, but I think I'll leave that for the one after the next and get to work on adding support for game pictures, which I started working on today.

I want to allow modders to modify all pictures shown in-game without overwriting the vanilla pics, combine this with the sex framework animations and you will be able to change the whole game art, without touching the RPG Maker editor at all or worrying about breaking the game by overwriting something by mistake or whatever.
 
Last edited:

Big Chingus

Newbie
Nov 20, 2022
54
32
Mod Support Devlog 3: Creating Console Commands

Hey, it's me again :), Let's try to keep up this devlog weekly posting

I have finished working on the console module to allow mods to create custom commands.

The downside of this is that I had to change the way commands were created to support mod commands, which has resulted in many commands that I had previously created being missing now (like the teleport command), but at least modders can create commands without too much trouble, just a script call, I'll have to bring them back, but it's not a priority now.

While I was doing this, I have made some improvements to the console, some of them are purely aesthetic and others are necessary to avoid problems in the future.

As you can see, the console window can show text with colors on the screen, also, the window size is now bigger, so the output text is clearer.

The help command (man) has been modified to support mods


I have also made a modification to allow you to type long commands in the console input, previously, when the length of the command exceeded the width of the window, it was cut off, now you can type long commands and you can actually see what you are typing.



Now to the code part :geek:

The code needed to create commands is much simpler than the one needed to create mod settings, you can take a look in the spoiler below.

You don't have permission to view the spoiler content. Log in or register now.

You can define the command logic to run inside a block or declare a new module and create the functions there, which is tidier, it's up to you.

All the arguments that are sent to the command when called, are strings, that means, you will have to interpret the string and cast it to the type you need, to avoid having to copy and paste code, the mod has a module (Utils) that you can use to perform this cast (Utils.convert_to), you can check it out on the cmd3 function in the code above.

The console module also allows text to be written in its output buffer, the text will be split by each newline character ("\n") into a new line.

View attachment 3440092
Calling the cmd3 command to test the casting


View attachment 3440084
Using other mod commands (jdversion and jane_ss_ver)​

All commands (optionally) can have information, this information is automatically used by the help command (man) to display it on the console.
You are not obliged to set the information of each command (#set_info) but it is a good practice, to know how to use it.

In order to avoid modders overwriting the vanilla commands, all mod commands will be added once all sana revamped commands are created, so they all will appear in that order on the manual, as you can see on this pic

That's it for now :geek:

For the next devlog, I was planning to work on the localisation module to allow mods to add their translations and modify the current ones, but I think I'll leave that for the one after the next and get to work on adding support for game pictures, which I started working on today.

I want to allow modders to modify all pictures shown in-game without overwriting the vanilla pics, combine this with the sex framework animations and you will be able to change the whole game art, without touching the RPG Maker editor at all or worrying about breaking the game by overwriting something by mistake or whatever.
Does this mean that someone would be able to potentially replace all the art in the game with their own?
 

tygct

Member
Jun 6, 2017
123
517
Does this mean that someone would be able to potentially replace all the art in the game with their own?
Yeah, that's the plan :)

For the next devlog I'm currently working on the images that are shown during the game (using the [Show Picture] command inside in-game events) but I will support all types of pictures (like the window skin, battle backgrounds, faces, tilesets, characters...), pretty much everything inside the Graphics folder.
 

Lightgot

Newbie
Sep 12, 2017
21
8
Phew work has been kicking my ass lately but dont fret yall
Im still working on Sana update CGs for the revamp
Here are some examples
View attachment 3478089 View attachment 3478090 View attachment 3478091 View attachment 3478092
love the spanking art


Mod Support Devlog 3: Creating Console Commands

Hey, it's me again :), Let's try to keep up this devlog weekly posting

I have finished working on the console module to allow mods to create custom commands.

The downside of this is that I had to change the way commands were created to support mod commands, which has resulted in many commands that I had previously created being missing now (like the teleport command), but at least modders can create commands without too much trouble, just a script call, I'll have to bring them back, but it's not a priority now.

While I was doing this, I have made some improvements to the console, some of them are purely aesthetic and others are necessary to avoid problems in the future.

As you can see, the console window can show text with colors on the screen, also, the window size is now bigger, so the output text is clearer.

The help command (man) has been modified to support mods


I have also made a modification to allow you to type long commands in the console input, previously, when the length of the command exceeded the width of the window, it was cut off, now you can type long commands and you can actually see what you are typing.



Now to the code part :geek:

The code needed to create commands is much simpler than the one needed to create mod settings, you can take a look in the spoiler below.

You don't have permission to view the spoiler content. Log in or register now.

You can define the command logic to run inside a block or declare a new module and create the functions there, which is tidier, it's up to you.

All the arguments that are sent to the command when called, are strings, that means, you will have to interpret the string and cast it to the type you need, to avoid having to copy and paste code, the mod has a module (Utils) that you can use to perform this cast (Utils.convert_to), you can check it out on the cmd3 function in the code above.

The console module also allows text to be written in its output buffer, the text will be split by each newline character ("\n") into a new line.

View attachment 3440092
Calling the cmd3 command to test the casting


View attachment 3440084
Using other mod commands (jdversion and jane_ss_ver)​

All commands (optionally) can have information, this information is automatically used by the help command (man) to display it on the console.
You are not obliged to set the information of each command (#set_info) but it is a good practice, to know how to use it.

In order to avoid modders overwriting the vanilla commands, all mod commands will be added once all sana revamped commands are created, so they all will appear in that order on the manual, as you can see on this pic

That's it for now :geek:

For the next devlog, I was planning to work on the localisation module to allow mods to add their translations and modify the current ones, but I think I'll leave that for the one after the next and get to work on adding support for game pictures, which I started working on today.

I want to allow modders to modify all pictures shown in-game without overwriting the vanilla pics, combine this with the sex framework animations and you will be able to change the whole game art, without touching the RPG Maker editor at all or worrying about breaking the game by overwriting something by mistake or whatever.
also glad to see more follow ups
 
5.00 star(s) 2 Votes