Blockland Forums > Modification Help
T811AR Syntax Error
Uxie:
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: ---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
--- End code ---
This is the script part.
--- Code: --- 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";
};
--- End code ---
Pew446:
If you mean firing bullets, mousefire();
If you mean clicking a button, activatestuff();
Space Guy:
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.
Uxie:
--- Quote from: Pew446 on August 16, 2010, 11:55:09 PM ---If you mean firing bullets, mousefire();
If you mean clicking a button, activatestuff();
--- End quote ---
Left Click Fire Is what I'm trying to figure out.
--- Quote from: Space Guy on August 17, 2010, 02:07:38 AM ---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.
--- End quote ---
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.
_____________________________ _____________________________ ____________
Space Guy:
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.