Results 1 to 4 of 4

Thread: Undefinied is not an object: trig waittill ("trigger"); ? Error

  1. #1
    Private ElEmEnT's Avatar
    Join Date
    Aug 2013
    Posts
    22
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Question Undefinied is not an object: trig waittill ("trigger"); ? Error

    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.

    Code:
    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)
    Last edited by ElEmEnT; 27th August 2013 at 18:24. Reason: rechtschriebfehler

  2. #2
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    This trigger: "jailkillr_trigger" doesn't exists.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  3. The Following User Says Thank You to RobsoN For This Useful Post:

    ElEmEnT (27th August 2013)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    The entities are not in map or you named them different in script. Try for each loop:

    PHP Code:
    trig getent("jailkillr_trigger","targetname");
    if ( ! 
    isDefined(trig))
    {
        
    iprintlnbold("Trigger not defined!");
        return;

    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    ElEmEnT (27th August 2013)

  6. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by ElEmEnT View Post
    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:

    PHP Code:
            trig getEntname targetname );
            if( !
    isDefinedtrig ) )
                    return 
    iPrintLn"Trigger not defined!" ); 
    EDIT: Mau, zu lahm

  7. The Following 2 Users Say Thank You to serthy For This Useful Post:

    ElEmEnT (27th August 2013),kung foo man (27th August 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •