Author Topic: T811AR Syntax Error  (Read 1009 times)

I can't seem to figure out what is the command in scripts for Clicking the right mouse to Activate. I am trying to get my T811AR to hit people. If it is possible. I believe it is. I have animation for it.

Now There is a Syntax Error when I put in the Hitting Command.

This is What console says about it.
Code: [Select]
Loading Add-On: Weapon_T811AR (CRC:-1377789323)
Add-Ons/Weapon_T811AR/server.cs Line: 401 - Syntax error.
>>> Some error context, with ## on sides of error halt:
   Parent::onFire(%this,%obj,%slot);  

}



^function armor::onTrigger(%this, %obj, %triggerNum, %val)

{

   if(%obj.getDamagePercent() < 1.0)

      %obj.playThread(2, shiftaway);

}



^function armor::onTrigger(%this, %obj, %triggerNum, %val)

{

   directDamage        = ##3##5;

   directDamageType  = $DamageType::T811AR;

   radiusDamageType  = $DamageType::T811AR;

   explosion           = T811ARExplosion;

   //particleEmitter     = as;



   muzzleVelocity      = 50;

   velInheritFactor    = 1;



   armingDelay         = 0;
>>> Error report complete.

ADD-ON "Weapon_T811AR" CONTAINS SYNTAX ERRORS

This is the script part.

Code: [Select]
function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
   if(%obj.getDamagePercent() < 1.0)
      %obj.playThread(2, shiftaway);
}

function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
   directDamage        = 35;
   directDamageType  = $DamageType::T811AR;
   radiusDamageType  = $DamageType::T811AR;
   explosion           = T811ARExplosion;
   //particleEmitter     = as;

   muzzleVelocity      = 50;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 100;
   fadeDelay           = 70;
   bounceElasticity    = 0;
   bounceFriction      = 0;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";

   uiName = "T811AR Hit";
};
« Last Edit: August 17, 2010, 11:47:34 AM by Uxie »

If you mean firing bullets, mousefire();

If you mean clicking a button, activatestuff();

The default Gun script has an animation that triggers when you fire it to move your hand. The same function can be edited for anything you need upon firing it.

If you mean firing bullets, mousefire();

If you mean clicking a button, activatestuff();
Left Click Fire Is what I'm trying to figure out.

The default Gun script has an animation that triggers when you fire it to move your hand. The same function can be edited for anything you need upon firing it.
I didn't think of that animation for my own. But I still don't know how to Left click to activate things. Like The ASKR1's Left Click for the second type of shooting or the HK417's Left Click for sights.

But this might be it.
Armor::onTrigger(%this, %obj, %slot, %val)

Got it, it's    function armor::onTrigger(%this, %obj, %triggerNum, %val)

This above is from the old Part of the Topic.
_____________________________ _____________________________ ____________
« Last Edit: August 17, 2010, 11:12:33 AM by Uxie »

Oh. "Left Click" is primary fire by default, not jet/secondary fire. Look at Ephialtes' Flak Cannon for an example of making it fire two kinds/methods of projectile.

Wait, what are you even trying to do? You're defining a projectile that doesn't exist, and you're doing it when you click the mouse button.

I'm trying to get it to hit people when you Right Click Click.  Which I am failing to do.
I realized that its Right Clicking That I am trying to do to hit people. This should help Alot.

I don't understand Ephialtes's method of Right Clicking. I barely see where the Right click Firing is at But I see where the OnTrigger is.

Double Post.

I don't get how to define the Projectile. I've been trying the TrigEnable Still don't know how to define Projectiles. Can anyone help?