Game Development Community

B4 - Endless loop in endProject()

by Tom Spilman · in Torque Game Builder · 05/23/2006 (11:35 pm) · 2 replies

I was starting T2D and it got stuck dumping the following into the console:

resources/myResourceTest/resourceDatabase.cs (0): Unable to find function GuiFormManager::BroadcastContentMessage
common/gameScripts/projectManagement.cs (160): Unable to find object: '1212' attempting to call function 'getCount'
common/gameScripts/projectManagement.cs (162): Unable to find object: '1212' attempting to call function 'getObject'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'delete'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'getCount'
common/gameScripts/projectManagement.cs (162): Unable to find object: '1212' attempting to call function 'getObject'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'delete'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'getCount'
common/gameScripts/projectManagement.cs (162): Unable to find object: '1212' attempting to call function 'getObject'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'delete'
common/gameScripts/projectManagement.cs (163): Unable to find object: '1212' attempting to call function 'getCount'

Line 162 in projectManagement.cs is this loop:

// Kill all the datablocks so subsequent projects don't have access to them.
   %dbs = getT2DDatablockSet();
   while (%dbs.getCount() > $datablockDeleteIndex)
   {
      %db = %dbs.getObject($datablockDeleteIndex);
      %db.delete();
   }

Seems like you should add an additional test to the loop:

while (isObject(%dbs) && %dbs.getCount() > $datablockDeleteIndex)

You may even want to protect %db as well.

Not sure what the original error message that seems to have triggered this was about.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
05/24/2006 (12:02 am)
Ahhh... the reason GuiFormManager::BroadcastContentMessage() wasn't found was because i launched the game with -notools.

Can i not use resources if i don't have the tools executed?

What happens when you ship your game?

Is there a guide for how resources are supposed to be used thru out the life cycle of the product?
#2
05/28/2006 (6:04 am)
I just ran into this same problem. It can be recreated like this:

1. Start a new project.
2. Import one of the resources available.
3. Drag in a sprite from the resource and save the level.
4. In the games/main.cs file change $runWithEditors to false
5. In the initializeProject function change the last line (startGame("..."); to the correct level name you saved, change ~ to your project name.
6. Run and quit(); in the console - the T2D.exe will lock up in this endless loop.

I noticed the endless loop doesn't happen if you create a new image map and add something that doesn't belong to the resources (I brought the logoblack.png in as a sprite since every project already has it).