Game Development Community

Bug in Config Datablocks?

by Doug Linley · in Torque Game Builder · 06/25/2006 (6:09 pm) · 2 replies

I'm doing the Whack A Mole tutorial. I notice that everytime I leave the project and go back or quit out of TGB Pro and reopen, all of my respawn points have lost their datablock config, and they have to be reassigned every time. Any tips on fixing this?

#1
06/25/2006 (7:25 pm)
I am just beginning to play with TGB as well and ran into the same problem.
The problem exists in the exec* functions are loaded inside the startgame function.
This causes the supporting scripts (mole.cs, respawnPoint.cs and moleLevel.cs to not actually load until the game is run.

Move the exec functions to the top of game.cs outside of any function and this will fix the problem you are experiencing.

//---------------------------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------

	//include all our scripts
  	exec("./mole.cs");
	exec("./respawnPoint.cs");
	exec("./moleLevel.cs");
	
//---------------------------------------------------------------------------------------------
// startGame
// All game logic should be set up here. This will be called by the level builder when you
// select "Run Game" or by the startup process of your game to load the first level.
//---------------------------------------------------------------------------------------------
function startGame(%level)
{

	//include all our scripts
//      exec("./mole.cs");
//	exec("./respawnPoint.cs");
//	exec("./moleLevel.cs");

// Set The GUI.


hope this helps,
Guy Lewis
#2
06/26/2006 (10:34 am)
Thanks a ton Guy! I'll use this tonight and finsih up that tutorial!