Jump to content
Korean Random
Willster419

Remap sound events without XVM

Recommended Posts

Hello, New modder here.
I am trying to make a sound mod to override some of the GUI sounds like timer and enemy_spotted_for_team. I have successfully created a wwise audio bnk and it is loaded and played in WOT. It also works with remapping the game event name to the name I made in wwise via xvm sound event remapper.
My question is this: do I have to use xvm to remap the sound events? I am familiar with the bank remapper from D2R52, but it was for 9.15.1 and now throws exceptions.
The sound mapper from xvm works, and his looks similar to xvm. Could someone help me to get it to work?

Thanks,
Willster419
 
EDIT:
 
Below is D2R52's code

 

# Embedded file name: mod_SoundMapper
import ResMgr
import WWISE
from debug_utils import *

def _OverrideMethod(handler, cls, method):
orig = getattr(cls, method)
newm = lambda *a, **k: handler(orig, *a, **k)
if type(orig) is not property:
setattr(cls, method, newm)
else:
setattr(cls, method, property(newm))


def _checkAndReplace(event):
if event in myreplace:
return myreplace[event]
else:
return event


def _WWISE_WW_eventGlobal(base, event):
return base(_checkAndReplace(event))


def _WWISE_WW_eventGlobalPos(base, event, pos):
return base(_checkAndReplace(event), pos)


def _WWISE_WW_getSoundObject(base, event, matrix, local):
return base(_checkAndReplace(event), matrix, local)


def _WWISE_WW_getSound(base, eventName, objectName, matrix, local):
return base(_checkAndReplace(eventName), _checkAndReplace(objectName), matrix, local)


def _WWISE_WW_getSoundCallback(base, eventName, objectName, matrix, callback):
return base(_checkAndReplace(eventName), _checkAndReplace(objectName), matrix, callback)


def _WWISE_WW_getSoundPos(base, eventName, objectName, position):
return base(_checkAndReplace(eventName), _checkAndReplace(objectName), position)


ms = ResMgr.openSection('../res_mods/configs/D2R52/mod_SoundMapper.xml')
if ms is not None:
myreplace = {}
for k, v in ms.items():
myreplace[k] = v.asString

if len(myreplace) > 0:
_OverrideMethod(_WWISE_WW_eventGlobal, WWISE, 'WW_eventGlobal')
_OverrideMethod(_WWISE_WW_eventGlobalPos, WWISE, 'WW_eventGlobalPos')
_OverrideMethod(_WWISE_WW_getSoundObject, WWISE, 'WW_getSoundObject')
_OverrideMethod(_WWISE_WW_getSound, WWISE, 'WW_getSound')
_OverrideMethod(_WWISE_WW_getSoundCallback, WWISE, 'WW_getSoundCallback')
_OverrideMethod(_WWISE_WW_getSoundPos, WWISE, 'WW_getSoundPos')
BigWorld.logInfo('LOAD', 'SoundMapper by D2R52', None)
else:
BigWorld.logInfo('LOAD', 'SoundMapper by D2R52 is not loaded - missing configuration', None)

 

(It is very similar to the xvm code) here is the python log error

 

2017-01-08 09:58:42.967: ERROR: [EXCEPTION] (scripts/client/MapActivities.py, 491):
Traceback (most recent call last):
  File "scripts/client/MapActivities.py", line 486, in __playSound
  File "scripts/client/SoundGroups.py", line 863, in WWgetSoundObject
  File "mod_SoundMapper", line 8, in <lambda>
TypeError: _WWISE_WW_getSoundObject() takes exactly 4 arguments (5 given)

 

The XVM files i think i need are:
res_mods\mods\xfw\python\xfw\_init_.py
res_mods\mods\xfw\python\xfw\events.py
res_mods\mods\packages\xvm_sounds\python\_init_.py

Edited by Willster419

Share this post


Link to post

Short link
Share on other sites

you must change the def def _WWISE_WW_getSoundObject

def _WWISE_WW_getSoundObject(base, event, matrix, local, auxSend):
    return base(_checkAndReplace(event), matrix, local, auxSend)

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

is Easy:
see i scripts/client/soundgroups.py the def "WWgetSoundObject"
the code from D2R52 is from 0.9.15
in 9.16 has WG this def changed
 
old def:

def WWgetSoundObject(self, objectName, matrix, local = (0.0, 0.0, 0.0)):
if DEBUG_TRACE_SOUND is True:
LOG_DEBUG('SOUND: WWgetSoundObject', objectName, matrix, local)
if DEBUG_TRACE_STACK is True:
import traceback
traceback.print_stack()
return WWISE.WW_getSoundObject(objectName, matrix, local)

 
new_def
def WWgetSoundObject(self, objectName, matrix, local = (0.0, 0.0, 0.0), auxSend = False):
if DEBUG_TRACE_SOUND is True:
LOG_DEBUG('SOUND: WWgetSoundObject', objectName, matrix, local)
if DEBUG_TRACE_STACK is True:
import traceback
traceback.print_stack()
return WWISE.WW_getSoundObject(objectName, matrix, local, auxSend)
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

I know this is selfish of me to ask, but what about his custom sound bank loader? That is throwing exceptions as well.

I will post the exact code and python log exception later today. (EST based)

Share this post


Link to post

Short link
Share on other sites

here is the bank loader code:

mod_SoundBankLoader.pyc

# Embedded file name: mod_SoundBankLoader
import WWISE
import ResMgr
from debug_utils import *

def _OverrideMethod(handler, cls, method):
orig = getattr(cls, method)
newm = lambda *a, **k: handler(orig, *a, **k)
if type(orig) is not property:
setattr(cls, method, newm)
else:
setattr(cls, method, property(newm))


def _WWISE_WG_loadBanks(base, xmlPath, banks, isHangar, *args, **kwargs):
if extraBanks:
banks_list = (banks + ';' + extraBanks).split(';')
banks_list = set([ x.strip() for x in banks_list if x and x.strip() ])
banks = '; '.join(banks_list)
base(xmlPath, banks, isHangar, *args, **kwargs)


extraBanks = ''
mysettings = ResMgr.openSection('../res_mods/configs/D2R52/mod_SoundBankLoader.xml/preloadSoundBanks')
if mysettings is not None:
extraBanks = mysettings.asString.strip()
if extraBanks:
_OverrideMethod(_WWISE_WG_loadBanks, WWISE, 'WG_loadBanks')
BigWorld.logInfo('LOAD', 'SoundBankLoader by D2R52', None)
else:
BigWorld.logInfo('LOAD', 'SoundBankLoader by D2R52 is not loaded - missing configuration', None)

 

And the exeption:

2017-01-11 19:29:15.429: ERROR: [EXCEPTION] (, 352):
Traceback (most recent call last):
File "", line 344, in _findValidMODs
File "scripts/common/Lib/importlib/__init__.py", line 37, in import_module
File "mod_SoundBankLoader", line 26, in
File "mod_SoundBankLoader", line 7, in _OverrideMethod
AttributeError: 'module' object has no attribute 'WG_loadBanks'

 

In looking myself, all i could find was in _WWISEStubs.py:

def WG_loadBanks(*args, **kwargs):
pass

 

It sound to me like they removed the method from the python.log error, but that would not make sense because the def stub is there...?

Edited by Willster419

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