[Plugin] Checkpoint Records

UASECO is a fork of the XAseco2/1.03 controller for Trackmania and has been overhauled to support the Modescript Gamemodes of Trackmania².

Moderators: undef.de, NADEO

iziboi
Posts: 5
Joined: 20 Mar 2018, 04:59

Re: [Plugin] Checkpoint Records

Post by iziboi » 02 Apr 2018, 06:53

Awesome plugin, thanks for sharing!

But, how to setup it for "Rounds" to do not rester checkpoint stats every round?

EDIT:

Fixed by removing:

Code: Select all

    /**
     * Called when a round ends
     * @param $aseco
     * @param $count
     */
    public function onEndRound($aseco, $count)
    {
        $this->initialize($aseco);
    }
Now would be nice warm up ignore.

User avatar
undef.de
Posts: 1968
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de » 17 Nov 2018, 20:55

If a player is driving the checkpoint time of e.g. 7.146 and an other player drives the exact time a little bit later, then the player who was driving the time earlier should be still displayed.

Currently that's not the case, now the second player is shown. To change that you have to change the function from

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

        if (!array_key_exists($cpId, $this->checkpoints)) {
            $this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() >= $time) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }
    
to

Code: Select all

    public function onPlayerCheckpoint($aseco, $params)
    {
        $player = $aseco->server->players->getPlayerByLogin($params['login']);

        if (!$player) return;

        $time = $params['lap_time'];
        $cpId = $params['checkpoint_in_race'];

	$force_update = false;
        if (!array_key_exists($cpId, $this->checkpoints)) {
		$this->checkpoints[$cpId] = new RecordsCheckpoint($cpId, $time, $player);
		$force_update = true;
        }

        $checkpoint = $this->checkpoints[$cpId];

        if ($checkpoint->getTime() > $time || $force_update === true ) {
            $checkpoint->setNewBest($time, $player);
            $this->updateWidget($aseco);
        }
    }


Also the file "plugin.checkpoint_records.ext.php" isn't required to be external, you could include the content into "plugin.checkpoint_records.php" after the end of the class "PluginCheckpointRecords".

Example structure:

Code: Select all

<?php
$_PLUGIN = new PluginCheckpointRecords();

class PluginCheckpointRecords extends Plugin {
	// Code here
}

class RecordsCheckpoint extends Checkpoint {
	// Code here
}

?>
That makes the handling/install much easier.


EDIT: I changed the plugin by myself, you can download the changed plugin at UASECO plugin repository: https://www.uaseco.org/plugins/details.php?id=2
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.

User avatar
braker
Posts: 6
Joined: 30 Dec 2017, 15:46

Re: [Plugin] Checkpoint Records

Post by braker » 08 Dec 2018, 13:03

Thank you for updating the plugin.
Just wanted to do it, I'm really stressed because of university and didn't have the time.

User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami » 02 Apr 2019, 22:57

Hi
This plugin (latest version) stopped working after uaseco 0.9.6 upgrade. I cant get it to work again. The configs looks ok and no errors in uaseco log.
Any idea?

User avatar
undef.de
Posts: 1968
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de » 03 Apr 2019, 18:04

Just checked plugin.checkpoint_records.php/1.12.1 build 2018-11-17 with 0.9.6 and it's working for me as it should. Maybe you have placed the position outside the viewport? Try to use the default values from the checkpoint_records.xml.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.

User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami » 03 Apr 2019, 19:12

Hi Undef
yes, Plugin v.1.12.1 build 2018-11-17
I'm using default values i xml:

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<settings>
	<scale>0.32</scale>
	<pos_x>120</pos_x>
	<pos_y>81</pos_y>
	<columns>5</columns>
	<spacing>1</spacing>
</settings>
plugin.checkpoint_records.php = default
plugins.xml = ok

Hmm..investigating...

User avatar
undef.de
Posts: 1968
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [Plugin] Checkpoint Records

Post by undef.de » 03 Apr 2019, 20:12

Which gamemode do you use? I have tested only Rounds.Script.txt and TimeAttack.Script.txt.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.

User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami » 03 Apr 2019, 21:40

I use TimeAttack.
Thx for helping. Havent figured it out yet...

User avatar
oldkami
Posts: 11
Joined: 27 May 2017, 12:07

Re: [Plugin] Checkpoint Records

Post by oldkami » 08 Apr 2019, 13:23

Finally solved missing plugin(s).
When some of the other plugins also disapeared (Vote, Donate), i replaced the plugins.xml with a old backup. Everything looked fine in file before, so i don't know what caused the problem (corruption?).
Anyway, everything is running fine now :)

Post Reply

Return to “UASECO”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests