Jump to content
Korean Random
The Illusion

Looking for help with my mod

Recommended Posts

Hi Everyone! So, I finally got around to learning python (still not actually done that..) and I have made a mod: https://github.com/Arkhorse/IVM

 

The issue is that I am trying to get the current ammo count, and then play events based on the count. I am unable to find where that info is at. The rest I can do. 

 

Also, if you know of ways to improve this, dont hesitate to mention it!

 

Thanks

  • Upvote 3

Share this post


Link to post

Short link
Share on other sites

So many possibilities... But none are working...

 

Latest attempt:

 

if config.data['emptyShellsEnabled'] == True and config.TESTER == True:
    from helpers.CallbackDelayer import CallbackDelayer
    class IVM_SoundEvent(CallbackDelayer):
        def __init__(self, effectDesc):
            CallbackDelayer.__init__(self)
            self._desc = effectDesc
            self.sound = None
            return

        def __del__(self):
            if self._sound is not None:
                self._sound.stop()
                self._sound = None
            CallbackDelayer.destroy(self)
            return

        def start(self, shellCount, lastShell, reloadStart, shellReloadTime):
            if reloadStart:
                if shellCount == 0:
                    SoundGroups_g_instance.playSound2D(config.data['emptyShellEvent'])
                    print '[IVM] Player out of ammo!'
                elif shellCount == 5:
                    SoundGroups_g_instance.playSound2D(config.data['almostOutEvent'])
                    print '[IVM] Player is almost out of ammo!'
                else:
                    pass
                time = shellReloadTime - self._desc.duration
                self.delayCallback(time, shellCount, BigWorld.time() + time)
                return

        def stop(self):
            if self._sound is not None:
                self._sound.stop()
                self._sound = None
            return

else:
    pass  

Based this off of ReloadEffect in the game files...

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites
from skeletons.gui.battle_session import IBattleSessionProvider
from helpers import dependency


def getState():
	guiSessionProvider = dependency.descriptor(IBattleSessionProvider)
	guiSessionProvider.shared.ammo.getGunReloadingState().getTimeLeft()

 

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
On 1/15/2021 at 4:35 PM, DKRUBEN said:

from skeletons.gui.battle_session import IBattleSessionProvider
from helpers import dependency


def getState():
	guiSessionProvider = dependency.descriptor(IBattleSessionProvider)
	guiSessionProvider.shared.ammo.getGunReloadingState().getTimeLeft()

 

 

thanks

Share this post


Link to post

Short link
Share on other sites

BigWorld.player().guiSessionProvider.shared.ammo.getGunReloadingState().getTimeLeft()

чего вы там выдумываете?

  • Upvote 1

Share this post


Link to post

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