Game Development Community

dev|Pro Game Development Curriculum

How to to expand the Scripting Language within C++ Torque Engine

by Dan - · 01/23/2004 (10:59 am) · 4 comments

Download Code File

This resource is mostly some documented C++ code that states how to create your own C++ functions that expand the functions available via the console and via any of the script files.

Read the comments within the attached consoleAddedCommands.cc for the real information. Also remember, the functions within the .cc file are to explain how to declare console functions, pass parameters and return parameters. Most people probally will not find the useful as additions to the engine.

To add the consoleAddedCommands.cc to your Torque Project and see how it all works:
1 Take the attached consoleAddedCommands.cc code and save it into the "engine\console" directory. This is a great directory to look at. If you have a script function you like to use, you can find the C++ code behind it!
2 Add the "consoleAddedCommands.cc" to your workspace or project.
3 Build a new exe.
4 Run the new exe.
5 In the game open the console window by using the "~" key.
6 Execute any of the newly added functions. I.E.
echo(returnNumberOfParametersPassed("1","2","3","4"));


How simple is that?
If its not post here or feel free to e-mail me.
dreamer_of_dreamers2000@yahoo.com

About the author

Recent Blogs


#1
01/25/2004 (10:01 am)
Thanks for the example - I think this is a very useful thing to know!
#2
01/29/2004 (1:00 pm)
That'll come in handy, thanks!
#3
10/18/2004 (5:34 am)
Just looked it over. Exactly what I was looking for! Excellent resource for anyone new to C !!
#4
10/18/2004 (1:39 pm)
Hey Dan, great resource. :)