View Single Post
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 05-13-2010 , 12:40   Re: [ANY] MechaWare: Custom Achievements 2.0!
Reply With Quote #2

[IMG]http://img263.**************/img263/7725/allpurposeimage.png[/IMG]

Each achievement has tasks that all need to be activated before the achievement is triggered!
Example:
task 1: Kill
task 2: Chat

if you kill someone and then chat, you unlock the achievement!

With requirements, you can be more specific. Example:

task 1: kill
Requirement: Victim's class must be spy
task 2: Chat
Requirement: Chat must contain "haha"

if the killer kills a spy and then types "haha" in chat, the achievement is unlocked!

[IMG]http://img185.**************/img185/25/allpurposeimagey.png[/IMG]
In order to host your own achievements you will need an SQL server.

Code:
	"mw_achievements_post"
	{
		"driver"			"mysql"
		"host"				"siteground133.com"
		"database"			"mechawar_achievements"
		"user"				"mechawar_ach"
		"pass"				"ach123"
		//"timeout"			"0"
		//"port"			"0"
	} 
	"mw_achievements_get"
	{
		"driver"			"mysql"
		"host"				"siteground133.com"
		"database"			"mechawar_achievements"
		"user"				"mechawar_ach"
		"pass"				"ach123"
		//"timeout"			"0"
		//"port"			"0"
	}
I HAVE AN SQL SERVER
1. Use the above template and change it to your own host. POST is where the user's achievement data is stored and GET is the server achievement data. They are separated for convenience.
2. Launch the following in your sql server. Make changes if you wish, but none is required.
Quote:
CREATE TABLE IF NOT EXISTS `mw_achievements_get_ach` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`desc` text NOT NULL,
`triggers` int(11) NOT NULL default '1',
`blocks` text NOT NULL,
`game` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
CREATE TABLE IF NOT EXISTS `mw_achievements_get_blocks` (
`id` int(11) NOT NULL auto_increment,
`event` varchar(255) NOT NULL,
`target` int(11) NOT NULL default '0',
`triggers` int(11) NOT NULL default '1',
`add` int(11) NOT NULL default '0',
`requirement` text NOT NULL,
`expire` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
CREATE TABLE IF NOT EXISTS `mw_achievements_post_ach` (
`id` varchar(255) NOT NULL COMMENT '(steamid_achid)',
`achid` int(11) NOT NULL,
`steamid` varchar(255) NOT NULL,
`triggers` int(11) NOT NULL default '0',
`complete` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
3. Final step is to Download the web interface.

I DON'T HAVE AN SQL SERVER
1. Even though you don't have an SQL server you can still use the achievements created by MechaWare for the MechaWare servers.
Simply add the above template to your databases.cfg and you should be ready to go!
__________________

Last edited by Mecha the Slag; 06-21-2010 at 06:08.
Mecha the Slag is offline