PDA

View Full Version : Implementing a leaderboard popup


Dhrystone
02-20-2013, 04:29 PM
Hi again all,

The mission is to have a hotkey button that players can press that will display a pop-up of the current 10 highest level characters on the server, without, if possible, any code changes.

How would I best go about doing that? No need for precise details, just a little help in finding the right direction to approach it.

My thoughts are an AA ability that would lead to a quest perl script that would do the popup.

Is that feasible? Is there an easier way?

Thanks
Dhry

c0ncrete
02-20-2013, 07:46 PM
1) have lore masters for your world that are scripted via global_npc to query the character table via the DBI::mysql module. possibly enforcing limits to successive requests for updated info per client or account via qglobals to keep numb-skulls from hammering your database just because they can.

2) single qglobal with serialized info regarding the top 10 characters with characterid and max level being stored. check and update as required each time EVENT_LEVEL_UP is triggered in global_player script. could also use 10 separate qglobals and just check them all via looping through an array, i suppose. would have more room for data in each to deal with things like multiple entries (ties).

i'm probably only going to come up with more convoluted suggestions from this point... :|

trevius
02-21-2013, 04:20 AM
For leaderboard stuff, I like using DBI and just make your own custom tables for tracking the data. Though, for something that simple, qglobals would probably work fine if you did it right.

As far as having a hotkey, I am sure you could do it via a custom AA, but that would also require a custom dbstr_us.txt file if you want the correct hotkey name and such to show up for them.

Alternatively, you could just add an EVENT_SAY to your global_player.pl script in the templates folder and use it to parse # commands. I haven't messed with it much, but quest parsing # commands was recently added by Akkadius and really opens up some cool options like that. Then, players could create their own hotkey to do something like "/say #leaderboard" and you would handle your popup menu from the EVENT_SAY.

Dhrystone
02-21-2013, 11:20 AM
I definitely like the idea of using a # command for it. That's why I asked here -- I'd have never known that was an option and would have gone to a lot of trouble to make a weaker implementation. You guys are awesome.

thepoetwarrior
04-16-2013, 03:36 AM
Sorry if this derails or hijacks the topic, but what would be some other good leaderboard topics or stats to put in?

HP Regen, Mana Regen, other stuff? What would be code to obtain those stats too?