Jump to content
Korean Random

some questions about modmaking


Recommended Posts

@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 by pipje2001
Link to comment
Short link
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

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 by Kotyarko_O
Link to comment
Short link
Share on other sites

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".

Link to comment
Short link
Share on other sites

  • The title was changed to some questions about modmaking
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 by Kotyarko_O
Link to comment
Short link
Share on other sites

  • 1 month later...
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

Link to comment
Short link
Share on other sites

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

Link to comment
Short link
Share on other sites

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!

Link to comment
Short link
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...