How to create new UT-announcer using head_shot.py

Making or wanting help making your own asset? Check in here
Post Reply
D3litenl
Posts: 2
Joined: 2018-06-22 19:17

How to create new UT-announcer using head_shot.py

Post 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
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

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

Post by AfterDune »

You can't play sounds with Python, as it's serverside.
Image
D3litenl
Posts: 2
Joined: 2018-06-22 19:17

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

Post by D3litenl »

Could there be another way to implement the UT-announcer saying "headshot" after scoring one?

Any help would be great!
AlonTavor
PR:BF2 Developer
Posts: 2991
Joined: 2009-08-10 18:58

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

Post 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.
FFG
Forum Moderator
Posts: 1468
Joined: 2014-03-18 04:47

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

Post by FFG »

could you not assign a vbf2 medal for it and trigger a sound via that?
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

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

Post by Arab »

Moved to Community Modding
Image
Post Reply

Return to “PR:BF2 Community Modding”