This is a very complex topic and i can not include this here, but there are several Tutorials out there (see the links below).
The mean problems with these Tutorials is, that they did not include the specials about creating Manialinks for server related Widgets,
but here i try to compensate these.
The <manialinks> is the root element for server side Manialinks and not <manialink>,
please note the s in the first one!
The elements <timeout>, <include>, <entry>
and <fileentry> does not work with server side Manialinks, because the Game client only
send the Action Id to the dedicated server.
With $h you can link to a Manialink, but be sure you have wrote it lower case, otherwise
the link does not work. All other codes like $L can be written upper case.
With TM2 new dimensions for Manialinks was introduced, now it is possible to make Manialinks for Wide-Screens in 16:9.
If you want to reuse your current Manialink from TMF for TM2 and for Wide-Screens, then you have to adjust all posn
and sizen attributes. Just multiply all your X with 2.5 and Y
with 1.875.
The max. size of the Viewport in TMF is 128 x 96 and in TM2 it is 320 x 180.
With the update from 2013-04-24 there are new attributes
available for Manialinks.
For debugging Maniascripts in Manialinks you can now add the attribute name="NameOfThisManialink", which will
be shown in the CTRL+G console, see here for more details.
Development
Accessing in-game Flags
To use the in-game Nation-Flags you can use the following piece of code:
A full list of available flags can be found in: %ProgramData%\ManiaPlanet\PacksCache\ManiaPlanet_Skins.zip\Skins\Avatars\Flags\
In Trackmania (TMF) you have the same possibility, but instead of file:// you have to use tmtp://.
A full list of available flags can be found in: %Install-Dir%\GameData\Skins\Avatars\Flags\
Development
Accessing in-game Player-Avatar
To use the Player-Avatar in a quad, you can use this piece of code in Maniaplanet:
Just replace <PLAYER_LOGIN> with the login from the Player.
In Trackmania (TMF) you have to access the list-method GetDetailedPlayerInfo to get the structure Avatar,
in this structure you will find the FileName which holds the Path and Name.
Instead of file:// you have to use tmtp:// and it can take a while before the avatar is displayed,
because it has to be transfered over P2P.
Development
Identifications in Manialinks for XAseco1 and XAseco2
You have to distinguish between Action Ids and Manialink Ids. The Action Id you
have to use to identify a click on a Button in your Widget. The Manialink Id is to identify your Widget to
be able to control it (e.g. hide or update/replace it).
To identify that a Player has clicked on a Button in your Widget (or the Widget himself) you need to add a Action id,
after a click on this you can identify these click at the event onPlayerManialinkPageAnswer.
Before you setup simple Ids like 08154711, think about this, because i saw many times such Ids and you
run into trouble when the Admin run your and another Plugin (which use the same Ids) together!
It is good practise to think before write some code. Setup a list which Manialink Ids and Action Ids
you need and then make a list like this:
After that you are ready to write code... ;)
To interact with the Players, you need to setup a action="[N]" into your Manialink.
When a Player click on your Button, then the Game-Client send this Action Id to the dedicated server
and this releases the Callback TrackMania.PlayerManialinkPageAnswer (TMF) or
ManiaPlanet.PlayerManialinkPageAnswer (TM2) to XAseco and XAseco releases the
event onPlayerManialinkPageAnswer.
As you can see in the second example i use the same Id for the Manialink Id and the Action Id
and this is no problem for you or the dedicated server, because only the Action Id are available at the event
onPlayerManialinkPageAnswer for identifying!
Development
Custom Ui management for Manialinks for XAseco1 and XAseco2
With a special addition to your Manialink you can control (enable/disable) the in-game Widgets. Since the Freezone in TMF you
have to send such a CustomUi block only once when the Player connects, otherwise your Plugin breaks the Freezone-Rules.
To see which result you have after disabling one of the above, see this description:
Element
Description
<notice>
Messages like Player xyz connects to the game. or Player xyz get the 1. place.
<challenge_info>
Challenge-Info at top right
<net_infos>
Top right the (TMF: orange, TM2: blue) progress bar, indicates loading of Skins, Mods, Avatars, Music...
<chat>
Chatbox at the bottom
<checkpoint_list>
Checkpoint-List between Time- and Speed-Box
<round_scores>
Automatic Round-Score-Panel at the right side (only at the Gamemodes Rounds, Team and Cup)
<scoretable>
Automatic Scoretable at Score, after crossing the finishline of the Map or on pressing TAB
<global>
Control all the above option
Setup the Custom Ui
It is easy to setup one of the Custom Ui entries, just call the function setCustomUIField() from
manialinks.inc.php like this:
But with these the work is not done, because you need to send this with your own Manialink together:
With the function getCustomUIBlock() you can get the whole Custom Ui, you must always send a complete
Custom Ui to take the wanted effect!
The $xml from the above example looks now like this:
Development
Build Manialinks for XAseco1 and XAseco2
In server side Manialinks you are able to send more then one Manialink together. This makes it easier for you
to control each Manialink, e.g. to send two Manialinks and after a while you can disable one of them and the remaining
Manialink is still to see.
To hide one of the above sent Manialinks, just send a empty Manialink with the same Manialink Id:
Development
Send your Manialink in XAseco1 and XAseco2
To send your Manialink you need to check who should become your Manialink. There are more ways to do that,
the first is to send your Manialink to all connected Players, the second is send it to a given Player only and
the third is to send to a list of Players.
Parameter
Description
$xml
Your Manialink
$player
A Login from a connected Player
$logins
A array of connected Player logins
$timeout
A timeout to autohide it (0 = permanent), $timeout was given in seconds and the dedicated server awaits miliseconds
$close
A boolean to indicate whether the page must be hidden as soon as the Player clicks on a page option
Last modified: Mon, 21 Jul 2014 20:21:13 +0200
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
XAseco is maintained by Frans P. de Vries.
MPAseco is maintained by Kremsy, ManiacTwister & TheM
Reordered Navigation
Maybe you have already noticed, that i have changed the order in
the Navigation. Since now XAseco2 is in front of all others content.