Probably you have an else that's been separated from its if statement by some code you added; or perhaps you deleted or rewrote an if statement and left the else dangling. Mind posting that section of items.qc (say, lines 400-500) so we can take a look?
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
The assignment in conditional comes from this line:
if (other.ammo_shells = 20 && (other.items & IT_SUPER_SHOTGUN))
tbh the logic here is a little broken... but it shouldn't generate any actual compiler errors, it just won't run right.
19 lines later is this line:
else if (self.classname == "weapon_grenadelauncher")
I really don't see how that else could be misplaced.
The only thing I can think of is that its somehow complaining about something hidden in whitespace.. but that doesn't really make much sense, as it would be moaning about a missing operator rather than a variable.
Yes, you'll want to fix the "if (other.ammo_shells = 20" to use a == instead of a = (a single = will set shells to 20 every time that if statement runs, which you probably don't want). Other than that, I'm not finding anything.
The line it's giving the error on is this one, right?
else if (self.classname == "weapon_grenadelauncher")
You can also try using fteqcc to see if it says something different about the error, or tags a different line.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Does anyone know why the sniper rifle wont show up in my map? does it have to do with how i added the sniper as a new weapon in the game? because im thinking the way that the tutorial show'd me how to add the new weapon makes it use the same everything that the shotgun does instead of actually creating a new weapon. i may be wrong, but im still learning -.-
else if (self.classname == "weapon_supershotgun")
{
if (other.shells == 100 && (other.items & IT_SUPER_SHOTGUN))//R00k added the '== 100' was '= 100'
{
new = IT_SNIPER;
other.ammo_shells = other.ammo_shells + 20;
}
else
{
if (leave && (other.items & IT_SUPER_SHOTGUN))
return;
hadammo = other.ammo_rockets; //what the f*ck is this here for??
new = IT_SUPER_SHOTGUN;
other.ammo_shells = other.ammo_shells + 5;
}
}
Which basically means if you touch the DoubleShotgun , and you already had one, AND you have 100 shells, THEN, you magically have a SNIPER RIFLE now. This tut doesnt actually add a sniper rifle model to the map, it just changes the behavior of the DSG, under these circumstances.
well... i decided to use the same code, but use the grenade launchers model... only difference. i mean id like to add a new weapon to an already existing slot just hit like 2 twice and you get the new weapon after you've picked it up.
There's an issue or two that I hadn't thought of with tutorial 3, but aside from that it's mostly good stuff.
Also, just in case error wants to stab me for saying that I was going to put these up on I3D's tutorial section, I can only say that I'm currently horribly busy right now with real life / work issues / quake burnout.