Le_Fay
Corporal
i assure you no matter what is i am doing, i am absolutely up to no good
Posts: 69
|
Post by Le_Fay on Jul 31, 2017 19:59:24 GMT -8
Is there suppose to be anything under the add on scenes menu in MOA or does it just exist?
|
|
|
Post by Nemjen on Jul 31, 2017 21:53:38 GMT -8
As far as I know no, it was a menu that wasn't properly utilised when MoA released.
|
|
|
Post by Sorzo on Aug 1, 2017 3:38:46 GMT -8
Given that the code for the menu includes references to mod scenes, I think it's fair to assume that the menu was intended to give modders a framework for launching mods that aren't tied into the main game. Otherwise, the only ways to do so would be running it from the command console (easy, but not very professional-looking or user friendly, so more useful for mod developers than players) and coding a new menu from scratch (a daunting task for new modders, and one likely to run into compatibility issues with other mods).
I was able to add one of my little skit mods to the menu after only a few minutes, despite never having looked at the code before. It's just a matter of opening up "bonus menus.rpy" inside the game directory, declaring a variable using the existing BonusItem class, and adding it to an existing array that is, by default, empty.
Brief tutorial for anyone who cares:
Open "bonus menus.rpy" in the game folder after making a copy of the file and saving it somewhere else. We're editing a core game file, so it's always wise to have a backup.
Scroll down to where it says "addon_scenes = []".
Right above this line, declare any mods you want added. To do this, you need to create a variable name, have a thumbnail image, a name for what will be on the menu, a label that the menu will call, and a zoom level. You'll be typing this line from scratch, so be sure to begin it with four spaces (NOT A TAB!) in order to match the rest of the document. Renpy will throw it a fit, otherwise, and you won't be able to start your game.
The syntax will look like this:
variable = BonusItem("thumbnail", " name", "label", zoom)
The variable can be more or less anything, as can the name. The thumbnail can be any image within the game directory (if it's within a subfolder, you'll need to indicate as such). The label is a bit of specific code determined by the code of whatever mod you're trying to integrate. Look in the rpy file of the mod in question for the word "label" near the top, after the init section. The label should be the text that follows on that line, before the colon. The zoom is a number that will help your thumbnail fit in the menu properly. You'll probably have to play around with it, depending on the size of your thumbnail image. For a 1920x1080 thumbnail, 0.1 was perfect, so feel free to use that as a baseline and tweak from there.
For the test I ran, this is what I used:
****waifu_war_announcement = BonusItem("WaifuWarsMods/Waifu_War_Announcement_Thumbnail.jpg", " Waifu Wars Teaser", "WaifuModBlock1", 0.1)
To break it down:
*: Each of these represents a space; don't actually type the asterisks into the line waifu_war_announcement: Variable BonusItem: Defined class; do not change this part WaifuWarsMods: Folder under the game directory that my thumbnail is in Waifu_War_Announcement_Thumbnail.jpg: Thumbnail name Waifu Wars Teaser: What is displayed on the menu in-game WaifuModBlock1: Label that starts the mod 0.1: Zoom level; if your zoom level is off, the menu should still work, it'll just be ugly
Once you've finished this line of code, look below at the initial reference line: addon_scenes = []
Inside those brackets, type your variable name. My example looks like this:
addon_scenes = [waifu_war_announcement]
Save the document and open up MoA. If you did everything properly, the menu should work! If you're still having trouble, check out how the deleted scenes are formatted at the very start of the document. It's the same syntax.
If you want to integrate more than one mod this way, the process is essentially the same. Create a separate declaration line for the new mod, then add it in the brackets, with a comma and then a space separating each entry. There's virtually no limit to how many mods can be added in this way.
|
|
|
Post by bigfoot on Aug 1, 2017 8:22:33 GMT -8
That's very interesting, I was thinking of something like that but never got round to making it
|
|