Page 1 of 1

possibility to use [1][2] in table definings

Posted: Sun Jul 24, 2016 10:30 am
by Bugala
I just ended, once again to the situation where I am making table of "triggers" to 2 dimensional map.

Idea is that I have this:

Code: Select all

Map = {
       [1] = {1, 2, 3}
       [2] = {1, 2, 3}
       [3] = {1, 2, 3}
Then i start making some blocks being triggers:

Code: Select all

Triggers = {
         [2] = { [3] = {trigger} }
               }
Especially when there are several triggers, it becomes bit ugly, hence i would rather just do:

Code: Select all

Triggers = {
       [2][3] = {trigger}
                         }
making code much more readable.


But would it be possible to make Hollywood this way, as automatically defining table Triggers[2], since this is the problem basically that Triggers[2] is not defined when trying to define its index [3].

Re: possibility to use [1][2] in table definings

Posted: Sun Jul 24, 2016 2:34 pm
by lazi
Sorry, don't understand what you want to reach.
Could you describe the problem a bit more?

Re: possibility to use [1][2] in table definings

Posted: Sun Jul 24, 2016 4:36 pm
by Bugala
This is at wishlist. Currently this is not possible, hence it is feature suggestion to Andreas, but thanks for trying to figure out a solution anyway.

Re: possibility to use [1][2] in table definings

Posted: Sun Jul 24, 2016 11:35 pm
by airsoftsoftwair
This looks like much too specific for a VM feature... I doubt that there are other people who'd be looking for the very same thing :)

Re: possibility to use [1][2] in table definings

Posted: Tue Jul 26, 2016 1:06 am
by lazi
Bugala wrote:This is at wishlist. Currently this is not possible, hence it is feature suggestion to Andreas,...
I did not even know about this method of addressing a table element.
Triggers = { [2] = { [3] = {trigger} }}

Thanks!

Re: possibility to use [1][2] in table definings

Posted: Sat Jul 30, 2016 5:01 am
by airsoftsoftwair
It's all in the doc :)