Author Topic: Where's the error?  (Read 1276 times)

Two of my weapons have syntax errors that I can't seem to find, even with the ##s.

what are your weapons called

post the weapon code

You're missing a function keyword, atablock is also not a keyword you have brackets where there aren't supposed to be any.

Post your actual code, still because it's not too clear what's going on here.

Loading Add-On: Weapon_GE_DecigunAkimbo (CRC:-658461878)
Add-Ons/Weapon_GE_DecigunAkimbo/Weapon_AkimboGun10.cs Line: 326 - Syntax error.
>>> Some error context, with ## on sides of error halt:
{

   Parent::onMount(%this, %obj, %slot);

   %obj.playThread(1, armreadyboth);

}

function LeftHanded10GunImage::onUnMount(%this, %obj, %slot)

{

   Parent::onUnMount(%this, %obj, %slot);

}



function Akimbo10GunImage::onFire(%this,%obj,%slot)

{

^{##
##
^^if(%obj.getDamagePercent() < 1.0)

^^^%obj.playThread(2, shiftAway);

^^Parent::onFire(%this,%obj,%slot);^

^}

^if(%obj.getImageAmmo(%slot))

^{
^^%projectile = akimbo10GunProjectile;

^^%spread = 0.005;

^^%shellcount = 10;



^^for(%shell=0; %shell<%shellcount; %shell++)
>>> Error report complete.

ADD-ON "Weapon_GE_DecigunAkimbo" CONTAINS SYNTAX ERRORS

Loading Add-On: Weapon_GE_Decigun (CRC:-1441496878)
Add-Ons/Weapon_GE_Decigun/server.cs Line: 1 - Syntax error.
>>> Some error context, with ## on sides of error halt:
atablock ProjectileData(10G##u##nProjectile)

{

   projectileShapeName = "Add-Ons/Weapon_Gun/bullet.dts";

   directDamage        = 3;

   directDamageType    = $DamageType::Gun;

   radiusDamageType    = $DamageType::Gun;



   brickExplosionRadius = 0;

   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
>>> Error report complete.

ADD-ON "Weapon_GE_Decigun" CONTAINS SYNTAX ERRORS
« Last Edit: January 25, 2017, 08:14:40 PM by elm »

1. It's not really "my code", I'm trying to fix my old gun edits.
2. It's not actually "atablock", it's just cut off.
3. http://leopard.hosting/download.php?f=ejylm < Decigun
4. http://leopard.hosting/download.php?f=vptpq < Deciguns Akimbo

Code: [Select]
function Akimbo10GunImage::onFire(%this,%obj,%slot)

{

^{##
##
^^if(%obj.getDamagePercent() < 1.0)

^^^%obj.playThread(2, shiftAway);

^^Parent::onFire(%this,%obj,%slot);^

^}

You have two opening brackets, one after another with nothing in between

Code: [Select]
{
     ^{##

Okay, so I fixed all the braces/brackets, but why is the U highlighted by the hashtags in the Decigun projectile?

Okay, so I fixed all the braces/brackets, but why is the U highlighted by the hashtags in the Decigun projectile?
because that's where the script parser runs into an error

because that's where the script parser runs into an error
...And why is the error there?

...And why is the error there?
it looks like that you cannot start a datablock's name with a number, so just move the 10 to somewhere else and it'll work
fun fact you can't start a variable name with a number either