What devs would like in MP4 for ManiaScript
Moderator: English Moderator
Re: What devs would like in MP4 for ManiaScript
Instead of writing new pseudo language, I would see better dev tools for writing current maniascript syntax.
I started while ago project for netbeans language support...
but as it has only partial implementation for javacc syntax parser, it can't auto sense variable types and thus can't auto complete the variables that has been introduced, or enums for the variables... If possible, I would like to see javadoc parser integrated also, so return type variable autocomplete would work too.
I guess instead of using resources for writing pseudo language, we should concentrate on writing better dev tools for the maniascript outside the game (with syntax checker and autocomplete + autosense variables), which would benefit us all a lot more.
But, well, it's only my opinion.
I started while ago project for netbeans language support...
but as it has only partial implementation for javacc syntax parser, it can't auto sense variable types and thus can't auto complete the variables that has been introduced, or enums for the variables... If possible, I would like to see javadoc parser integrated also, so return type variable autocomplete would work too.
I guess instead of using resources for writing pseudo language, we should concentrate on writing better dev tools for the maniascript outside the game (with syntax checker and autocomplete + autosense variables), which would benefit us all a lot more.
But, well, it's only my opinion.
Re: What devs would like in MP4 for ManiaScript
I don't see how some autocompletion or syntax coloring is going to be a lot more of an advantage than actual structures and classes. Note that I wrote that transcompiler as an example of what could be done, I'm not sure if I'm ever going to finish it, especially if structures and classes are going to be implemented in MP4.
There's also this Sublime package for syntax coloring and autocompletion. (That autocompletion is pretty badly implemented though, in my opinion.)
There's also this Sublime package for syntax coloring and autocompletion. (That autocompletion is pretty badly implemented though, in my opinion.)
Re: What devs would like in MP4 for ManiaScript
Well true, Stuctures and Classes would be really, really really nice to have... but good dev tools outside the game is something that is really also missing...
Re: What devs would like in MP4 for ManiaScript
If anything, Maniascript could use a proper remote debugger (breakpoints, remote console, stack/variable/object inspector, etc). I've not really looked into whether this already exists or not, but that would be the only "dev tool" I'd really want to see.reaby wrote:Well true, Stuctures and Classes would be really, really really nice to have... but good dev tools outside the game is something that is really also missing...
- Nerpson
- Translator
- Posts: 1555
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
- Contact:
Re: What devs would like in MP4 for ManiaScript
Packing many scripts in one *.Script.Gbx file would be interesting in order to have more than 1 file fore a gamemode (plus maybe images, things to include). With this system, it would be easier to have separated classes files.
Code: Select all
Doppler.Script.Gbx:
- Init.Script.txt
- LapsMode.Script.txt
- NormalMode.Script.txt
- Flash.dds
Re: What devs would like in MP4 for ManiaScript
For XmlRpc methods :
Ability to set/get a value to a/from player manialink :
1. SetNetVarForLogin(string, string, |int,| object, bool) where the first parameter would be Login, second would be the Variable name, the third the value to apply, and the fourth mean if the value need to be forced.
The int parameter would be the ID of the manialink ( look after this chapter )
This will only work if the variable is present in the principal manialink ( that already shown ).
example :
And in the manialink of the player :
MyVariable will log 13 and not 0.
If the fourth param is False, then :
example :
GetNerVar would be the same.
2. Ability to set multiple manialinks.
Why? It's simple, if you got a lot of manialinks to be displayed, you'll need to send a lot of informations, because only one "manialink" will be send, so, we need to display a manialink or more manialinks to a player with a specific ID for the manialink.
example :
Actual :
Replacement :
SendDisplayManialink|ToLogin|(string, string, int, int, bool)
First parameter : Login or uID;
Second : Manialink to be shown.
Third : The ID of this manialink.
<etc....>
example :
Also RemoveDisplayManialinkToLogin("guerro", ID_ofTheManialink);
Ability to set/get a value to a/from player manialink :
1. SetNetVarForLogin(string, string, |int,| object, bool) where the first parameter would be Login, second would be the Variable name, the third the value to apply, and the fourth mean if the value need to be forced.
The int parameter would be the ID of the manialink ( look after this chapter )
This will only work if the variable is present in the principal manialink ( that already shown ).
example :
Code: Select all
SetNetVarForLogin("guerro", "MyVariable", 13, true);
Code: Select all
main() {
declare MyVariable for LocalUser = 0;
while(true) {
yield;
log(MyVariable);
}
}
If the fourth param is False, then :
example :
Code: Select all
main() {
declare MyVariable for LocalUser = 0;
while(true) {
yield;
foreach (Event in PendingEvents) {
if (Event.Type == CMlScript::XmlRpc::OnApplyVar) {
if (Event.XmlRpc.Name == MyVariable.Name) {
PassOn(Event);
// or
Discard(Event);
}
}
}
}
}
2. Ability to set multiple manialinks.
Why? It's simple, if you got a lot of manialinks to be displayed, you'll need to send a lot of informations, because only one "manialink" will be send, so, we need to display a manialink or more manialinks to a player with a specific ID for the manialink.
example :
Actual :
Code: Select all
<manialink version="2">
// Manialink 1
</manialink>
<manialink version="2">
// Manialink 2
</manialink>
<manialink version="2">
// Manialink 3
</manialink>
</etc....>
And then send it to the players... and repeat when you need to refresh a SPECIFIC part of a manialink
SendDisplayManialink|ToLogin|(string, string, int, int, bool)
First parameter : Login or uID;
Second : Manialink to be shown.
Third : The ID of this manialink.
<etc....>
example :
Code: Select all
toReturn1 = ""<manialink version="2">
// Manialink 1
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn1, 1, 0, false);
<some codes between...>
toReturn2 = ""<manialink version="2">
// Manialink 2
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn2, 2, 0, false);
<some codes between...>
toReturn3 = ""<manialink version="2">
// Manialink 3
</manialink>"";
SendDisplayManialinkToLogin("guerro", toReturn3, 3, 0, false);
- Nerpson
- Translator
- Posts: 1555
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
- Contact:
Re: What devs would like in MP4 for ManiaScript
I thought it would be great to have public libraries constants, something like
It would avoid this:
It would also be a good way to implement fake enums, with libraries only containing that kind of things.
EDIT: Sorry for uping this post lol, I tried a button and now I know the result
Code: Select all
/* Lib.Script.txt */
#PublicConst RESULT_SUCCESS 1
#PublicConst RESULT_ERROR 0
Code: Select all
/* MainCode.Script.txt */
if(Lib::GetLastDialogResult() == Lib::RESULT_SUCCESS) {
foo();
}
Code: Select all
/* Lib.Script.txt */
Integer RESULT_SUCCESS() {
return 1;
}
Integer RESULT_ERROR() {
return 0;
}
Code: Select all
/* MapType.Script.txt */
#PublicConst FIRE
#PublicConst FOREST
#PublicConst SAND
#PublicConst ICE
Code: Select all
/* MainCode.Script.txt */
declare netwrite Net_MapType for Teams[0];
switch (Net_MapType) {
case MapType::FIRE: {
foo();
}
case MapType::FOREST: {
bar();
}
case MapType::SAND: {
foobar();
}
case MapType::ICE: {
barfoo();
}
}
-
- Posts: 1257
- Joined: 06 Mar 2013, 16:12
- Manialink: explore
- Location: Vendée | France
- Contact:
Re: What devs would like in MP4 for ManiaScript
A library for creating confirm and alert pop ups.
Sorry if it has alreay been suggested
Example :
JSON library
This code generates an array of values.
Sorry if it has alreay been suggested
Example :
Code: Select all
Dialog::OpenAlert("My message", "Button Name");
declare Boolean ConfirmValue = Dialog::OpenConfirm("Do you want to save your work ?", "Yes, I want !", "No");
This code generates an array of values.
Code: Select all
JSON::toArray(JSONContent);
JSON::getValueOf("ranking");
Re: What devs would like in MP4 for ManiaScript
There's already a JSON library though: Libs/Nadeo/Json.Script.txt
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
Forum moderator, opinions are my own.
Check out openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
-
- Posts: 1257
- Joined: 06 Mar 2013, 16:12
- Manialink: explore
- Location: Vendée | France
- Contact:
Re: What devs would like in MP4 for ManiaScript
Right but the current library creates JSON objects from the given names and values.
I want to parse JSON and get the values.
I want to parse JSON and get the values.
Who is online
Users browsing this forum: No registered users and 1 guest