Game Development Community

Identifying Data per TorqueScript

by Chris Groot · in Torque 3D Professional · 04/25/2011 (3:39 pm) · 1 replies

I have an odd/interesting situation that I find myself faced with and thought I would pose it to you guys and see if any of you had any ideas of how I might go about solving my issue.

My game has a somewhat complex GUI with many different pages and different interactions, and I am looking to create an automated testing procedure to go about testing my GUI. I would like to have a script file for each GUI page that contains all possible interactions on that page and the functions/commands associated with that interaction. The script file will then be able interact with the current page and the proper callback functions will occur. The issue I run into is, I'm not sure how to delineate on a per script basis. So I want to be able to grab all the main menu interactions and run through them when I'm on the main menu for example. As far as I can tell, when you execute a script file within the initial application load up the data from scripts gets thrown together into the "scripting pool" and there is no way to know which function/variable comes from which file at run time.

So I am wondering if there is a way to find out where a variable/function originally came from or a way to specify that when creating or loading the script. I would like to do it in such a fashion where I create a system that will take any page and find its interactions and run them without me having to explicitly script every pages interactions, allowing for me to easily create a sequential interaction testing method or a random interaction testing method.

Any ideas or suggestions are welcome.

#1
04/26/2011 (9:24 am)
I found a way to do what I need to do through the use of packages. I use one package per GUI page to be tested. I maintain a master list of valid interaction commands adding commands contained within the currently activated package and then swap packages depending on which page I'm on. A similar concept to function pointers.