PDA

View Full Version : Undefinied is not an object: trig waittill ("trigger"); ? Error



ElEmEnT
27th August 2013, 18:22
Hey Community,
i need help. I got an error on this sript. I map only about 3 days,
so i dont have very much experience in scripting.


main()
{
thread jaildoor();
thread jailkillr();
thread jailkilll();
}

jaildoor()

{
jaildoor = getent("jaildoor","targetname");
trig = getent("jaildoor_trigger","targetname");
while(1)
{
trig waittill ("trigger");
jaildoor movez (-104,7,3,3);
jaildoor waittill ("movedone");
wait(3);
jaildoor movez (104,7,3,3);
jaildoor waittill ("movedone");
}
}

jailkillr()

{
jailkillr = getent("jailkillr","targetname");
trig = getent("jailkillr_trigger","targetname");
while(1)
{
trig waittill ("trigger");
jailkillr movey (97,7,3,3);
jailkillr waittill ("movedone");
wait(3);
jailkillr movey (-97,7,3,3);
jailkillr waittill ("movedone");
}
}

jailkilll()

{
jailkilll = getent("jailkilll","targetname");
trig = getent("jailkilll_trigger","targetname");
while(1)
{
trig waittill ("trigger");
jailkilll movez (-97,7,3,3);
jailkilll waittill ("movedone");
wait(3);
jailkilll movez (97,7,3,3);
jailkilll waittill ("movedone");
}
}

And the error is.

******* script runtime error *******
undefined is not an object: (file 'maps/mp/jaildoor.gsc', line 31)
trig waittill ("trigger");
*
called from:
(file 'maps/mp/jaildoor.gsc', line 4)
thread jailkillr();
*
called from:
(file 'maps/mp/mp_firstmap.gsc', line 28)
maps\mp\jaildoor::main();
*
started from:
(file 'maps/mp/mp_firstmap.gsc', line 1)
main()
*
************************************
writing to: F:\Games\Activision\Call of duty 2\servercache.dat
Error during initialization:
script runtime error
(see console for details)
(file 'maps/mp/mp_firstmap.gsc', line 1)

RobsoN
27th August 2013, 18:33
This trigger: "jailkillr_trigger" doesn't exists.

kung foo man
27th August 2013, 18:34
The entities are not in map or you named them different in script. Try for each loop:



trig = getent("jailkillr_trigger","targetname");
if ( ! isDefined(trig))
{
iprintlnbold("Trigger not defined!");
return;
}

serthy
27th August 2013, 18:37
undefined is not an object: (file 'maps/mp/jaildoor.gsc', line 31)
trig waittill ("trigger");

the console is telling you the error
the only object in your function is the trigger
this object seems to be undefined (CoD2 isnt able to find this)

check your trigger for correct KVP (key/value pair, correct targetname)

maybe you should add some debugging info:


trig = getEnt( name , targetname );
if( !isDefined( trig ) )
return iPrintLn( "Trigger not defined!" );

EDIT: Mau, zu lahm :p