Right Click triggering MouseFire Help
by Zorro Davis · in Torque Game Engine · 03/02/2014 (9:46 am) · 0 replies
I wanted to give a weapon a double tap feature so you can use Right Click and left click to fire, which would allow players to fire faster depending on how fast they click both mouse buttons (sort of like simulating a speed-ball paintball gun by using 2 fingers to fire faster)
I am using this function to simulate mouse fire but the problem is when I right click then left click or visa versa there is a little pause in between the fire. Also I cant use the reload function if my last fire was a Right click.
heres the code I used:
package EmpireINMiniDTap
{
function Armor::onTrigger(%this, %obj, %slot, %val)
{
%client = %obj.client;
if(%slot $= 4 && %obj.isImageMounted(EmpireINMiniImage) && %obj.toolAmmo[%obj.currTool] != 0)
{
$mvTriggerCount0++;
}
Parent::onTrigger(%this, %obj, %slot, %val);
}
};
activatePackage(EmpireINMiniDTap);
I also attempted this code (same result of corse):
if(%slot $= 4 && %obj.isImageMounted(EmpireINMiniImage) && %obj.toolAmmo[%obj.currTool] != 0)
{
mousefire(%val);
}
I know this method might not be the best approach to the idea but I'm still learning coding.
If anyone has played Greg Hastings Paintball 2, you can see how dual triggers are implemented. Im trying to get a simular function of the dual triggers.
Video Reference torward idea:
http://youtu.be/AdI-9YYwVqY?t=2m44s
I am using this function to simulate mouse fire but the problem is when I right click then left click or visa versa there is a little pause in between the fire. Also I cant use the reload function if my last fire was a Right click.
heres the code I used:
package EmpireINMiniDTap
{
function Armor::onTrigger(%this, %obj, %slot, %val)
{
%client = %obj.client;
if(%slot $= 4 && %obj.isImageMounted(EmpireINMiniImage) && %obj.toolAmmo[%obj.currTool] != 0)
{
$mvTriggerCount0++;
}
Parent::onTrigger(%this, %obj, %slot, %val);
}
};
activatePackage(EmpireINMiniDTap);
I also attempted this code (same result of corse):
if(%slot $= 4 && %obj.isImageMounted(EmpireINMiniImage) && %obj.toolAmmo[%obj.currTool] != 0)
{
mousefire(%val);
}
I know this method might not be the best approach to the idea but I'm still learning coding.
If anyone has played Greg Hastings Paintball 2, you can see how dual triggers are implemented. Im trying to get a simular function of the dual triggers.
Video Reference torward idea:
http://youtu.be/AdI-9YYwVqY?t=2m44s
About the author