Page 1 of 1

How to create new UT-announcer using head_shot.py

Posted: 2018-06-22 20:32
by D3litenl
Dear anyone that can help,

After modding my current BattleField 2-mod for almost 4 years I've hit a wall. Never had I had to write new code, since I'm barely able to import new weapons, change some models around and simple text-editing. Anyhow, I've gotten permission from the author of head_shot.py to use it in my mod.

The thing is I'de like to hear the UT-Announcer saying "headshot" after the player scores a headshot. Managed to 'create' the headshot.wav in GameSounds.con but no idea of how to connect it to the message created by head_shot.py.

Hope someone could help me create the code to connect the head_shot.py message to this the selfmade-code in GameSounds.con

rem -----------------------------------------------------------------------
rem ----------------------------- HeadshotAnn------------------------------
rem -----------------------------------------------------------------------

Sound.addSound headshotannouncer
ObjectTemplate.soundFilename Common/Sound/Hud/headshot.wav
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.volume 0.5
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 0.1
ObjectTemplate.minDistance 1

Re: How to create new UT-announcer using head_shot.py

Posted: 2018-06-22 21:29
by AfterDune
You can't play sounds with Python, as it's serverside.

Re: How to create new UT-announcer using head_shot.py

Posted: 2018-06-22 22:00
by D3litenl
Could there be another way to implement the UT-announcer saying "headshot" after scoring one?

Any help would be great!

Re: How to create new UT-announcer using head_shot.py

Posted: 2018-06-22 23:19
by AlonTavor
Add it as effect for the head material I guess? Everyone will be able to hear it though. There are no events for headshot.

Re: How to create new UT-announcer using head_shot.py

Posted: 2018-06-22 23:50
by FFG
could you not assign a vbf2 medal for it and trigger a sound via that?

Re: How to create new UT-announcer using head_shot.py

Posted: 2018-06-24 22:02
by Arab
Moved to Community Modding