[KB²] Scripts for ManiaPlanet

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
Kimi3
Posts: 510
Joined: 15 Jun 2010, 11:56
Location: France - Seine-et-marne (77)
Contact:

[KB²] Scripts for ManiaPlanet

Post by Kimi3 »

Image

Hi all, Kimi & Bo$$ Bravo are proud to present you their little project for ManiaPlanet. With this new Maniacs Age which is opening to us, Scripts are more omnipresent with the coming of ManiaScript.
Over time, we'll try to share you a large pannel of scripts, or tools, executing differents tasks. To the conversion tools to server's plugins, we'll try to proposate a maximum of scripts, with tutorials to help you to use it !

Boss and me are scripting before all for our pleasure, we're doing manialinks, and in general, we developpe systems to helps us for scripting faster. That's why the scripts that we'll share are various because, mostly we create them for our personal needs.

  • Scripts Listing
- Manialink Conversion 4:3/16:9 by Bo$$ : Convertor - Manialink in 4:3 to 16:9 (new)
- M² - Manialink Motor by Kimi : Base of Manialink creation in PHP (new)
  • Scripts Projects
- MS Rollover Menu : Script of Rollover Menu in ManiaScript
- Time functions Pack : Functions packs returning the timestamp
- TalkSystem : Discussion system integrate in the game (+ plugin of server)
Last edited by Kimi3 on 21 Sep 2011, 18:48, edited 1 time in total.
Image
User avatar
Boss-Bravo
Posts: 241
Joined: 10 Jan 2011, 18:26
Location: Devant mon PC :D
Contact:

Re: [KB²] Scripts for ManiaPlanet

Post by Boss-Bravo »

Manialink Convertor : 4:3/16:9


â–º Presentation

As you know, with Maniaplanet, Manialinks sizes are possible in 16:9 now. The 16:9 is the most format used for Computers now, and will become the most use in Manialinks.

