[Xaseco] Best Checkpoints Widget

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

weerwolf1
smooth traffic navigator
smooth traffic navigator
Posts: 236
Joined: 08 May 2008 09:25
Owned TM-games: All but original
Location: The Netherlands

Re: [Xaseco] Best Checkpoints Widget

Post by weerwolf1 »

Hi all,

I found that the times displayed horizontally with the checkpoints below where so much apart, it took me to long time to compare cp's with my opponents. I have added a new funtion which displays the round times below each other ans the cp's from left to right. (see screenshot)
Image

Added in plugins.bestruns.php :

Code: Select all

		elseif ($orientation == 4){
			display_best_runs_v4($aseco);
		}
and:

Code: Select all

function display_best_runs_v4($aseco){ // affiche les best runs | Modified by weerwolf 30.01.2010
	global $tab_meilleurs_temps;
	$config = simplexml_load_file('bestruns.xml');
	//==================
	//print_r($config);
	//print_r($tab_meilleurs_temps);
	
	$posx_frame = $config->position->x; //main x position of the widget
	$posy_frame = $config->position->y; //main y position of the widget
	$nb_temps_cp = $config->checkpoints->nb_bestruns_with_cp;
	$nb_cp_temps = $config->checkpoints->nb_max_checkpoints;
	$texte;
	$min=0;
	$sec=0; 
	$cen=0; 
	$i = 0;
	$place = 1;
	
	$posx;	
	
	$xml='<?xml version="1.0" encoding="UTF-8"?>';
	$xml.='<manialink id="342312">';
	$xml.='<frame posn="' .$posx_frame. ' ' .$posy_frame. '">';
	$xml.='<format textsize="1"/>';
	
	foreach($tab_meilleurs_temps as $info){ //pour chaque enregistrement
		
		$min = (int) (($info->temps) / 60000);
		$sec = (int) ((($info->temps) - $min * 60000) / 1000);
		$cen = (int) (($info->temps - $min*60000 - $sec*1000) / 10);
		$texte ="$z$place. $0f9";
		$texte .= "$min:";
		if ($sec < 10) $texte .= "0";	
		$texte .= $sec.'.';
		if ($cen < 10) $texte .= "0";
		$texte .= $cen;
		
		$posy = $i * (-2);
		$xml.='<quad  posn="0 ' .$posy. '" sizen="14 2.2" halign="center" valign="center" style="Bgs1InRace" substyle="NavButton" />';
		$posy = $posy+0.1;
		$xml.='<label posn="-6.2 ' .$posy. '" sizen="6.5 2" halign="left" valign="center" text="'.$texte.'"/>';
		$xml.='<label posn="-0.4 ' .$posy. '" sizen="6.5 2" halign="left" valign="center" text="'.$info->nickname.'"/>';
		if ($i < $nb_temps_cp){ // affiche les checkpoints de chaque temps
			$ii = 0;
			foreach ($info->checks as $cp){
				if ($ii < $nb_cp_temps){
					$minn = (int) (($cp) / 60000);
					$secc = (int) ((($cp) - $minn * 60000) / 1000);
					$cenn = (int) (($cp - $minn*60000 - $secc*1000) / 10);
					$textee ="$z$fff";
					$textee .= "$minn:";
					if ($secc < 10) $textee .= "0";	
					$textee .= $secc.'.';
					if ($cenn < 10) $textee .= "0";
					$textee .= $cenn;
					$posx = 9.5 + ($ii * (5.2));
					$xml.='<quad  posn="' .$posx. " " .$posy. '" sizen="5.5 2.2" halign="center" valign="center" style="Bgs1InRace" substyle="NavButton" />';
					$xml.='<label posn="' .$posx. " " .$posy. '" sizen="5.5 2" halign="center" valign="center" text="'.$textee.'"/>';
					$ii++;
				}else{
					break;
				}
			}
		}
		$i++;
		$place++;
	}
	
	$xml.='</frame></manialink>';
	$aseco->client->query("SendDisplayManialinkPage", $xml, 0, false); //requete d'affichage
}
Hope you can use it ;)
LYNX°°°° - Maniaplanet Gaming Community!
news | clan | community | & more
°°°°
afisse
cyclist
cyclist
Posts: 48
Joined: 13 Jun 2009 11:54
Owned TM-games: TMUF

Re: [Xaseco] Best Checkpoints Widget

Post by afisse »

Last Revision (21/02/2010) :

