Armor::onMount
by AIDan · in Torque Game Engine · 05/30/2002 (8:17 am) · 6 replies
Hi
%obj.client.setObjectActiveImage(%vehicle, 2);
The function setObjectActiveImage is missed.
I cannot find any similar function for clients.
Anyone can help me to fix this?
The camera is not mounted to the vehicle. I searched the createPlayer function but could not find any useful, though.
greetings
Daniel
%obj.client.setObjectActiveImage(%vehicle, 2);
The function setObjectActiveImage is missed.
I cannot find any similar function for clients.
Anyone can help me to fix this?
The camera is not mounted to the vehicle. I searched the createPlayer function but could not find any useful, though.
greetings
Daniel
About the author
#2
05/30/2002 (8:50 am)
I want to enter a vehicle: Armor::onMount.
#3
05/30/2002 (8:59 am)
As I remember, there were a few things you had to do in the vehicle and player code to get mounting to work. Unfortunately, I had a harddrive melt down so I'm without all that work [and the resource I did on it] and just haven't gotten to that point in reconstructing things. If you haven't figured it out by the time I get to it, I'll go ahead and post the resource.
#4
Good Luck!
05/30/2002 (9:52 am)
Well yes there were some mods that needed to be done to the player class, I don't remember them either, but if you search a bit, there are a couple of resources about this one.Good Luck!
#5
That is not the best solution, because all player info (health, inventory, etc.) are lost and when dismounting the vehicle, you have to create a new player.
greetings
Daniel
05/30/2002 (12:31 pm)
I solved the problem by removing the player and putting in the vehicle instead.%client.player.delete(); %client.player= %vehicle; %client.camera.setTransform(%vehicle.getEyeTransform()); %client.setControlObject(%vehicle);
That is not the best solution, because all player info (health, inventory, etc.) are lost and when dismounting the vehicle, you have to create a new player.
greetings
Daniel
#6
The hiding causes the gam to crash, but we will fix this.
greetings
Daniel
05/30/2002 (1:00 pm)
This is much better:function Armor::onMount(%this,%obj,%vehicle,%node)
{
if(%node ==0)
{
%client= %obj.client;
%obj.setTransform("0 0 0 0 0 1 0");
//%obj.setActionThread(%vehicle.getDatablock().mountPose[%node],true,true);
%obj.hide(true);
%obj.lastWeapon = %obj.getMountedImage($WeaponSlot);
%obj.unmountImage($WeaponSlot);
%client.camera.setTransform(%vehicle.getEyeTransform());
%client.setControlObject(%vehicle);
}
}The hiding causes the gam to crash, but we will fix this.
greetings
Daniel
Torque 3D Owner Xavier "eXoDuS" Amado
Default Studio Name