Game Development Community

Datablock not loading on engine startup

by Matthew Zulawski · in Technical Issues · 07/09/2006 (3:48 pm) · 1 replies

Working through the Whack-a-Mole tutorials, and I've hit the part where I'm asked to add a datablock to the spawnPoints.cs file. In this case, the datablock is not loading when the editor loads. When I click on the pull-down, there is just an option for "none". If I run the program once, the datablock appears... this is understandable as it is executed in the game.cs file.

I don't recall having this problem in the other tutorials. Prior to posting the code, is this a common issue that someone may have the answer to?

summary:
1. load engine: no datablock
2. run game
3. stop game: datablock is populated

Thanks in advance,
-Matt Zulawski

#1
07/09/2006 (6:22 pm)
Another tutorial presented additional information:

Quote:We put the exec statement for our config datablock first because there may be instances when we want our
config datablocks to load before any of our game scripts. So, though this will not apply in this particular instance,
it is a good habit to get into. This should be all we need to test out our config datablocks.

Re-looking at the tutorial work that I've done so far, none of the tutorials take this into consideration. I don't know why I haven't caught onto this previously, as other datablocks seemed to populated the pulldown when the game editor loaded.

So the question is now this: If I want a datablock to be available, at load time, in the editor, do I have to specifically load the datablock before game.cs, or define it in main.cs?