Game Development Community

Getting a filename using objectBuilderGUI

by Steen Lund · in Torque Game Engine · 01/12/2006 (2:39 pm) · 0 replies

Hi,

I have created a new object class, based on a tutorial I found here.

I have added the nessecary field to EditorGui.cs and objectBuilderGui.gui to make the object appear in the World Editor Creator list:

Somewhere in EditorGui.cs:
%Environment_Item[12] = "CityBlock";

In objectBuilderGui.gui
function ObjectBuilderGui::buildCityBlock(%this)
{
   %this.className = "CityBlock";
   %this.addField("cityFile", "TypeFile", "CityBlock file name",  "*.cqt");
   %this.process();
}

When I click on the CityBlock in the World Editor Creator a nice dialog appears, and I can press a button to select the file I wish to load.

Problem is just that the filename is not set correctly when the engine calls CityBlock::onAdd().

I then try to add an AudioEmitter using the World Editor Creator, and this has the same problem, the selected file is not loaded.

Is this a bug or do I need to do something in order to get the selected file name.

I am using Torque 1.4.

Regards
Steen

About the author

Recent Threads