Saturday, August 21, 2010

Friendlynames of items

As we mentioned, Farmville is using a hashtable and how you can get them.

Sometimes you are looking for codes of items, that already are on your farm. For example the kelly green cow. The problem is, the code name is "cow_shamrock" and you don't know, what you have to search for. You can only filter by "cow" and look at the images. The solution for this is easy, inside the flashLocaleXml.xml are the displayed names stored. They are looking like:

<l k="cow_shamrock_friendlyName">
   <v>Kelly Green Cow</v>
</l>
<l k="calf_shamrock_friendlyName">
   <v>Kelly Green Calf</v>
</l>

We used again XSLT to get the data out of XML. You can change the XSL File like this to get the new values. If you need help with this, you may contact us, or write a comment below.

<xsl:for-each select="localization/b/l">
   <xsl:if test="contains(@k,'friendlyName')">
     ... access itemcode using 'v' and
      friendlyname using '@k'
   </xsl:if>
</xsl:for-each>

Now we have itemcodes, hashed image links and now the displayed names.
We used that info for building a full List of all hashed links.

We have also updated the search function a little bit. You can now search for displayed names and item codes.

1 comment: