ArchieFromSyracuse Posted August 1, 2016 Share Posted August 1, 2016 (edited) I took one c++ course in college and that was a while ago, so my code understanding is minimal. I'm very interested in learning about modding, so I've read the tutorials, watched gopher's video and downloaded a bunch of mods to pick at their inner workings. One thing I'm having a heck of a time finding, is how to define an "action". For example, W3EE has a nightsight action that is bound to a hotkey, which I think decreases saturation and increases brightness. I've found the mapping in input.xml, and the add to input.settings, but where can I find the actual code that tells the game to adjust the color settings? If I want to create a new "action" like the other mods that reset random encounter seeds or auto loot, where can I look at the logic? Edited August 1, 2016 by ArchieFromSyracuse Link to comment Share on other sites More sharing options...
djkovrik Posted August 1, 2016 Share Posted August 1, 2016 Check Quick Load mod code for example :smile:http://www.nexusmods.com/witcher3/mods/332/ You have to add key press event listener and then implement corresponding event. So that mods register new listener in playerInput.ws (which is a common place for adding new hotkeys): theInput.RegisterListener( this, 'OnQuickLoad', 'QuickLoad' ); for QuickLoad hotkey mapped via input.settings and implements quick load feature in OnQuickLoad event. As for EE, it dynamicaly registers Nightsight listener in playerWitcher.ws (its useful if you don't want to clutter up playerInput.ws with all your new stuff) and implements OnToggleNightsight event with that feature. Link to comment Share on other sites More sharing options...
ArchieFromSyracuse Posted August 1, 2016 Author Share Posted August 1, 2016 Alright, great! It looks like I'll have to study up a bit on the listener (observer) pattern. Thanks for the tips! I'll have to check this out when I get home from work. Lots to learn... Link to comment Share on other sites More sharing options...
Recommended Posts