Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 48 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD Mapping
CoD mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Script Runtime Error
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 12:40 am
I got a script runtime error after I added a sliding door to my map, here is the door script straight from the "Getting started in scripting: moving things":
main()
{
thread door_slider ();
}

door_slider ()
{
door = getent ("slide ", "targetname");
trig = getent ("slider_trigger ", "targetname");
while (1)
{
trig waittill ("trigger");
door movez (80, 2, 0, 0.5);
door waittill ("movedone");
wait (4);
door movez (-80, 2, 0, 0.5);
door waittill ("movedone");
}
}

The console says:

******* script runtime error *******
undefined is not an object: (file 'maps\mp\door1.gsc', line 12)
trig waittill ("trigger")
*
called from:
(file 'maps\mp\door1.gsc', line 3)
thread door_slider ( );
*
called from:
(file 'maps\mp\outside.gsc', line 19)
level thread maps\mp\door1::main( );
*
called from:
(file 'maps\mp\outside.gsc', line 1)
main( )
*



edited on Oct. 1, 2006 11:22 pm by StrYdeR
Share |
TexasRebel
General Member
Since: May 1, 2006
Posts: 373
Last: Aug 20, 2013
[view latest posts]
Level 5
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 02:58 am
I think you are missing


main()
{
maps\mp\_load::main(); <------- this lil bit of coding
thread door_slider();
}
Share |
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 03:02 am
Didn't do a thing... I'm pretty sure the error is in the line "trig waittill ("trigger");"
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 03:24 am
the error is your answer....

you obviously do not have the entity in your map that has the targetname you are telling it to find and/or it is not a trigger

double check your entity in the map and make sure that you have named it what you are calling it in your script

slider_trigger

[angryalien]
Share |
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 03:27 am
Yes, I have a trigger_use in there that has the targetname slider_trigger.
Share |
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Monday, Oct. 2, 2006 10:26 pm
Bump
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Tuesday, Oct. 3, 2006 12:02 am
don't bump the thread that already has your answer or you will find it gets deleted rapidly

double check your entity information as the error you posted says that you DO NOT have trigger in your map with the targetname of slider_trigger

[angryalien]
Share |
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Oct. 3, 2006 12:11 am
Look, there is a trigger_use next to the door. It has a classname of trigger_use, and a targetname of slider_trigger. I have checked this many times. Now, from my very limited experience with scripting, I think the problem is that there isn't anything named "Trigger", but I'm probobly wrong. I DO know that the trigger_use is named slider_trigger, and I've checked the spelling on that I don't know how many times. Now, the trigger_use is placed over a model. This is just a regular model, but from what I get, that shouldn't be a problem, just thought I'd include it.
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11672
Last: Apr 20, 2024
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD Mapping
Posted: Tuesday, Oct. 3, 2006 01:41 am
to break down your script (the area that we are talking about)

trig = getent ("slider_trigger", "targetname");

this line tells the engine to search the map for an entity that has the targetname of slider_trigger and from this point on refer to it as trig

while (1)

this tells the script that a subloop is going to take place in the following set (defined by an opening and closing curly brace)

{

starts the set

trig waittill ("trigger");

this tells the script to pause and wait until the defined action has occured, in this case wait until the entity defined as trig has been triggered

this is where the error is being generated - basically stating that undefined (trig) is not an object (there is no trigger)

[angryalien]
Share |
Trigonous
General Member
Since: Mar 8, 2006
Posts: 80
Last: Oct 3, 2006
[view latest posts]
Level 3
Category: CoD Mapping
Posted: Tuesday, Oct. 3, 2006 01:44 am
Thanks, that helps me understand scripting a little bit better, I'll try deleting the trigger_use and see if that works.[banghead]
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoD Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»