Help me ! howto wheeledvehicle + materials
by Richard Holmes · in Torque Game Engine · 07/31/2008 (5:21 am) · 2 replies
I am trying to make a simple car game in torque, but i'm only using Torque scripting for about a week now. I have the myCar.dts exported from 3dsmax, and it has eye, cam, hub0,1,2,3. Can smbd please give me an example regarding how to implement a wheeledvehicle?
..Cuz i searched the forums, with no luck so far. I eventually replaced shapeName="blahblahblah..." with shapeName="myshape" in a "new TSStatic (){...}" within the init.cs of an example. It kinda worked but i couldn't see any of the materials, only the warnMat.png "NoMaterial!" :(
I tried replacing the Elf.dts with myCar.dts in Elf.cs and various other places hoping to see the car instead of the pretty elf. Now I am the proud owner of an invisible unit / hovering rocket launcher.
Thus a new problem has arosen : how do you set the materials?? or shaders??? :)
Thanks
..Cuz i searched the forums, with no luck so far. I eventually replaced shapeName="blahblahblah..." with shapeName="myshape" in a "new TSStatic (){...}" within the init.cs of an example. It kinda worked but i couldn't see any of the materials, only the warnMat.png "NoMaterial!" :(
I tried replacing the Elf.dts with myCar.dts in Elf.cs and various other places hoping to see the car instead of the pretty elf. Now I am the proud owner of an invisible unit / hovering rocket launcher.
Thus a new problem has arosen : how do you set the materials?? or shaders??? :)
Thanks
#2
for (%i = 0; %i < 4; %i++) {
%obj.setWheelTire(%i,NewCarTire);
%obj.setWheelSpring(%i,DefaultCarSpring);
%obj.setWheelPowered(%i,false);
}
I cannot see the wheels. If i use (DefaultCarTire) it works.
What did i miss, cuz i checked everything :(
thanks Scott
08/08/2008 (12:53 am)
I managed to texture my car. I created a wheel for it, added a NewWheelDatablock, made its materials.cs. In the OnAdd function in car.cs i added thisfor (%i = 0; %i < 4; %i++) {
%obj.setWheelTire(%i,NewCarTire);
%obj.setWheelSpring(%i,DefaultCarSpring);
%obj.setWheelPowered(%i,false);
}
I cannot see the wheels. If i use (DefaultCarTire) it works.
What did i miss, cuz i checked everything :(
thanks Scott
Associate Scott Burns
GG Alumni
Also, just for future reference, TGEA questions are better suited in the TGEA forums. You may need to edit your forum subscriptions to see them, which can be through the edit subscriptions link on the main forum page in the upper left corner.