Game Development Community

Creating a datablock from script

by CodingChris · in Torque Game Engine · 12/26/2007 (12:04 pm) · 2 replies

Hi,
I simple want to create a datablock from script. My code:
function setShape(%shape)
{
datablock(MyCar : DefaultCar)
{
shapefile = "Game/data/shapes/car/"@%shape@".dts";
};
}
What's wrong here?

#1
12/26/2007 (12:47 pm)
It's actually not creating a datablock, but simply stating one. What are you trying to do with that function? Are you trying to create the datablock itself, like a statement that can be serialized into a file later on or evaluated by the scripting engine, or are you trying to create the MyCar? The two choices get handled very differently.
#2
12/26/2007 (2:43 pm)
Thanks, silly misstake! I fixed it on my own now. I was trying to create the datablock.