pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 (edited) @Kotyarko_O newSettings are the settings that you changed in the game so print 'onModSettingsChanged', newSettings will print onModSettingsChanged {'enabled': True, 'ip_hub': '192.168.1.101', 'minimapClick': True} so i need to get the newSettings from inside my own mod, because settings in the mod_modsettings.py don't change otherwise i need to press apply everytime i restart the game Edited March 9, 2019 by pipje2001 @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted March 9, 2019 Share Posted March 9, 2019 12 minutes ago, pipje2001 said: because settings in the mod_modsettings.py don't change So you provide your settings in separate mod, am i right? If so, it isn`t correct. @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 @Kotyarko_O it should be in one file? so mod_modsettings.py and mod_hello.py sould be one file? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted March 9, 2019 Share Posted March 9, 2019 1 minute ago, pipje2001 said: it should be in one file? Yes. Or, as an option, and if your mod\code\project may be large, it can be like package (https://docs.python.org/3/tutorial/modules.html#packages). @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 @Kotyarko_O Alright done that, but how do i get the mod to load the saved settings? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted March 9, 2019 Share Posted March 9, 2019 (edited) 9 minutes ago, pipje2001 said: @Kotyarko_O Alright done that, but how do i get the mod to load the saved settings? It`s already done. Here: https://bitbucket.org/The_IzeBerg/modssettingsapi/src/0570eaea89ae85d3817422aa6487bd17eebb6530/mod_modsettingsexample.py#lines-113 There is global var "settings", which contains modified settings if it has been modified in modSettingApi window and it`s cache exists, or default settings otherwise (https://bitbucket.org/The_IzeBerg/modssettingsapi/src/0570eaea89ae85d3817422aa6487bd17eebb6530/mod_modsettingsexample.py#lines-90) Don`t forget to refresh global var "settings" when new settings applyed: def onModSettingsChanged(linkage, newSettings): if linkage == modLinkage: global settings settings = newSettings Edited March 9, 2019 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 @Kotyarko_O Awesome that did it! thank you so much but i guess this wont be the last time i ask you something if you don't mind @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted March 9, 2019 Share Posted March 9, 2019 1 minute ago, pipje2001 said: but i guess this wont be the last time i ask you something if you don't mind Sure. If i can help, i will. Further discussion may be offtopic in thread so named. Change it to "Some questions about modmaking". @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 @Kotyarko_O Thats awesome, so i already got a next question, i want to try to dynamically create a textinput for the modsettingapi, so if a certain value is 5 it needs to create 5 textinputs, is this even possible or not? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted March 9, 2019 Share Posted March 9, 2019 (edited) 17 minutes ago, pipje2001 said: i want to try to dynamically create a textinput for the modsettingapi, so if a certain value is 5 it needs to create 5 textinputs, is this even possible or not? Yes. Can`t get enough time now for example. Edited March 9, 2019 by Kotyarko_O @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted March 9, 2019 Author Share Posted March 9, 2019 @Kotyarko_O No problem at all, its good to know it is possible though, if you have time for it and you like to help it would be really appreciated @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted April 13, 2019 Author Share Posted April 13, 2019 @Kotyarko_O Its a long time ago since i needed some help. In the meanwhile i got a lot of stuff working. But one thing i can't find is the function which runs when i am spotted. I want to run some code when i am spotted but i can't seem to find how, have you got any idea? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 13, 2019 Share Posted April 13, 2019 4 minutes ago, pipje2001 said: But one thing i can't find is the function which runs when i am spotted. I want to run some code when i am spotted but i can't seem to find how, have you got any idea? Example: https://bitbucket.org/Kotyarko_O/xvm.py_macro/src/1b032affe4cb3660ab9ef4ce4dddf268dce59faa/battleMessages/battleMessages.py#lines-89 @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted April 13, 2019 Author Share Posted April 13, 2019 7 minutes ago, Kotyarko_O said: Example: https://bitbucket.org/Kotyarko_O/xvm.py_macro/src/1b032affe4cb3660ab9ef4ce4dddf268dce59faa/battleMessages/battleMessages.py#lines-89 Thanks for the quick reply, but this is using xvm right? @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 13, 2019 Share Posted April 13, 2019 7 minutes ago, pipje2001 said: this is using xvm right? Yes. To use this without XVM you have to make own hook and remove all config checks. @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted April 13, 2019 Author Share Posted April 13, 2019 Alright, i don't want to use xvm mainly because there is a lot of discussion about this right now (or is that something else?). I tried to make my own hook but i am just doing something and it doesn't seem to work (which is not suprising because i don't understand shit about how it actually works XD) so i tried this: from gui.Scaleform.daapi.view.battle.shared.indicators import SixthSenseIndicator def new_show(self): old_show(self) print("spotted") old_show = SixthSenseIndicator.show SSixthSenseIndicator.show = new_show but this resulted in a lot of error's @ Quote Link to comment Short link Share on other sites More sharing options...
Kotyarko_O Posted April 13, 2019 Share Posted April 13, 2019 @pipje2001 from gui.Scaleform.daapi.view.battle.shared.indicators import SixthSenseIndicator def new_show(self): old_show(self) print("spotted") old_show = SixthSenseIndicator._SixthSenseIndicator__show SixthSenseIndicator._SixthSenseIndicator__show = new_show @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted April 13, 2019 Author Share Posted April 13, 2019 18 minutes ago, Kotyarko_O said: @pipje2001 from gui.Scaleform.daapi.view.battle.shared.indicators import SixthSenseIndicator def new_show(self): old_show(self) print("spotted") old_show = SixthSenseIndicator._SixthSenseIndicator__show SixthSenseIndicator._SixthSenseIndicator__show = new_show well that was a simple fix, Thanks! @ Quote Link to comment Short link Share on other sites More sharing options...
DKRUBEN Posted April 14, 2019 Share Posted April 14, 2019 @pipje2001 use XVM source... https://bitbucket.org/XVM/xfw/src/f8cddb94d03daa63c1f8e6bef1f394d12a3d8191/src/python/mods/xfw/python/xfw/events.py?at=default&fileviewer=file-view-default @ Quote Link to comment Short link Share on other sites More sharing options...
pipje2001 Posted April 19, 2019 Author Share Posted April 19, 2019 @DKRUBENthanks, but i don't want to use XVM thats why i wanted to know how it works without it @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.