self usable to evt_tables and others.

Feature requests for future versions of Hollywood can be voiced here
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

self usable to evt_tables and others.

Post by Bugala »

So far I thought the usage of self is restricted only in evt_tables case, but now i noticed this same restriction is also when using SetInterval()

I can of course get around this problem using "userdata", but it does worry me a bit if it maybe gives me some hard to track problem at some point.

Hence to a wishlist a possibity to use self function in both evt_tables as well as setintervals and everywhere else too.

as example of how i want to be able to do is:

Code: Select all

SetInterval(1, MyFunction:SelfFunction, 100)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: self usable to evt_tables and others.

Post by airsoftsoftwair »

Might be a useful addition. I'll think about it.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: self usable to evt_tables and others.

Post by Bugala »

I believe it would result in more readable code, and current version could also result in need to make same function twice, for when using it for evt_table, you have to use it as table.function, instead of table:function, hence if you at some other point in code need to refer to that some function as table:function, that would mean you would need to make it twice, once for table.function and second for table:function, unless you manually add that userdata on that other call too, making code more messy again.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: self usable to evt_tables and others.

Post by Bugala »

I figured a way to get around when using setinterval:

Code: Select all

setinterval(1, function () MyFunction:SelfFunction endfunction, 100
Post Reply