eyeoffset to handoffset.
by Gagan · in Torque Game Engine · 12/04/2009 (1:30 pm) · 7 replies
Hi ..I am making Bowling game using scrape example game of TGE 1.5.2 (starter.fps) in this i have placed ball.dts at place of projectile.dts ..whorking well but i have one thing in my mind that about eyeoffset and mountPoint. Which is as following
// Crossbow image which does all the work. Images do not normally exist in
// the world, they can only be mounted on ShapeBase objects.
datablock ShapeBaseImageData(CrossbowImage)
{
// Basic Item properties
shapeFile = "~/data/shapes/crossbow/weapon.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
eyeOffset = "0.1 0.4 -0.6";
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = true;
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = Crossbow;
ammo = CrossbowAmmo;
projectile = CrossbowProjectile;
projectileType = Projectile;
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Preactivate";
stateTransitionOnLoaded[0] = "Activate";
stateTransitionOnNoAmmo[0] = "NoAmmo";
// Activating the gun. Called when the weapon is first
// mounted and there is ammo.
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 0.6;
stateSequence[1] = "Activate";
// Ready to fire, just waiting for the trigger
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = CrossbowFireSound;
// Play the relead animation, and transition into
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.8;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateEjectShell[4] = true;
stateSound[4] = CrossbowReloadSound;
// No ammo in the weapon, just idle until something
// shows up. Play the dry fire sound if the trigger is
// pulled.
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
// No ammo dry fire
stateName[6] = "DryFire";
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateSound[6] = CrossbowFireEmptySound;
};
Can u suggest me how my player can throw ball by using their hand .wht willbe the eyeoffset ....please give some idea so i can do my work fast .
// Crossbow image which does all the work. Images do not normally exist in
// the world, they can only be mounted on ShapeBase objects.
datablock ShapeBaseImageData(CrossbowImage)
{
// Basic Item properties
shapeFile = "~/data/shapes/crossbow/weapon.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
eyeOffset = "0.1 0.4 -0.6";
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = true;
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = Crossbow;
ammo = CrossbowAmmo;
projectile = CrossbowProjectile;
projectileType = Projectile;
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Preactivate";
stateTransitionOnLoaded[0] = "Activate";
stateTransitionOnNoAmmo[0] = "NoAmmo";
// Activating the gun. Called when the weapon is first
// mounted and there is ammo.
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 0.6;
stateSequence[1] = "Activate";
// Ready to fire, just waiting for the trigger
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = CrossbowFireSound;
// Play the relead animation, and transition into
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.8;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateEjectShell[4] = true;
stateSound[4] = CrossbowReloadSound;
// No ammo in the weapon, just idle until something
// shows up. Play the dry fire sound if the trigger is
// pulled.
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
// No ammo dry fire
stateName[6] = "DryFire";
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateSound[6] = CrossbowFireEmptySound;
};
Can u suggest me how my player can throw ball by using their hand .wht willbe the eyeoffset ....please give some idea so i can do my work fast .
#2
Actually I am trying to make bowling game ... now i think u can understand what i am trying to do ...I also wants to replace weapon and want to place ball and throw to pins..i need some more help dude
12/04/2009 (7:56 pm)
Hi Dude ,Thx for help ...it seem s working..Actually I am trying to make bowling game ... now i think u can understand what i am trying to do ...I also wants to replace weapon and want to place ball and throw to pins..i need some more help dude
#3
12/04/2009 (8:01 pm)
Is the player's hand visible after he rolls the ball? If not I'd look into making a bowling ball as a "weapon", and just spawn another bowling ball as the projectile.
#4
12/04/2009 (8:20 pm)
to simulate a ball and pins you could use the rigidShape class. use the search function at the top of the page and look up rigidShape to see if that will work for you
#5
i am also thinking like u but i am not understanding what change i do for that ... even i am trying to do that from last 2 days ... its not happening as i want .
can u give me some hint or where i do customization the code .
12/04/2009 (9:07 pm)
Hii Rich,i am also thinking like u but i am not understanding what change i do for that ... even i am trying to do that from last 2 days ... its not happening as i want .
can u give me some hint or where i do customization the code .
#6
you r really rocking man.In the beginning i was testing the rigidshape class to throw the ball by player .. But i don't know what was happening ...i follow same instruction as given but my player didn't moved the ball a single inch ... and also one thing i noticed that . dso file is not generating while running the test application. can u tell how and y it is happening .
thank u so much ....
12/04/2009 (9:16 pm)
Hii Scooby,you r really rocking man.In the beginning i was testing the rigidshape class to throw the ball by player .. But i don't know what was happening ...i follow same instruction as given but my player didn't moved the ball a single inch ... and also one thing i noticed that . dso file is not generating while running the test application. can u tell how and y it is happening .
thank u so much ....
#7
As far as replacing the weapon with a ball, you just make a ball 3D model with a mount point where the holes are. It's gonna take some trial and error to get it to hold and look right. You may end up having to model a hand onto the ball and remove the hand from the player model to get it to look it's best.
12/04/2009 (9:39 pm)
DSOs don't generate if they are not being execed, check to make sure you have an exec("./scriptname.cs"); somewhere that is execing your .cs file.As far as replacing the weapon with a ball, you just make a ball 3D model with a mount point where the holes are. It's gonna take some trial and error to get it to hold and look right. You may end up having to model a hand onto the ball and remove the hand from the player model to get it to look it's best.
Torque 3D Owner Scooby Brown