What devs would like in MP4 for ManiaScript

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

reaby
Posts: 1032
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by reaby »

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.
User avatar
Miss
Posts: 2155
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by Miss »

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.)
reaby
Posts: 1032
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by reaby »

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...
User avatar
Miss
Posts: 2155
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by Miss »

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...
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.
User avatar
Nerpson
Translator
Translator
Posts: 1555
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by Nerpson »

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
ImageImageImageImage
User avatar
Guerro323
Posts: 610
Joined: 14 Jun 2014, 15:51

Re: What devs would like in MP4 for ManiaScript

Post by Guerro323 »

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 :

Code: Select all

SetNetVarForLogin("guerro", "MyVariable", 13, true);
And in the manialink of the player :

Code: Select all

main() {
	declare MyVariable for LocalUser = 0;
	while(true) {
		yield;
		log(MyVariable);
	}
}
MyVariable will log 13 and not 0.
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);
				}
			}
		}
	}
}
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 :

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
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 :

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);
Also RemoveDisplayManialinkToLogin("guerro", ID_ofTheManialink);
C'est Grandiose!
Image
User avatar
Nerpson
Translator
Translator
Posts: 1555
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by Nerpson »

I thought it would be great to have public libraries constants, something like

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();
}
It would avoid this:

Code: Select all

/* Lib.Script.txt */

Integer RESULT_SUCCESS() {
    return 1;
}
Integer RESULT_ERROR() {
    return 0;
}
It would also be a good way to implement fake enums, with libraries only containing that kind of things.

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();
    }
}
EDIT: Sorry for uping this post lol, I tried a button and now I know the result :? :lol:
ImageImageImageImage
TheBigMiike
Posts: 1257
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by TheBigMiike »

A library for creating confirm and alert pop ups.
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");
JSON library
This code generates an array of values.

Code: Select all

JSON::toArray(JSONContent);
JSON::getValueOf("ranking");
Image Image
User avatar
Miss
Posts: 2155
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by Miss »

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. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
TheBigMiike
Posts: 1257
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: What devs would like in MP4 for ManiaScript

Post by TheBigMiike »

Right but the current library creates JSON objects from the given names and values.
I want to parse JSON and get the values. :)
Image Image
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 2 guests