Hello, good afternoon, I would like to know if someone from that forum knows how to make user interfaces for a custom game mode. I'll explain why I've decided to ask for help.
I'm not a programmer (wow that older excuse) but it's a disadvantage when you have no idea how things work.
I know that now the UI of the game modes use something called Hud. Module. GBX and from there they call modules with preset styles but not editable.
Delete the path of the game mode and also its modules, so I stay the HUD old (MP3 HUD).
Now that I do not have the HUD of MP4 I want to add quads and labels to the UI, but I can not find any file that allows me to do, except the library Layers2. Script. txt
I discovered how to use a function called Create ();
So I wrote in TimeAttack. Script. txt on the plug Match_LoadHud the following:
Layers:: Create (NewQuad, "< Label pos = " 0 0 "z-index = " 0 "text = " This is an example "/> ");
But when compile tells me syntax error, unexpected MANIASCRIPT_NATURAL, expecting MANISCRIPT_SEMICOLON
Until there comes no matter what someone can ahcer me see what I do wrong or I need to do?
How to Make a Custom User Interface in a game Mode
Moderator: English Moderator
Re: How to Make a Custom User Interface in a game Mode
This is list of errors, it might help you:
http://konte.org/trackmania/maniascript/syntax.txt
http://konte.org/trackmania/maniascript/syntax.txt
- Dommy
- Translator
- Posts: 1901
- Joined: 25 Aug 2011, 21:45
- Manialink: exchange
- Location: Poland
- Contact:
Re: How to Make a Custom User Interface in a game Mode
Don't bother with modules - they aren't as useful as preferable solution. For beginners, I would recommmend using Layers2 library. It should be included in all game modes by default.
You either want to write \" instead " in side your single-line Text string, like:
...or use a different XML character for your label attributes (attributes are things, like pos="0 0"):
...or (preferably) you probably want to use multiline Text, which doesn't require escaping characters and can, as stated, be multiline, unlike previous declarations:
Another thing you need to do is use functions Create() and Attach() properly. Create() will create an interface layer (one manialink), while Attach() will show it to the players. The way I wrote it below will show your UI to all players, if you put this at the beginning of your game mode, inside ***Match_StartServer*** block.
Note, I also added <manialink> tag, which will indicate your manialink is using most recent features of the manialinks. 3x "MANIALINK" COMBO
Hope that helps!
That's because Text contains unescaped (forbidden) characters, like ". Instead seeing Text, compiler (program that turns your code into working thing) sees a lot of different data types, since the line is formatted incorrectly.Sheiken wrote: ↑27 Jan 2018, 22:28 I discovered how to use a function called Create ();
So I wrote in TimeAttack. Script. txt on the plug Match_LoadHud the following:
Layers:: Create (NewQuad, "< Label pos = " 0 0 "z-index = " 0 "text = " This is an example "/> ");
But when compile tells me syntax error, unexpected MANIASCRIPT_NATURAL, expecting MANISCRIPT_SEMICOLON
You either want to write \" instead " in side your single-line Text string, like:
Code: Select all
"<label pos=\"0 0\" z-index=\"0\" text=\"This is an example\" />"
Code: Select all
"<label pos='0 0' z-index='0' text='This is an example' />"
Code: Select all
"""
<label pos="0 0" z-index="0" text="This is an example" />
"""
Code: Select all
Layers::Create("MyOwnUI", """
<manialink version="3">
<label pos="0 0" z-index="0" text="This is an example" />
</manialink>
""");
Layers::Attach("MyOwnUI");
Hope that helps!
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT
Contact me via GALAXY & PURSUIT DISCORD
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT
Contact me via GALAXY & PURSUIT DISCORD
Re: How to Make a Custom User Interface in a game Mode
Thanks adamkoo2, no have idea about that list, very useful.adamkooo2 wrote: ↑28 Jan 2018, 10:00 This is list of errors, it might help you:
http://konte.org/trackmania/maniascript/syntax.txt
Thanks Again Dommy, , yeah the modules are like other planet for me. It worksDommy wrote: ↑28 Jan 2018, 12:48 Don't bother with modules - they aren't as useful as preferable solution. For beginners, I would recommmend using Layers2 library. It should be included in all game modes by default.
That's because Text contains unescaped (forbidden) characters, like ". Instead seeing Text, compiler (program that turns your code into working thing) sees a lot of different data types, since the line is formatted incorrectly.Sheiken wrote: ↑27 Jan 2018, 22:28 I discovered how to use a function called Create ();
So I wrote in TimeAttack. Script. txt on the plug Match_LoadHud the following:
Layers:: Create (NewQuad, "< Label pos = " 0 0 "z-index = " 0 "text = " This is an example "/> ");
But when compile tells me syntax error, unexpected MANIASCRIPT_NATURAL, expecting MANISCRIPT_SEMICOLON
You either want to write \" instead " in side your single-line Text string, like:...or use a different XML character for your label attributes (attributes are things, like pos="0 0"):Code: Select all
"<label pos=\"0 0\" z-index=\"0\" text=\"This is an example\" />"
...or (preferably) you probably want to use multiline Text, which doesn't require escaping characters and can, as stated, be multiline, unlike previous declarations:Code: Select all
"<label pos='0 0' z-index='0' text='This is an example' />"
Another thing you need to do is use functions Create() and Attach() properly. Create() will create an interface layer (one manialink), while Attach() will show it to the players. The way I wrote it below will show your UI to all players, if you put this at the beginning of your game mode, inside ***Match_StartServer*** block.Code: Select all
""" <label pos="0 0" z-index="0" text="This is an example" /> """
Note, I also added <manialink> tag, which will indicate your manialink is using most recent features of the manialinks. 3x "MANIALINK" COMBOCode: Select all
Layers::Create("MyOwnUI", """ <manialink version="3"> <label pos="0 0" z-index="0" text="This is an example" /> </manialink> """); Layers::Attach("MyOwnUI");
Hope that helps!
Who is online
Users browsing this forum: No registered users and 1 guest