Game Development Community

Me Getting Started

by Jamie McGlynn · in Torque 3D Beginner · 02/01/2013 (3:12 am) · 6 replies

Hi guys, this is my first thread on this forum so I apologise if I talk a load of ol' rubbish in some of my wording.

This is what is in my "main.cs" file invoked by the T3D engine:
$productName="My Game";
$productCopyright="(c) 2013 "@$productName@" Software Foundation";

//Initialize Common Components
	new GuiControlProfile(GuiDefaultProfile);
	new GuiControlProfile(GuiToolTipProfile);

//Initialize the game client main window
	new GuiCanvas(GameWindow);
	GameWindow.setWindowTitle($productName);
What I don't understand is, that the application keeps on crashing without any errors, all I get is "mygame.exe has stopped working" after the window displays for around 3 seconds.

What I would like to do first is just to get a basic image displayed in the window using minimal code (without overcomplicating things) so that I can get some level of bearings on the foundational components of Torque 3D. The FPS kit contains way too much for me, and I prefer to build from scratch as doing it this way allows me to map all the parts I code more easily.

About the author

Recent Threads

  • Now Getting on to 3D

  • #1
    02/01/2013 (8:40 am)
    Here is a link to a comment on ScriptT3D. It contains a script (in Python) that does a bare bones window with simple graphics. You should be able to pick out the Torque Script calls from that to make a very bare bones startup code.

    Edit:
    Sorry, here is the link: www.garagegames.com/community/resources/view/21706/1#comment-184906
    #2
    02/01/2013 (9:04 am)
    Make sure you initialize a render manager and light manager as well -- your example doesn't indicate that you have. T3D requires them along with the canvas.
    #3
    02/01/2013 (10:58 am)
    I checked lines 45-66 of that post Frank, and this is all that I can make of it in comparison to what i've got and not got in my "main.cs" file (Python -> TScript):
    new RenderPassManager(DiffuseRenderPassManager);
    I'm sincerely sorry Frank, but my understanding of Python is a real stinker.

    Michael, I would be grateful if you could expand on that, as that really doesn't say anything at all. Please, keep in mind I'm not as knowledgeable as you with Torque.
    #4
    02/01/2013 (11:19 am)
    Hey Jamie and welcome to the forums!
    If you are getting an error with no error report you should try debugging the application with Visual Studio, that usually gives you some better debug information!
    #5
    02/01/2013 (12:00 pm)
    Here, let me see if I can translate:
    new GuiControlProfile(GuiDefaultProfile);
    new GuiControlProfile(GuiToolTipProfile);
    new GuiCanvas(Canvas);
    Canvas.setWindowTitle("ScriptT3D");
    new RenderPassManager(DiffuseRenderPassManager);
    setLightManager("Basic Lighting");
    activateDirectInput();
    GlobalActionMap.bindCmd("keyboard", "escape", "quit();", "");
    new GuiControlProfile(GuiTextProfile)
    {
      fontSize = 48;  
      fontColor = "50 50 50";  
      justify = "center";
    };
    %txt = new GuiTextCtrl()
    {
      profile = GuiTextProfile;
      position = "200 100";
      extent = "200 100"; 
      horizSizing = "center";
      verSizing = "center";  
      text = "Hello ScriptT3D!!";
    };
    Canvas.setContent(%txt);
    I will test this out.

    Edit:
    Found one semicolon missing, fixed.

    Also, this code was originally written by Guy Allard. He is the genius behind this.
    #6
    02/04/2013 (7:47 am)
    Yep, it's staying up now. Thanks Frank.