[Request] Label Syntax Improvement

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

[Request] Label Syntax Improvement

Post by steeffeen »

Hey there,

I would like to see it being possible to write the following syntax

Code: Select all

***LabelName***
***{
declare Player <=> Players[0];
}***
unfortunately this will cause a syntax error (unexpected curly bracket)

why do i want this?
the declared variables in labels stay alive/available
this might cause problems on naming but also unnecessary memory usage (working in an extra block fixes this)
so i like to wrap my own labels which don't need to be able to create permanent variables in curly brackets

Code: Select all

{+++LabelName+++}
but that's not possible if you use labels of base scripts like the ModeBase

an additional solution would be adding another syntax used instead of "***" which realises such method-like implementation, like using another character -> "°°°"
but i can't imagine a good one right now :)

(a work-around is to add a trivial command before the opening bracket, for example the following:

Code: Select all

***LabelName***
***while(False)break;{
declare Player <=> Players[0];
}***
i think i don't have to mention that this sucks :P
an empty statement would be helpful for this, too ^.^)

regards
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Akbalder
    Posts: 1059
    Joined: 15 Jun 2010, 11:00
    Contact:

    Re: [Request] Label Syntax Improvement

    Post by Akbalder »

    In some scripts made by Nadeo, there is the instruction if(True){} to create a context.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [Request] Label Syntax Improvement

    Post by steeffeen »

    ah yeah that's indeed a shorter work-around :thumbsup:
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      Post Reply

      Return to “ManiaScript”

      Who is online

      Users browsing this forum: No registered users and 1 guest