V1.1 :
http://www.sendspace.com/file/j77ylv
Galaad, le chevalier au coeur pur
weerwolf1
smooth traffic navigator
smooth traffic navigator
Posts: 236
Joined: 08 May 2008 09:25
Owned TM-games: All but original
Location: The Netherlands

Re: [Xaseco] Best Checkpoints Widget

Post by weerwolf1 »

Ok..... Was the idea above so awful that you even did not try to give a comment of it and considering adding it to updates? :ftw:
LYNX°°°° - Maniaplanet Gaming Community!
news | clan | community | & more
°°°°
Xymph
Pit Crew
Pit Crew
Posts: 5756
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [Xaseco] Best Checkpoints Widget

Post by Xymph »

afisse wrote:Last Revision (21/02/2010) :
V1.1 :
http://www.sendspace.com/file/j77ylv
You seem to have forgotten to include the Readme file that was in the previous version of the zip.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub
afisse
cyclist
cyclist
Posts: 48
Joined: 13 Jun 2009 11:54
Owned TM-games: TMUF

Re: [Xaseco] Best Checkpoints Widget

Post by afisse »

weerwolf1 wrote:Ok..... Was the idea above so awful that you even did not try to give a comment of it and considering adding it to updates? :ftw:
Main Post :mrgreen:

viewtopic.php?f=127&t=22232
Galaad, le chevalier au coeur pur
nerve
highway camper
highway camper
Posts: 2
Joined: 20 Mar 2010 23:52
Owned TM-games: TMUF

Re: [Xaseco] Best Checkpoints Widget

Post by nerve »

I modified it so that the checkpoints will update in realtime, and so that users can hide the widget. Also added in the fix for CPs going to newline.

http://www.iron-pulse.com/TM_Plugins/bestcps.zip
easyshaker
highway camper
highway camper
Posts: 2
Joined: 26 May 2010 18:38
Owned TM-games: TMU

Re: [Xaseco] Best Checkpoints Widget

Post by easyshaker »

Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:
afisse
cyclist
cyclist
Posts: 48
Joined: 13 Jun 2009 11:54
Owned TM-games: TMUF

Re: [Xaseco] Best Checkpoints Widget

Post by afisse »

easyshaker wrote:Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:
Because you don't dowload my version XD

http://www.sendspace.com/file/j77ylv
Galaad, le chevalier au coeur pur
pepel
cyclist
cyclist
Posts: 40
Joined: 30 Sep 2010 16:33
Owned TM-games: TMNF

Re: [Xaseco] Best Checkpoints Widget

Post by pepel »

afisse wrote:Hi all, here is the best Checkpoints widget

Image
how to configurate it like author pic?
give me cod pls
Last edited by Xymph on 25 Oct 2010 18:27, edited 1 time in total.
Reason: Fixed quoting
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: [Xaseco] Best Checkpoints Widget

Post by w1lla »

try one of these in the .xml provided.

Code: Select all

<orientation>1</orientation><!--0 : horizontal, 1 : vertical_V1, 2 : vertical_V2, 3 : vertical_V3 -->

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!
micsoccer10
highway camper
highway camper
Posts: 4
Joined: 03 Mar 2008 21:49
Owned TM-games: TMU

Re: [Xaseco] Best Checkpoints Widget

Post by micsoccer10 »

Hi ! How I can close the plugin when we are at the scores ?
User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1847
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [Xaseco] Best Checkpoints Widget

Post by Ant »

In v1.1 add this after line 14 in plugin.bestcps.php

Code: Select all

Aseco::registerEvent('onEndRace', 'clear_bestcps');
That will call this function (which is lines 252 - 255)

Code: Select all

function clear_bestcps($aseco, $challenge){//efface le widget entre 2 challenges
	$xml = '<manialink id="123123456"></manialink>';
    $aseco->client->query("SendDisplayManialinkPage", $xml, 1, false);
}
micsoccer10
highway camper
highway camper
Posts: 4
Joined: 03 Mar 2008 21:49
Owned TM-games: TMU

Re: [Xaseco] Best Checkpoints Widget

Post by micsoccer10 »

OMG It work !

Thanks you so much !
User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1847
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [Xaseco] Best Checkpoints Widget

Post by Ant »

no problem man :thumbsup:
nerve
highway camper
highway camper
Posts: 2
Joined: 20 Mar 2010 23:52
Owned TM-games: TMUF

Re: [Xaseco] Best Checkpoints Widget

Post by nerve »

easyshaker wrote:Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:
fixed it, online zip updated - you can download it again from same link
Post Reply