Whenever you join a BatlleField: Heroes server a ‘Tip of the day’ is displayed. I was wondering where I could find all the tips and if anybody had already done something with them (i.e. create a service to get a random tip).
I couldn’t find anything after a Google search, so I started looking around. It turns out that all in game copy is stored in a file called ‘strings.csv‘. If you have BF:Heroes installed in the default location, you can find it here: ‘C:\Program Files\EA Games\Battlefield Heroes\mods\bfheroes\Localization‘. This file is a comma separated values file which you can open with Notepad and even Excel.
The bits I needed to have tips displayed are the rows starting with ‘WEST_FE_Loading_tip_ingress_‘ and ‘WEST_FE_Loading_tip_text_‘. What I’ve done for now is copy those fields over into an XML file: http://ansuz.nl/php_lib/bfheroes/tipoftheday.xml. I guess a next step could be a little script (or AIR application) that takes the ‘scripts.csv‘ file and converts it to XML in the format I need.
I then created a small PHP script to load the XML file and display a random quote, see here: http://ansuz.nl/php_lib/bfheroes/tip.php?method=randomTip
The first line is the ‘tip header’, the second the ‘tip body’. Both are wrapped in a ‘span’-tag with a unique class name so you can style it the way you want.
The final bit I did is loading a random tip on a site with my BF:H stats and applying some styling to it: http://ansuz.nl/bla/bfheroes/.