Working with Achievements

85 Gnome Warrior
1690
Has anyone been able to tackle the Achievements feed yet? I'm specifically looking to find out how to break achievements up into their categories like they are on the wow site, how to mark items as done and what i'd really like to do is have tooltips for meta achievements that can show the progress of achievements without having to leave the one you're currently on.

A good example would be the "Stay Classy" achievement. I'd like to lay it out just as it is on the wow site: Icon > Name > Description and then all the criteria below it with the one's checked off that have been completed. THEN I'd like to be able to mouseover any of the ones which aren't complete, say "Classy Humans" and be able to return the criteria for THAT achievement with the checks next to the ones I have and don't have. Capisce?

Secondly, I was looking at the URL for a given achievement and trying to decipher it. there's an interesting #15088:a5152 at the end of it, I recognize the 5152 as being the ID of the achievement I was looking at, but confused as to what 15088 was, I gathered it might be the category, but I don't see corresponding numbers in the API. suggestions?

thanks guys, I can't believe how much I've been able to do with this api using both my own ideas and examples posted here.
Reply Quote
90 Night Elf Hunter
11760
your getting in to a large can of worms doing criteria matching in php/mysql if thats what your using ...

for example...
http://profiles.wowroster.net/armory/index.php?p=info&c=405&loc=US

i completely parse achievements and mark each critera in the non completed ones takes for ever to process...
Reply Quote
85 Gnome Warrior
1690
I can see what you mean. I put the achievements project on the shelf and started tinkering around with professions, 14 seconds just to break my guild into profession types.
Reply Quote
85 Gnome Warrior
1690
Another feature I'd like on my site is the ability to setup the members of a raid (already implemented) and then choose which dungeon we are in, then the boss we're about to encounter. Based on the members of the raid, give a list of who's missing achievements available for that boss. I don't suppose anyone would have a jumping-off point for me?
Reply Quote
90 Night Elf Hunter
11760

<?php
$raids = array(
'DS' => array(
'normal' => array(
0 => '6106',
1 => '6107',
2 => '6177',
3 => '6169',
),
'heroic' => array(
0 => '6110',
1 => '6111',
2 => '6112',
3 => '6113',
4 => '6114',
5 => '6115',
6 => '6116',
),
),
'FL' => array(
'normal' => array(
0 => '5802',
1 => '5828',
),
'heroic' => array(
0 => '5803',
1 => '5804',
2 => '5805',
3 => '5806',
4 => '5807',
5 => '5808',
6 => '5809',
),
),
);
?>


raid achievements
Reply Quote
90 Night Elf Hunter
11760
if i happen to get a faster way to process achievements and criteria ial send it your way ...
Reply Quote
85 Gnome Warrior
1690
Thanks Ulm, question: did you make that array yourself or did you pull the info out of one of your add ons?
Reply Quote
90 Night Elf Hunter
11760
made the array my self wrote the id's down from the armory i dont have to use my addons for data any more most of all i need is on the api
i used this to make this
http://beta.wowroster.net/index.php?p=guild-raid&a=g:3
Edited by Ulminia on 6/22/2012 4:34 PM PDT
Reply Quote
85 Goblin Rogue
5890
06/22/2012 12:49 PMPosted by Yehaf
Thanks Ulm, question: did you make that array yourself or did you pull the info out of one of your add ons?


I had to make all of the arrays myself, I put all of the achievement IDs into a MySQL DB and then I call them by a column like "area".

Like this:

number | meta | area | sort | section | name |
+--------+------+-------------+------+-----------+----------------+
| 6937 | mop | hof | 01 | 168:15107 | zorlock |
| 6936 | mop | hof | 03 | 168:15107 | tayak |
| 6553 | mop | hof | 05 | 168:15107 | garalon |
| 6683 | mop | hof | 07 | 168:15107 | meljarak |
| 6518 | mop | hof | 09 | 168:15107 | unsok |
| 6922 | mop | hof | 11 | 168:15107 | shekzeer |
| 6725 | mop | hof | 02 | 168:15107 | hzorlock |
| 6726 | mop | hof | 04 | 168:15107 | htayak |
| 6727 | mop | hof | 06 | 168:15107 | hgaralon |
| 6728 | mop | hof | 08 | 168:15107 | hmeljarak
Reply Quote
90 Night Elf Hunter
11760
seems ive made a bit if head way with achievements ... using jquery i can load criteria completion better

http://beta.wowroster.net/index.php?p=char-achievements&a=c:251
Reply Quote
87 Blood Elf Paladin
5935
I'm just checking back on all the achievement stuff as I have a request that's now over a year old from one of my members asking to parse this data. I guess this still hasn't been done officially yet? What I'm really looking for is a way to show how far along someone is for a specific achievement, e.g. for achievement 1778 (got my mind on my money) finding the criteriaQuantity that relates to that.

Does anyone have a list of the criteria ids that maps to what they are? I can see a few lists of achievements, but not of criteria. I'm thinking that pinching this from Wowhead might still be the only way, and many of the achievement pages don't show criteria ids, so I may leave it alone for now.
Reply Quote
90 Night Elf Hunter
11760
the achievements info is on the api now has been for some time

api/wow/data/character/achievements
Reply Quote
90 Night Elf Hunter
11760
achievements->criteria are the ids for a given player and you map them simmaler to this .. if you are using php


