Setting shapes on creation
by Matt "Mr. Pig" Razza · in Torque Game Engine · 01/05/2006 (1:31 pm) · 7 replies
I was wondering if there is any way to set the shape of an object (being projectile or other) when the object is created without using datablocks?
I'd rather not create a datablock for each of my 50 shapes. I am for weapons but other veturse have all the shapes with the same settings so I'd rather create one datablock and just edit the shape when the new() function is called.
If this is not possible how would I go about implamenting it.
I'd rather not create a datablock for each of my 50 shapes. I am for weapons but other veturse have all the shapes with the same settings so I'd rather create one datablock and just edit the shape when the new() function is called.
If this is not possible how would I go about implamenting it.
About the author
#3
Did not work. It looks like it should be that way though. - Little help? It didn't take any of the values from weaponTossProjectile.
01/06/2006 (10:00 pm)
datablock ProjectileData(ak47ShapeToss : weaponTossProjectile)
{
projectileShapeName = "~/data/shapes/weapons/ak47/ak47.dts";
};Did not work. It looks like it should be that way though. - Little help? It didn't take any of the values from weaponTossProjectile.
#4
01/08/2006 (1:23 am)
Is weaponTossProjectile defined BEFORE that one?
#5
01/08/2006 (10:03 am)
Oh. Not sure. It's definded in a different file, so should I put the exec call of that file before the one with ak47ShapeToss?
#6
01/08/2006 (10:06 am)
That did it. Thanks!
#7
01/08/2006 (4:52 pm)
Cool, glad it worked for you!
Torque Owner Kirby Webber
Define ONE datablock with all of the data and behavioral ifnormation you want it to have.
datablock projectile1 { shapefile = "my/path/to/file.dts"; ... etc. }Then, for each subsequent datablock, you can only list the changes like so:
datablock (prohectile2 : projectile1) { shapefile = "my/path/to/otherFile.dts"; }If I follow this correctly (and I hope I do because I use this kind of syntax in my own project, you're basically making a copy of the original datablock and only the fields you specify get changed.
Also, the code example above was generate from memory, so the syntax might not be exact. =\