PyTorque: Scoping of Python and Torque Script
by Demolishun · in Torque Game Engine · 07/06/2007 (4:55 pm) · 1 replies
I just found this today:
www.mmoworkshop.com/trac/mom/wiki/PyTorque
I was wondering how the scoping works now that the engine basically is a Python object with the scoping. Here are my specific questions:
1. Does all Torque Script code still lack any scoping? If I run a script is it scoped globally to another script launched from Python?
2. If by default question 1 is true can different scopes be setup for Torque script explicitly?
3. I assume Python is scoped according to normal Python. I am not really familiar with it, but can Python be scoped as well?
What I need to know is if I can allow a user to write code in a "sandbox" that is not allowed access to everything in the engine. I would also like to be able to limit scoping to world, mission, object, etc to make the code safer in a multiuser setting. This would allow for AI scripting while the game is running for algorithm vs algorithm action.
Thanks for any insight on how the scoping rules work with PyTorque,
Frank
www.mmoworkshop.com/trac/mom/wiki/PyTorque
I was wondering how the scoping works now that the engine basically is a Python object with the scoping. Here are my specific questions:
1. Does all Torque Script code still lack any scoping? If I run a script is it scoped globally to another script launched from Python?
2. If by default question 1 is true can different scopes be setup for Torque script explicitly?
3. I assume Python is scoped according to normal Python. I am not really familiar with it, but can Python be scoped as well?
What I need to know is if I can allow a user to write code in a "sandbox" that is not allowed access to everything in the engine. I would also like to be able to limit scoping to world, mission, object, etc to make the code safer in a multiuser setting. This would allow for AI scripting while the game is running for algorithm vs algorithm action.
Thanks for any insight on how the scoping rules work with PyTorque,
Frank
About the author
I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67
Torque Owner David Janssens
Nebulagame.com