Author Topic: Frost Glove error  (Read 1493 times)

A friend and I are working on a glove which hides the hand node and replaces it with with a glove, you fire and the fingers move out and the glove shoots a frost ball. But I got this Syntac error.

Code: [Select]
Loading Add-On: Weapon_FrostGlove (CRC:-830455815)
Add-Ons/Weapon_FrostGlove/Weapon_FrostGlove.cs Line: 212 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^stateSequence[3]                = "Fire";

^stateWaitForTimeout[3]^^= true;

« Last Edit: July 04, 2009, 01:29:45 AM by 17speedy17 »

You are probably missing a semicolon or bracket or other mark in the code above that. I cannot help you any further than this because I can't see the file.

Code: [Select]
//frost.cs
datablock AudioProfile(frostHitSound)
{
   filename    = "./frostHit.wav";
   description = AudioClosest3d;
   preload = true;
};


//effects
datablock ParticleData(frostExplosionParticle)
{
   dragCoefficient      = 2;
   gravityCoefficient   = 1.0;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   spinRandomMin = -90;
   spinRandomMax = 90;
   lifetimeMS           = 500;
   lifetimeVarianceMS   = 300;
   textureName          = "base/data/particles/chunk";
   colors[0]     = "0.7 0.7 0.9 0.9";
   colors[1]     = "0.9 0.9 0.9 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 0.25;
};

datablock ParticleEmitterData(frostExplosionEmitter)
{
   ejectionPeriodMS = 7;
   periodVarianceMS = 0;
   ejectionVelocity = 8;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 60;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "frostExplosionParticle";

   uiName = "Frost Hit";
};

datablock ExplosionData(frostExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 500;

   soundProfile = frostHitSound;

   particleEmitter = frostExplosionEmitter;
   particleDensity = 10;
   particleRadius = 0.2;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "20.0 22.0 20.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 3;
   lightEndRadius = 0;
   lightStartColor = "00.0 0.2 0.6";
   lightEndColor = "0 0 0";
};


//projectile
AddDamageType("frost",   '<bitmap:add-ons/Weapon_frost/CI_frost> %1',    '%2 <bitmap:add-ons/Weapon_frost/CI_frost> %1',0.75,1);
datablock ProjectileData(frostProjectile)
{
   directDamage        = 35;
   directDamageType  = $DamageType::frost;
   radiusDamageType  = $DamageType::frost;
   explosion           = frostExplosion;
   //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 = "Frost";
};


//////////
// item //
//////////
datablock ItemData(frostItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "./frost.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Frost Glove";
iconName = "./icon_frost";
doColorShift = true;
colorShiftColor = "0.471 0.471 0.471 1.000";

// Dynamic properties defined by the scripts
image = frostImage;
canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(frostImage)
{
   // Basic Item properties
   shapeFile = "./frost.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";

   // 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 = false;

   eyeOffset = "0.7 1.2 -0.25";

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = frostItem;
   ammo = " ";
   projectile = frostProjectile;
   projectileType = Projectile;

   //melee particles shoot from eye node for consistancy
   melee = true;
   doRetraction = false;
   //raise your arm up or not
   armReady = true;

   //casing = " ";
   doColorShift = true;
   colorShiftColor = "0.471 0.471 0.471 1.000";

   // 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]                     = "Activate";
stateTimeoutValue[0]             = 0.5;
stateTransitionOnTimeout[0]      = "Ready";
stateSound[0]                    = weaponSwitchSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "PreFire";
stateAllowImageChange[1]         = true;

stateName[2] = "PreFire";
stateScript[2]                  = "onPreFire";
stateAllowImageChange[2]        = false;
stateTimeoutValue[2]            = 0.1;
stateTransitionOnTimeout[2]     = "Fire";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "Ready";
stateTimeoutValue[3]            = 0.2;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateWaitForTimeout[3] = true;

};

function frostimage::onMount(%this,%user)
{
%user.playthread(1,root);
if(%user.paraing)
{
return;
}

%user.mountimage(frost1image, 2);
%obj = %user;
%obj.hidenode(RHand);
%obj.hidenode(RHook);
}

function frosrimage::onUnMount(%this,%user)
{
if(%user.frosting)
{
return;
}
%user.unmountimage(2);
%user.client.applybodyparts();
}


Can you give us the whole syntax error, I need to see where the ##'s are.


Code: [Select]
Loading Add-On: Weapon_FrostGlove (CRC:-830455815)
Add-Ons/Weapon_FrostGlove/Weapon_FrostGlove.cs Line: 212 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^stateSequence[3]                = "Fire";

^stateWaitForTimeout[3]^^= true;



};



function frostImage::onPreFire(%this, %obj, %slot)

{

^%obj.playthread(2, armattack);

}



function frostImage::onStopFire(%this, %obj, %slot)

{^

^%obj.playthread(2, root);

} ;##
##


function frostimage::onMount(%this,%user)

{

^%user.playthread(1,root);

^if(%user.paraing)

^{

^^return;

^}

^

^%user.mountimage(frost1image, 2);

^%obj = %user;

^%obj.hidenode(RHand);

^%obj.hidenode(RHook);

}



function frosrimage::onUnMount(%this,%user)
>>> Error report complete.

ADD-ON "Weapon_FrostGlove" CONTAINS SYNTAX ERRORS

See the semicolon where those ##s are?
Get rid of it.

There it is, you don't need a semi-colon (;) on that bracket (}) Here, I'll highlight it.

function frostImage::onStopFire(%this, %obj, %slot)

{^

^%obj.playthread(2, root);

};<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<, RIGHT THERE
##
« Last Edit: July 04, 2009, 12:58:49 PM by AGlass0fMilk »