TGEA 1.7 Python Support
by Prairie Games · in Torque Game Engine Advanced · 03/29/2008 (11:28 am) · 75 replies
Hey all, been doing some R&D on a new project and wanted to try out the (awesome) new build system
included with TGEA 1.7
I also wanted to have a look at some embedded scripting... and so dusted off PyTorque, got it ported over to 1.7, changed it around to be an embedded system, and hooked it up with the new build system.

There are only very minor changes necessary to the core engine to support Python scripting. It is pretty powerful stuff... the docs are a bit sparse, but if you head over to MMOWorkshop.com you can browse through a lot of examples...
BTW, this is a newer system than what was used for Minions of Mirth. It is actually quite a bit cleaner... so, when in doubt check out the included example.py :)
You can snag PyTorque for TGEA 1.7 HERE
This was a pretty quick package job... so, post here with any glaring issues.
-Prairie Games, Inc
included with TGEA 1.7
I also wanted to have a look at some embedded scripting... and so dusted off PyTorque, got it ported over to 1.7, changed it around to be an embedded system, and hooked it up with the new build system.

There are only very minor changes necessary to the core engine to support Python scripting. It is pretty powerful stuff... the docs are a bit sparse, but if you head over to MMOWorkshop.com you can browse through a lot of examples...
BTW, this is a newer system than what was used for Minions of Mirth. It is actually quite a bit cleaner... so, when in doubt check out the included example.py :)
You can snag PyTorque for TGEA 1.7 HERE
This was a pretty quick package job... so, post here with any glaring issues.
-Prairie Games, Inc
#62
09/16/2008 (10:55 am)
Main.py is the entry point for python script.
#63
Thanks for the reply and the response.. Just to point out, I don't anyone would have pull that information out of the usefull information that is displayed here.. Thanks a bunch!
09/16/2008 (12:24 pm)
HEy, LuisThanks for the reply and the response.. Just to point out, I don't anyone would have pull that information out of the usefull information that is displayed here.. Thanks a bunch!
#64
But, I was wondering if its still require to place the _init_.py with the directories as you would before when attempting to import the .py files.
TGEA
game folder
--main.cs and main.py; appear to be both execute since now the pcy files appear
I've add Framework folder
which is going to be divided up into other folders for orginzation reasons so, do we still need to provided the _init_.py files..
I take that back.. I do not see a main.py in my directory but main.cs is there but the .py files that do exist for testing do get compile into .pcy files.
10/03/2008 (12:40 pm)
Ok, pytoque is embeded.. Thanks for the last post Luis..But, I was wondering if its still require to place the _init_.py with the directories as you would before when attempting to import the .py files.
TGEA
game folder
--main.cs and main.py; appear to be both execute since now the pcy files appear
I've add Framework folder
which is going to be divided up into other folders for orginzation reasons so, do we still need to provided the _init_.py files..
I take that back.. I do not see a main.py in my directory but main.cs is there but the .py files that do exist for testing do get compile into .pcy files.
#65
10/10/2008 (2:16 pm)
Weeee.. weeks later.. Does the embedded version of python in TGEA 1.7.1 still need need to be exposed to the "Simobjects" and "Datablock" or can you just envoke the code on the fly ?
#66
11/29/2008 (3:35 pm)
Sorry, I rarely check the forums here ;-(. The TGEA source code along with delta changes was released on the mmoworkshop website awhile ago. It is using the same method of working with Torque as it has in the past. It still needs a bit of work, but it is out there. The TGE source was finally released too.
#67
You can snag PyTorque for TGEA 1.7 HERE
06/23/2009 (4:58 pm)
Does anyone have the .zip file for the pytoque ? The url above is brokenYou can snag PyTorque for TGEA 1.7 HERE
#68
Has anyone else ran into this issue?
10/06/2009 (8:51 pm)
I have a question. I was able to get PyTorque to run in TGEA 1.8.1 and compiles fine. When I run the game though it is like speed hack is enabled and everything on the screen is moving super fast. If I remove PyTorque and just compile as normal everything is fine.Has anyone else ran into this issue?
#69
10/06/2009 (8:59 pm)
Probably the main loop. We had to merge in some of the code in T3D to get rid of the same issue.
#70
10/07/2009 (5:43 pm)
download link broken... :c
#71
10/28/2009 (2:47 am)
I have another question regarding PyTorque. I was wondering if it is possible to execute python scripts from within guis or cs files?
#72
*edit* never mind... I see how it works. I'm not done getting it running yet :)
10/28/2009 (4:21 pm)
I got Luis' code from page 3 to compile clean under T3D, but I'm not sure how to test to see that it's working.*edit* never mind... I see how it works. I'm not done getting it running yet :)
#73
01/04/2010 (2:37 pm)
I've been trying to get to the PyTGE download for some weeks now, but MMOworkshop has been down. I guess I need to keep better backups.
#74
Nevermind, I really should look through the thread more fully, hehe.
03/15/2010 (11:40 am)
Hmmm, so is it possible to obtain a copy of PyTEG anymore?Nevermind, I really should look through the thread more fully, hehe.
#75
I downloaded the pytorque files and followed the instructions given in the readme file. I went all the through, until I got to step 6. Test.
This part was never really explained in any detail. I read that one person just dropped it into T3d and it worked. We are trying to get it working in T3D.
Could someone please explain how you test it.
09/11/2011 (8:16 pm)
I know this thread is old and I thought about starting a new one and referencing this thread, but there is a lot of important information given out here, that may help answer my question. I downloaded the pytorque files and followed the instructions given in the readme file. I went all the through, until I got to step 6. Test.
This part was never really explained in any detail. I read that one person just dropped it into T3d and it worked. We are trying to get it working in T3D.
Could someone please explain how you test it.
Torque 3D Owner Keith Mc Dowell JR
KYPCTECH, LLC
The example that are provided here: Do not reflect an embedded version, since they are attempting to import python.
#--- Torque Python Module Test ---
import pytorque
import sys
import pytorqueprint "------------------------------PYTORQUE TEST-----------------------------------"
--- Have no problems rebuilding TEGA 1.7.1 Python -- but haven't figure out who to start executing the .py files from the game.exe file.