$achi = $char['achievements'];
foreach ($achi['criteria'] as $var => $info)
{
'id' = $info;
'date' = $char['achievements']['criteriaTimestamp'][''.$var.''];
'value' = $char['achievements']['criteriaQuantity'][''.$var.''];
}

$char being the json data places into a php array
and there you have it values and dates for each
Reply Quote
90 Night Elf Hunter
11760
i even got progress bars working now :)
http://beta.wowroster.net/index.php?p=char-achievements&a=c:251
Edited by Ulminia on 6/24/2012 10:22 AM PDT
Reply Quote
87 Blood Elf Paladin
5935
I know the achievement data is there, I must be missing something though. How do you map the achievement id to the criteria id? For instance, if I look for achievement 1178, it looks like that maps to criteria 3506. The only way I can tell that though is because the amount of money the character has looted is an easy number to find.
Reply Quote
90 Night Elf Hunter
11760
honeslty i just gave you the answer with how to mak criteria to values but to achievements this requires you using a database to do


$a = $roster->api->Data->getAchievInfo();
$rx = 0;
$rc = 0;
foreach($a['achievements'] as $order => $cat)
{
//echo $cat['name'].' - '.$cat['id'].'<br>';
if (isset($cat['achievements']))
{
foreach($cat['achievements'] as $d => $achi)
{
$tooltip = '<div style="width:100%;style="color:#FFB100""><span style="float:right;">' . $achi['points'] . ' Points</span>' . $achi['title'] . '</div><br>' . $achi['description'] . '';
$crit='';
$crit .= '<br><div class="meta-achievements"><ul>';
foreach ($achi['criteria'] as $r => $d)
{
$crit .= '<li><div id="crt'.$d['id'].'">'.$d['description'].'</div></li>';
$update->reset_values();
$update->add_value('crit_achie_id', $achi['id']);
$update->add_value('crit_id', $d['id']);
$update->add_value('crit_desc', $d['description']);
$querystr = "INSERT INTO `" . $roster->db->table('crit', $addon['basename']) . "` SET " . $update->assignstr;
$result = $roster->db->query($querystr);
//echo $querystr.'<br>';
$rc++;
}
$crit .= '</ul></div>';

$tooltip .= $crit;

$update->reset_values();
$update->add_value('achie_name', $achi['title']);
$update->add_value('achie_desc', $achi['description']);
$update->add_value('achie_points', $achi['points']);
$update->add_value('achie_id', $achi['id']);
$update->add_value('achie_icon', $achi['icon']);
$update->add_value('achie_tooltip', $tooltip);
$update->add_value('c_id', $cat['id']);
$update->add_value('p_id', '-1');
$update->add_value('achi_cate', $cat['name']);

$querystr = "INSERT INTO `" . $roster->db->table('achie', $addon['basename']) . "` SET " . $update->assignstr;
$result = $roster->db->query($querystr);
//echo$querystr.'<br>';
$rx++;
//*/
}
}
if (isset($cat['categories']))
{
foreach($cat['categories'] as $corder => $sub)
{
//echo '--'.$sub['name'].' - '.$sub['id'].'<br>';
foreach($sub['achievements'] as $d => $achi)
{
$tooltip = '<div style="width:100%;style="color:#FFB100""><span style="float:right;">' . $achi['points'] . ' Points</span>' . $achi['title'] . '</div><br>' . $achi['description'] . '';
$crit='';
$crit .= '<br><div class="meta-achievements"><ul>';
foreach ($achi['criteria'] as $r => $d)
{
$crit .= '<li>'.$d['description'].'</li>';

$update->reset_values();
$update->add_value('crit_achie_id', $achi['id']);
$update->add_value('crit_id', $d['id']);
$update->add_value('crit_desc', $d['description']);
$querystr = "INSERT INTO `" . $roster->db->table('crit', $addon['basename']) . "` SET " . $update->assignstr;
$result = $roster->db->query($querystr);
//echo $querystr.'<br>';
$rc++;
}
$crit .= '</ul></div>';

$tooltip .= $crit;

$update->reset_values();
$update->add_value('achie_name', $achi['title']);
$update->add_value('achie_desc', $achi['description']);
$update->add_value('achie_points', $achi['points']);
$update->add_value('achie_id', $achi['id']);
$update->add_value('achie_icon', $achi['icon']);
$update->add_value('achie_tooltip', $tooltip);
$update->add_value('c_id', $sub['id']);
$update->add_value('p_id', $cat['id']);
$update->add_value('achi_cate', $sub['name']);

$querystr = "INSERT INTO `" . $roster->db->table('achie', $addon['basename']) . "` SET " . $update->assignstr;
$result = $roster->db->query($querystr);
//echo $querystr.'<br>';
$rx++;
//*/
}
}
}
}


this is my full script to process achievements to a database keep in mind this is based of the roster frame work that i use but this is how i build my database and map to achievements
Reply Quote
87 Blood Elf Paladin
5935
thanks for being patient with me! I finally figured out the issue from looking at your code. It looked like you had some fields in the results that I didn't. turns out I was looking at the character achievements feed, not the overall achievement data. The overall achievement data lists the criteria ids, and the character feed doesn't. I should be on the way now. thank you again!
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]