[OTHER] Custom server announcements

Ask questions, discuss ideas, get answers

Custom server announcements

Postby Classical Modder » Mon Jul 30, 2018 9:27 pm

Hi all!

As some of you might have noticed, when you play on the aX server hosted by s[sk], you get to see custom server announcements every now and then while in the server such as "Player X got first blood" and other even cooler announcements like "Player Y zooked player X from 150 meters". The announcements show up on the top left corner of the screen. As far as I know this is the only server that does this.

I am wondering how this was accomplished? I think someone once mentioned that the server host uses Python scripts to make those custom announcements, but I am not sure. Could anyone confirm this?

I am asking about the server announcements because for the last 2 or 3 years I have tried to make a Deathmatch game mode, but I am now stuck with how kill announcements show up. Editing the lexiconAll.dat and the InGame meme file with the Menu Editor can only get me to a limited "So and so fragged X" (this is on one line of text) and below the first line, "X has died". I am not able to at least align both announcements on the same line (I think this is a hardcoded setting) while editing the InGame menu file with the Menu Editor.

I was thinking the best way to get what I want for my Deathmatch mode would be to edit the Python scripts that s[sk] uses on his server so that they show custom frag announcements every time a player is killed, such as "Player X fragged player Y" or even "Player Y snipped Player X" (if a sniper rifle was used to kill the player), on top of the regular announcements this system uses, such as the "First Blood" warning. I would then find a way to totally remove the kill announcements either via the Menu Editor or by editing the lexiconAll.dat file, so that only the custom server announcements show up on the top left corner of the screen.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Classical Modder
 
Posts: 436
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada

Re: Custom server announcements

Postby russ » Tue Jul 31, 2018 4:37 pm

I haven't seen their scripts, but if I was doing the same, I'd start with the XML logs:

Code: Select all
<bf:event name="destroyVehicle" timestamp="160.374">
    <bf:param type="int" name="player_id">231</bf:param>
    <bf:param type="vec3" name="player_location">1853.97/38.9/1852.97</bf:param>
    <bf:param type="string" name="vehicle">T34-85</bf:param>
    <bf:param type="vec3" name="vehicle_pos">1843.72/39.2248/1867.89</bf:param>
</bf:event>
<bf:event name="scoreEvent" timestamp="160.375">
    <bf:param type="int" name="player_id">231</bf:param>
    <bf:param type="vec3" name="player_location">1853.97/38.9/1852.97</bf:param>
    <bf:param type="string" name="score_type">Kill</bf:param>
    <bf:param type="int" name="victim_id">250</bf:param>
    <bf:param type="string" name="weapon">GrenadeAxis</bf:param>
</bf:event>


They show you who did what, with what, when, from where, and to where. Parsing them as they are written with python would be pretty easy. You could then inject messages into the server with remote console.
russ
 
Posts: 55
Joined: Sun Oct 29, 2017 8:12 am

Re: Custom server announcements

Postby Classical Modder » Mon Aug 06, 2018 11:33 pm

russ wrote:I haven't seen their scripts, but if I was doing the same, I'd start with the XML logs:

Code: Select all
<bf:event name="destroyVehicle" timestamp="160.374">
    <bf:param type="int" name="player_id">231</bf:param>
    <bf:param type="vec3" name="player_location">1853.97/38.9/1852.97</bf:param>
    <bf:param type="string" name="vehicle">T34-85</bf:param>
    <bf:param type="vec3" name="vehicle_pos">1843.72/39.2248/1867.89</bf:param>
</bf:event>
<bf:event name="scoreEvent" timestamp="160.375">
    <bf:param type="int" name="player_id">231</bf:param>
    <bf:param type="vec3" name="player_location">1853.97/38.9/1852.97</bf:param>
    <bf:param type="string" name="score_type">Kill</bf:param>
    <bf:param type="int" name="victim_id">250</bf:param>
    <bf:param type="string" name="weapon">GrenadeAxis</bf:param>
</bf:event>


They show you who did what, with what, when, from where, and to where. Parsing them as they are written with python would be pretty easy. You could then inject messages into the server with remote console.


Thanks, that’s really cool. Is there any way to also format the server announcements from the XML file with Python? For example I would like to have a little table at the end of the round that shows individual stats like ratio and accuracy for the top three players.

Also, and this is probably impossible to do but I’ll still ask, would it be possible to bind some custom sound scripts to certain announcements without the client having to download the custom sound scripts? For example a special sound when a player gets 10 killls, etc.
{SoH} Clan Leader // http://sohclan.forumotion.com/
See my Strasbourg map project here.
GSC: diamondback67
Steam: diamondback67
Classical Modder
 
Posts: 436
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 23 guests