Variable Character Limit

  • I noticed something odd with variable names that did not happen on the MA2.

    Variable in MA3 seem to have a limit of 15 characters; any variable name longer then this gets accepted but truncated to the first 15 characters.

    This gets odd if you have a name where the first 15 characters are the same (contrived I know but I ended up in this situation because of a scripting bug)

    For example let's say we have 4 variables with the first 15 characters the same:

    You end up with 4 variables with the same 15 character name.

    Now when you go to edit one you end up with a 5th:

    Now when you go to delete them you get an error, unless you use the trunked name, at which point it deletes one of them each time you run the command.

    The only reason I ended up running into this was because I'm building out a plugin that you may have more then 1 instance of the plugin running and I wanted to make sure each one had it's own set of variables and I choose the wrong prepend string.

    It would be nice if the limit was listed in the manual, SetG SetU and the Lua commands threw an error when the length the name is too long, or if it was like on the 2 with some huge length.

  • and Hoss, if they are too long, you can't see what they were in the past, since the commandline is not showing the full variable name. So you can also not delete them via the delglobalvar command. And there is also no function to delglobalvar *.

    i think there is some improvement possible on that part ;)

  • DelGlobalVar * does not work, I tried that first :).

    I did tested something like 45 characters in MA2 and I could see it in the command line, not that you should ever need one that long.

    I guess the main issue is if you have a name that is more than 15 characters long you just keep making new ones and can't predictably delete or edit them.

    Also would be nice in Lua to have something like a GetAllGolbals() as a table to you could iterate through them

  • yeah that would be great. now if i make a group_1_color_base_bump_whatevah 15 variable, and i made a typo at the end, i can never delete it again.

    hope there will be some api documentation or expansion soon. for now keep up the good work hoss.

  • Well you can delete it but it requires you to know that it has happened. At worse it would break a macro or script. You could easily end up with 100's of instances of "group_1_color_b" variables before you figure out what is going on. At that point you have to delete them one at a time (though may have found a way around that today).

    Anyway I'm sure it will all be fixed. I'm not sure they are ready to release the API though. Did they actually ever release one for the MA2? With all this time on my hands I'm doing my best with what I can find here.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!