Game Development Community

Python instead of TorqueScript?

by Michael Dawson · in Torque Game Builder · 03/01/2009 (11:43 am) · 4 replies

Hi, all. Is it possible to use Python instead of TroqueScript with TGB? I've found PyTorque over at www.mmoworkshop.com, but it looks like it's for just Torque Game Engine and Torque Game Engine Advanced. Anyone ever used Python with TGB?

Thanks for any info.

#1
03/01/2009 (4:40 pm)
No but I am using Lua with TGB :) I'm sure you can use python in the same fashion.
#2
03/01/2009 (6:30 pm)
Joe... there's significant interest in my studio for doing that... Did you integrate lua yourself, or did you use a resource?

EDIT...
Just noticed another post you made in 2006 with your Lua integration. So it appears you're using it in parallel to TorqueScript?

Are you only using TorqueScript as a skeletal structure (calling existing default scripts, etc, and using the behavior system as written in TScript?), or do you have a more heavily integrated system than the one posted here: www.garagegames.com/community/resources/view/9665
#3
03/02/2009 (8:37 am)
Michael,
I use it as a "bridge". There are Lua functions to run Torquescript code and scripts, and Torque console functions to run Lua code and scripts. It's enough for what I needed. Maybe you can use tolua or something if you need more. However Torque is big and complex so I chose the most simple approach possible. It allowed me to reuse a ton of Lua code I had previously wrote for another project. I also make use of Lua libraries such as pluto, luaJIT, etc which are sweet. You can do anything Lua can do using the resource I posted. Lua has other advantages over Torquescript such as coroutines, which my game object system depends heavily on.

At this point all my game logic code is in Lua. I still use the builder to make levels, menus, and create game objects. I use Torquescript for all the engine tasks and events, many of which also call Lua scripts.

Some complain that it's a crap way to have done it but I've had no performance issues so far, and there's a lot going on in my little strategy/rpg game ;)
#4
03/02/2009 (9:14 pm)
Joe, thanks for the info on you use of Lua. That is cool.

Still curious if anyone has done something with Python.