Game Development Community

Player model path error, game crashes.

by Chris "Dark" Evans · in Torque Game Engine · 12/15/2001 (1:35 pm) · 5 replies

This one is weird. I don't understand it.

I'm organizing my game with different directories. In server/scripts, I have a subdirectory named weapons with all the weapons in there. I also have a subdirectory named players with the different players in there.

In server/scripts/player.cs I have the base player datablock. The players in server/scripts/players/human.cs (for the human race) are inheriting the base player datablock. Human.cs includes:

datablock PlayerData(HumanMaleCharacter : DefaultCharacter)
{
//	shapeFile 		= "game/data/shapes/players/human_m/human_m.dts";
//	debrisShapeName 	= "game/data/shapes/players/human_m/human_m_debris.dts";

	shapeFile 		= "game/data/shapes/player/player.dts";
	debrisShapeName 	= "game/data/shapes/player/debris_player.dts";
};

datablock PlayerData(HumanFemaleCharacter : DefaultCharacter)
{
//	shapeFile 		= "game/data/shapes/players/human_f/human_f.dts";
//	debrisShapeName 	= "game/data/shapes/players/human_f/human_f_debris.dts";

	shapeFile 		= "game/data/shapes/player/player.dts";
	debrisShapeName 	= "game/data/shapes/player/debris_player.dts";
};

I'd also like to organize the shapes the same way. I tried copying the default player into shapes/players/human_m, and renamed it to human_m. I did the same thing for the female player. This is temporary until I get new models.

When I try to point the player datablock there it crashes when it gets executed. Why? You can see the commented lines, the file locations are correct, and everything *should* work.

I think it's the inheritance that's screwing it up. In the base player datablock (DefaultCharacter) the shape is set to data/shapes/player/player.dts. I don't think it likes it when I try to change the shape in the other datablocks, or am I wrong?


Dark

#1
12/16/2001 (12:10 am)
I think it might have something to do with renaming the animations. Anyone know?


Dark
#2
12/16/2001 (2:46 am)
What a moron :)

It seems my problem was in the TSShapeConstructor() datablock, declaired in player.cs in the player shape directory.

I tried using two models with the same datablock name, PlayerDts.

I changed one to HumanFemaleCharacterDts and the other to HumanMaleCharacterDts.

Bah, sorry for the incredibly idiotic posts.


Dark
#3
12/16/2001 (5:59 am)
Please continue with the "incredibly idiotic posts" :^} I am just starting to get multiple players in my game and you saved me several hours of hunting for things to change!!!
#4
07/23/2002 (6:41 pm)
I second that last posting Chris! This thread helped me heaps! I was stuck where you were, my knowledge of torque scripting is still in the beginner phase, I wouldn't have thought about changing that. Saved me hours too!
#5
11/17/2006 (4:49 am)
And I most certainly third David3 Dougher's post