For those who decided to do a new manialink on TrackMania², no matter for them, they'll pass in 16:9 at the start. But for those who had already a manialink on United in 4:3 and wanted to put it in 16:9, there are a lot of solutions.
The first one, change by hand X and Y values in attributes posn and sizen of each xml tag :mrgreen: Good luck :!:
I did at the beginning, and i stopped quickly, too long, so I created a script to do it in my place (Coder's laziness :lol:).

I put all of this on a web hosted on my FTP, here's the link :
http://www.boss-bravo.fr/scripts/Maniap ... alinks.php

:!: Be careful, the web design is completely in CSS3, all the users on Internet Explorer won't be able to read the page properly, even with the last update. :!:



â–º Website utilisation Tutorial


In order to use the page, you have to respecte some rules.

  • 1. Box insertion code
[/color]

Image

You have to insert your code on this box. As well, not all and anything, the script rox, ok (:mrgreen:), but the target is to run it not tu bug it ! :D (Even if it's rare).
  • In your text editor, Open the file to convert in 16:9
  • Put the codage in UTF-8 (in order to fix compatibily problems)
  • copy your code, but not anything, the code with less php script as possible, you can do it in several times, no matter. Here are some examples :

Code: Select all

<?php $go_count_messages = mysql_query("SELECT COUNT(*) AS nb FROM maniaplanet_boss_chat_object WHERE object='post_box_tm2_" . $type_chat . "' AND id_object='" . $id_object_chat . "'");
				$count_messages = mysql_fetch_array($go_count_messages);
				if ($count_messages) { $success16='Counting_Posts_box'; } else { $error_code=20; $error_message='Le comptage des messages a echoue'; }
				$scroll=0; $go_messages = mysql_query("SELECT * FROM maniaplanet_boss_chat_object WHERE object='post_box_tm2_" . $type_chat . "' AND id_object='" . $id_object_chat . "' ORDER BY id DESC LIMIT " . $start_ent . "," . $lignes_chat . "");
				if ($go_messages) { $success17='Reading_Box_Posts'; } else { $error_code=21; $error_message='La lecture des messages a echoue'; }
				while ($messages=mysql_fetch_array($go_messages)) {

					$message1=str_replace(':)', 'ï½¼', $messages['value']);
					$message2=str_replace(':D', 'ツ', $message1);
					$message3=str_replace('=D', 'ツ', $message2);
					$message4=str_replace('=)', 'ï½¼', $message3);
					$message5=str_replace(':p', ':Þ', $message4);
					$message6=str_replace(':P', ':Þ', $message5);?>
  • It's useless to put this code, only PHP and no XML, nothing to change. The script won't convert it anyway.
    INCORRECT CODE

Code: Select all

<quad style="Icons128x128_1" substyle="Vehicles" posn="0 41.25 5.000" sizen="25 18.75" align="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="100 -19.6875 5.000" sizen="102.5 105" halign="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="26.875 15.9375 5.000" sizen="42.5 15" halign="center" valign="center"/>
<quad style="BgRaceScore2" substyle="ScoreLink" posn="3.75 20.15625 6.000" sizen="12.5 9.375" align="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="26.875 -7.03125 5.000" sizen="42.5 27.1875" halign="center" valign="center"/>
<quad style="Icons128x128_1" substyle="ChallengeAuthor" posn="3.75 3.75 6.000" sizen="12.5 9.375" align="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="26.875 -30.46875 5.000" sizen="42.5 15" halign="center" valign="center"/>
<quad style="Icons128x128_1" substyle="United" posn="4.375 -25.3125 6.000" sizen="11.25 8.4375" align="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="26.875 -48.28125 5.000" sizen="42.5 15" halign="center" valign="center"/>
<quad style="Icons128x128_1" substyle="Coppers" posn="4.375 -43.125 6.000" sizen="12.5 9.375" align="center" valign="center"/>
<quad style="Bgs1InRace" substyle="NavButtonBlink" posn="26.875 -64.6875 5.000" sizen="42.5 15" halign="center" valign="center"/>
<quad image="<?php echo $absolute ;?>Images/stripe.png" sizen="50 1.875" posn="31.25 35.625 5.000" halign="center" valign="center"/>
<quad image="<?php echo $absolute ;?>Images/stripe.png" sizen="37.5 1.875" posn="25 25.3125 5.000" halign="center" valign="center"/>
<quad image="<?php echo $absolute ;?>Images/pouce_vert.png" posn="4.375 -60 6.000" sizen="8.75 6.5625" align="center" valign="center"/>
  • Here, the script will modify, and return it to 16:9 format (in that case, I'm already in 16:9 :lol: ) There has, with the echo $absolute but the script will see it and ignore it. The PHP will be there after the convertion.
    CODE ACCEPTABLE

Code: Select all

<label posn="-27.5 <? echo -8+2.25*$scroll;?> 2" sizen="15 2" textsize="2" style="TextButtonSmall" text="<? echo $messages['nickname'];?>$z$o$fff :" halign="left" valign="center"/>
<label posn="-10 <? echo -8+2.25*$scroll;?> 2" textsize="2" sizen="36 2"  text="<? echo $message6;?>" halign="left" valign="center"/>
  • Here, the script will detect XML, but it will see in the posn, there's no just numbers, but also PHP code, It will adapt and get numbers inside the PHP code and convert it in 16:9.
    CODE ACCEPTABLE


Here are the commons example.
  • After this done, you can clik on the button submit, the script will load a bit, et resend you the same page.
  • Scroll down a little, and look at the box under, you'll see this :

    Image

    As well it's full, but all the code you put will be in this box and convert in 16:9. You can Copy/paste in your script at the same place of the old one.


    • 2. Box manual conversion
    [/color]
  • If you scroll down on the page, you'll see an other tool :

    Image
  • Here you'll be able to enter manually the coordonates X and Y of a attribute, you'll also be able to put an X value, or the Y value, it depends of what you want.
  • After clik on transform, the page will load and you'll have your X and Y values converted in 16:9 on Results box.



â–º Recommandations


So this is the end of the tuto, but some recommandations :lol:
  • Recall : for put your manialink in 16:9, you'll have to put the attribute "version" in your manialink tag. And put 1 between quotations marks for 16:9 or 0 for 4:3.
    Example for 16:9 :

    Code: Select all

    <manialink version="1">
  • If you have a bug (it can happen, none script is perfect :mrgreen: ) please contact me on the section contact of my website ( http://www.boss-bravo.fr/contact ), and give me the code you tried, if possible the error and the date that it appeared.:D As well if it's possible, it will help, because logs files are created during the utilisation of this page, i'll be able to find the problem faster. Thanks ;)
  • I'm not responsible of your errors, conserve a copy of your script, I recommand you to make to folders, one for 4:3 manialink, and the other for 16:9, so if there is a bug, you have your old script.

If you have question, Ask me ! ;)

All donations is warmly welcome by Bo$$ Bravo ! login : boss-bravo

Translation : Kimi, thanks to him ;)
Last edited by Boss-Bravo on 21 Sep 2011, 20:36, edited 3 times in total.
User avatar
Kimi3
Posts: 510
Joined: 15 Jun 2010, 11:56
Location: France - Seine-et-marne (77)
Contact:

Re: [KB²] Scripts for ManiaPlanet

Post by Kimi3 »

M² Manialink Motor

Translation in Progress


French Topic
Image
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 0 guests