For my Main Menu mod, I had an idea to make the mod use your own screenshots automatically. I was wondering if there was a lua code (or something else) that can reroute the directory from .../drive/pictures/image.png to /documents/BeamNG/screenshots. Is this possible? If so, could you show me how to do it? Thanks in advance The mod
Been looking around to see if I could find anything relevant. I should note I am a total newb with doing stuff to this section of the game. Inside of loading.js (BeamNG.drive\ui\modules\loading) on line 29 there is a string that seems to point to the image files for the loading screens. If you were to modify that line maybe you could point the images for the loading screen to the screenshots folder that way? Inside of mainmenu.js (BeamNG.drive\ui\modules\mainmenu) on line 184 there seems to be a string that points towards the main menu images. Maybe that would achieve what you want? I haven't checked these though since I don't really want to go messing around with my game files. I am also not familiar enough with the codebase/api's/language to follow exactly what is going on. Perhaps there are ways you can externally modify these values without affecting the game files? Also found this beauty inside of mainmenu.js (BeamNG.drive\ui\modules\mainmenu) on line 119 xD Code: // no fucking clue, why this doesn't just work in the videoBackgroundDirective itself, but well you know
I've tried everything I can to that line and the ones around it, nothing works. Thanks for your help, though
I was discouraged from making mods which included modified menu files: https://www.beamng.com/threads/mainmenu-shortcuts-favorites-for-v0-5-x.18957/ Generally speaking I would say that the menu system is not flexible or ready for modding. Doing what you want is certainly possible, but probably not without modifying game files. Changes are always in the pipeline for the menu, so your mod will always break "soon". Another approach would be to attempt to mount the screenshots directory over top of the pictures directory. I'm definitely not recommending that, but it might look something like this: Code: FS:mount("screenshots/","ui/modules/mainmenu/drive/images/",0) You should remember that the screenshots folder can contain many very high resolution screenshots. In some cases foreign files (not produced by the game) may also be present if an image editor such as Photoshop, GIMP, etc has been used. Trying to use a folder like that can crash the game. In order for the above code to work it should be run before the UI loads or a UI reset should be performed afterwards. (I press CTRL+U and CTRL+F5 and then I click back onto the main game window and press CTRL+U again.) If the UI crashes, it's because you shouldn't be doing this. (eg it's due to the contents of your screenshots folder) Note that the javascript used for the image slideshow in the main menu goes through the images sequentially. Since the naming scheme for screenshots starts with text, the official images will always play first even with the two directories mounted over top of one another. As an example of how a mod like this might work I have uploaded a zip ready to be placed in /mods/. Note that while using extensions.loadModule() in modScript.lua is depreciated, I don't think that we have a fully functional replacement yet. Who's sitting around looking at the main menu anyway?
registerCoreModule(module) is what you're searching for I guess. This won't get unloaded once the gamestate changes.
It won't load for the main menu, so it's not useful for this purpose. eg you load the game, the module gets added to the core module list... and then the next time the gamestate changes it will load (when you leave the main menu).