Game Development Community

Invalid error message

by Jeff Trier · in Torque Game Engine · 05/14/2003 (8:03 am) · 1 replies

I was scripting some changes in shapeBase.cs and I created a function called "getUnitIndex()". Then realized that there was another function which I had created that would do the same job. I commented out the function getUnitIndex(), and replaced the call with the already created one. And saved all the project files.

Now when I load the game, I get: "fps/server/scripts/shapeBase.cs (30): Unable to find function getUnitIndex".

I did a full search in all my files for the off chance that I had unknowingly placed a call to it elsewhere. And I hadn't.

Another oddity is that the error line that it's pointing to is where the old function was being called from when it existed.

I exited out of the game *fully* and tried again, same effect.


Here is the modified function that is giving me trouble:

function ShapeBase::damage(%this, %sourceObject, %position, %damage, %damageType)
{
   // All damage applied by one object to another should go through this
   // method. This function is provided to allow objects some chance of
   // overriding or processing damage values and types.  As opposed to
   // having weapons call ShapeBase::applyDamage directly.
   // Damage is redirected to the datablock, this is standard proceedure
   // for many built in callbacks.
   %this.getDataBlock().damage(%this, %sourceObject, %position, %damage, %damageType);
   echo("ShapeBase::damage:This = " @ %this); // Will show target hit
   echo("ShapeBase::damage:sourceObject = " @ %sourceObject); // Will show ?
   echo("ShapeBase::damage:damage = " @ %damage); // Will show Damage to target
   echo("ShapeBase::damage:damageType = " @ %damageType); // Will show Damage Type

   // get targets location
  %i = getObjectIndex(%this, 0, $Populous, $UnitPlaceCount)

   echo(%i);
   // Get targets defense value against DamageType
   // Subtract Defense Value from Weapons Damage
   // apply damage to target
}

About the author

Originally a Classical/Metal musician, I've always been attracted to anything involving computers, including: Networking, PC Building and Repair, software design and coding. I've been involved with game design and development for over 10 years.


#1
05/14/2003 (8:07 am)
Doh! Found the problem...

I was missing a semicolon. ::embarrased::

Ok, I will go ahead and leave this report here since it was giving a mis-error.

Sorry guys!
-Jeff