[Suggestion] User-defined classes

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
TGYoshi
Posts: 795
Joined: 15 Mar 2011, 16:59

[Suggestion] User-defined classes

Post by TGYoshi »

For more complicated modes custom classes would be insanely useful.
And I don't mean the somewhat existing singleton classes, I'd love to be able to define "real" classes.

If you guys have any suggestion on how to fake custom classes with different data types and functions, I'd love to hear some ideas too.

Structs would help a lot too, anyway.
=3
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: [Suggestion] User-defined classes

Post by steeffeen »

even though i'm missing these two features as well, i'm not sure which custom class would be needed
do you have an example? so far i was able to implement every custom thing with key-value-coding (for example)

declaring custom enums would be great though! much code could be simplified and cleaned up if we wouldn't have to use integer codes (example) for these purposes
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    TGYoshi
    Posts: 795
    Joined: 15 Mar 2011, 16:59

    Re: [Suggestion] User-defined classes

    Post by TGYoshi »

    Creating a MOBA-like mode, having items/player-classes classes would severely simplify the whole code.
    Having an array like: Item[] NAItems would obviously make it MUCH easier to achieve the effect without having insanely dirty code like I always have due to the inability to use OO scripting.
    =3
    User avatar
    Jojo_44
    Posts: 485
    Joined: 12 Jul 2010, 15:58
    Location: Germany->Bavaria
    Contact:

    Re: [Suggestion] User-defined classes

    Post by Jojo_44 »

    TGYoshi I see you are from netherland so you might be able to read a bit german. m4rcel, who did the manialink tetris, has written a blog post about fake classes for maniascript which he used in his tetris code. Scroll down right before the comments and there´s a spoiler, just click on "Anzeigen". There´s some sample code and a short explanation in german.

    http://www.mania-community.de/entry.php ... is-Engines

    regards, Jojo
    Image
    my english sounds very unfriendly but it isn´t ;)
    User avatar
    TGYoshi
    Posts: 795
    Joined: 15 Mar 2011, 16:59

    Re: [Suggestion] User-defined classes

    Post by TGYoshi »

    He simply declares data for the quad class. I'll try something with Idents soon, might be able to declare for an ident..
    Using index pointers to tons of arrays is just too messy.
    =3
    User avatar
    TGYoshi
    Posts: 795
    Joined: 15 Mar 2011, 16:59

    Re: [Suggestion] User-defined classes

    Post by TGYoshi »

    Declaring for Idents isn't possible since you can not create Ident instances. You can't create an instance of anything easily.. Maybe UILayers but that's a huge base instance for simple classes.
    I guess I have to mess around with arrays.
    =3
    Post Reply

    Return to “ManiaScript”

    Who is online

    Users browsing this forum: No registered users and 1 guest