Game Development Community

Whack a Mole datablock error

by Richard Van Stone · in Torque Game Builder · 08/01/2006 (10:25 am) · 1 replies

I don't know if I've entered in something incorrectly but I'm not sure what's going on here.

I created a datablock for the moles and then went into TGB and set the datablock to the appropriate selection, then went back and imported 8 mole hills to set them as spawnpoints. I then saved my project and reloaded. When I did this the molehills were now half the size I originally set them, no longer connected to the spawnpoint datablock which was odd. In addition to that on reload the datablock does not exist anylonger. However, if I hit f5 to start the game, then stop it the datablock exists. Has anyone encountered this problem before?

Rich

*note* Crosspost since I posted in the public forums :D

#1
08/01/2006 (12:09 pm)
Rich, Load your respawnPoint.cs outside of your functions. Otherwise the editor won't execute it and it won't be read to apply to your hills. See example below (game.cs).

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

exec("./respawnPoint.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)
{
   $levelForRestart = %level;
   
   //exec game scripts
   exec("./mole.cs");
   exec("./moleLevel.cs");

.........