undefined is not an object

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

undefined is not an object

Post by inzerke » February 18th, 2012, 6:38 pm

Hey there,

I've done some mapping and bit scripting.
Today I have the next problem:
I've made a door which goes down > movey -160
The trigger I used is the trigger_damage.
So when someone shoots the right point the door goes down and you can enter the room.
I used the followed script:

Code: Select all

   thread elecdoor ();
}
 
elecdoor()
{
   slidedoor = getent( "elecdoor", "targetname" );
   trig      = getent( "elec", "targetname" );
        trig waittill ("trigger");
        slidedoor movey ( -160, 2, 1, 1);
        slidedoor waittill ("movedone"); 
}
 
After compiling and loading without errors I tried to shoot my trigger.
Whenever I damage the trigger I get the next message:
undefined is not an object

I though my script would work, but I can't see the problem.....
If any of you could help me giving a solution, I'd learn from it.

Greetz :)

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: undefined is not an object

Post by inzerke » February 18th, 2012, 7:08 pm

It goes wrong on this line:

Code: Select all

   thread elecdoor ();
}
 
elecdoor()
{
   elecdoor = getent( "elecdoor", "targetname" );
   trig      = getent( "electrig", "targetname" );
   trig waittill ("trigger");
         elecdoor movey ( -160, 2, 1, 1);
   elecdoor waittill ("movedone");
}
trig waittill ("trigger");

I changed the targetnames and checked them.
Still the same fault...

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: undefined is not an object

Post by inzerke » February 18th, 2012, 8:45 pm

Thanks for your help,
but I could fix it with the old script.
Just had some entity's wrong I though

CLOSED :)

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests