Saturday, 7 January 2012

Evolution of the code #11

Early weekend update. Achievements partially implemented.
Ive never been a fan of achievements in games - especially the ones that require much grinding but I do like it when they add a fun factor to them (such as performing an evilness and getting an achievement). Regardless I always wanted to implement something like this as the actual achievement system is what I find interesting. Some time ago i made a lua script which required a key card to turn on a light. I decided it was the perfect test site for an achievement. So, without further ado, pic below:

When i said partially implemented I meant that the lua scripts can be used to trigger predefined achievements but the game does not store them. The achievements are stored into a file in the definitions folder and they are defined as such:
title = achievement title
image = picture path

and used like this to trigger from a lua script:
There are a few things to look after though - since all windows get cleared when loading maps the achievements should only be triggered when a map is fully loaded and ingame.

Map transitions
Ive modified the change map region entity so it can now be used as an exit grid (if a map name is not specified in the map editor) which triggers the world map (although it is not functional yet) or a map transitioning zone to travel across zones within an area. The mapper can also be used to specify which spawn point should be used but it is not mandatory (a default spawn point shall be used in that case).

Next on the list should be fixing the combat manager, implementing more features from special and the world map window.