ULX

Author Topic: How would I change my current environment in lua?  (Read 2177 times)

0 Members and 1 Guest are viewing this topic.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
How would I change my current environment in lua?
« on: January 23, 2014, 05:11:34 PM »
So when I was working on this...

http://forums.ulyssesmod.net/index.php/topic,6987.msg34775.html#msg34775

I got a message saying this...

Quote
dont do it on g
do it on the current environment
make a new environment

So how exactly would I even start doing that, I am currently pretty tired so sorry if I am just being stupid but I have checked all of the following sites, and I am still not sure how to do it.

http://www.lua.org/pil/14.3.html
http://stackoverflow.com/questions/14290527/recreating-setfenv-in-lua-5-2
I cry every time I see that I am not a respected member of this community.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How would I change my current environment in lua?
« Reply #1 on: January 23, 2014, 05:23:44 PM »
Any table is its own environment. This person is just saying to do it on a table. E.G., do plys, then you can go plys.Megiddo (or whatever).
Experiencing God's grace one day at a time.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: How would I change my current environment in lua?
« Reply #2 on: January 23, 2014, 09:01:37 PM »
Any table is its own environment. This person is just saying to do it on a table. E.G., do plys, then you can go plys.Megiddo (or whatever).

Tbanks, I wish that this information was easier to get... :\
I cry every time I see that I am not a respected member of this community.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How would I change my current environment in lua?
« Reply #3 on: January 24, 2014, 05:15:45 AM »
It's right there in the manual. ;)
Experiencing God's grace one day at a time.