Game Development Community

Weapon file not working

by Morrock · in General Discussion · 05/03/2008 (7:34 pm) · 2 replies

Ok, I give up. I have been trying for at least 2 hours to get this weapon I scripted working in the starter.fps file but it just won't load into the game. The error message I'm recieving in the console is along the lines of:
Advanced script error report. Line 51. - Parse Error
Some error context with ## on either side of halt:
function m416Projectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
   // Apply damage to the object all shape base objects
   if (%col.getType() & $TypeMasks::ShapeBaseObjectType)
      %col.damage(%obj,%pos,%this.directDamage,"m416Projectile");
};
##
##
//-----------------------------------------------------------------------------
// Ammo Item

datablock ItemData(LaserAmmo)
{
   // Mission editor category
   category = "Ammo";

   // Add the Ammo namespace as a parent.  The ammo namespace provides

The weapon is the m416 assault rifle (in code it's just the m416) I've made a few weapons before and they worked just fine. Yes I exec()'d the weapon script, all the ShapeFile/Texture, etc... location strings have been triple checked (they're located in a file under ~/data/shapes/weapons/m416/).

The strangest thing is, Torque seems to be picking a line to halt at at random. These past 2 times it's been that empty space in between 2 datablocks, before it was the openining bracket of the projectiles ParticleData (which for no reason it stopped halting at...)

Any help would be greatly appreciated.

#1
05/03/2008 (7:40 pm)
Functions do not have semi-colons on the end!
#2
05/03/2008 (8:01 pm)
Ahh, thankyou. I must have mistaken that for a datablock or something.

Even with my new lasers, my AI still own me... :)