dim3 Forum

Full Version: "obj has no properties"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What does this error mean?
Code:
JS Error [unseen_bot_fy_trooper.js]
120: TypeError: obj has no properties

Heres the function:
Code:
function fyTrooperFire(obj)
{
    obj.model.animation.index=1;
    //Fire
    if (mood=='attack') {
        if (obj.sight.testObject(victim)) {
            obj.model.animation.interrupt('idle fire');
            obj.weapon.fire('bot_bl15',1);
            if (utility.random.getInteger(1,10)==1) fyTrooperMove(obj);
        }
        obj.event.chain(utility.random.getInteger(3,7),'fyTrooperFire');
    }
}
Line 120 is the second one, so I'm guessing the error's in that function.
The only thing I can think it would mean is that it doesn't know what the 'obj' assignment in the function name or the model command means, because it hadn't been defined earlier in the script. But it seems that mistake would show up elsewhere.
ccccc Wrote:What does this error mean?
Code:
JS Error [unseen_bot_fy_trooper.js]
120: TypeError: obj has no properties

Heres the function:
Code:
function fyTrooperFire(obj)
{
    obj.model.animation.index=1;
    //Fire
    if (mood=='attack') {
        if (obj.sight.testObject(victim)) {
            obj.model.animation.interrupt('idle fire');
            obj.weapon.fire('bot_bl15',1);
            if (utility.random.getInteger(1,10)==1) fyTrooperMove(obj);
        }
        obj.event.chain(utility.random.getInteger(3,7),'fyTrooperFire');
    }
}
Line 120 is the second one, so I'm guessing the error's in that function.

Is it possible that your call is passing a null object or just has no parameters at all (the call to the function fyTrooperFire.) I suspect that might be where the problem is.

[>] Brian
Yea, I fixed this yesterday and forgot to delete the thread-that was the problem though.
Reference URL's