CoD4 Keycode Door into 1 gsc?

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

Moderator: Core Staff

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 20th, 2010, 10:10 pm

Yo guys, im making a new jump map and i got a script from neRokk and its a keycode door. But i got an error when i put it all in 1 gsc file....

Image

Here is my gsc file....

Code: Select all

main()
{
   //maps\mp\mp_crash_fx::main();
   //maps\createart\mp_crash_art::main();
   maps\mp\_load::main();
   
   maps\mp\_compass::setupMiniMap("compass_map_mp_jumpzone");

   game["allies"] = "marines";
   game["axis"] = "opfor";
   game["attackers"] = "allies";
   game["defenders"] = "axis";
   game["allies_soldiertype"] = "desert";
   game["axis_soldiertype"] = "desert";
   
   setdvar( "r_specularcolorscale", "1" );
   setdvar("compassmaxrange","1600");

  entTransporter = getentarray("enter","targetname");
  if(isdefined(entTransporter))
  {
    for(lp=0;lp < entTransporter.size; lp++)
      entTransporter[lp] thread Transporter();
  }

	thread message1();
	thread message5();
	thread message7();
	thread message9();
	thread combinationLock();
	thread mapby();
}

Transporter()
{
  while(true)
  {
    self waittill("trigger",other);
    entTarget = getent(self.target, "targetname");

    wait(0.10);
    other setorigin(entTarget.origin);
    other setplayerangles(entTarget.angles);
    //iprintlnbold ("You have been teleported !!!");
    wait(0.10);
  }
}

message1()
{
message2 = getent("cj1","targetname");
   while (1)
   {
message2 waittill ("trigger", user );
iprintlnbold ("^1-^9= ^1CoD^8Jumper^3.^7com ^3- ^7For all your CoDJumping needs! ^9=^1-");
wait 2;
   }
}

message5()
{
message6 = getent("cj2","targetname");
   while (1)
   {
message6 waittill ("trigger", user );
iprintlnbold ("^7Big thx to neRokk for the scripts!");
wait 2;
}
}

message7()
{
message8 = getent("cj3","targetname");
   while (1)
   {
message8 waittill ("trigger", user );
iprintlnbold ("^2JuMPZoR ^7Pwns You All!");
wait 2;
}
}

message9()
{
message10 = getent("cj4","targetname");
   while (1)
   {
message10 waittill ("trigger", user );
iprintlnbold ("^7What do you think of this map? :D");
wait 2;
}
}

combinationLock()
{
   //combinations
   lockTriggers = getentarray("trigLock","targetname");
   for(i=0;i<lockTriggers.size;i++)
   {
      lockTriggers[i] thread saveInput();
   }
   
   //unlock
   unlockTrigger = getent("trigUnlock","targetname");
   unlockTrigger thread unlock();
   level.code = "102310";
   level.input = "";
}

saveInput()
{
   for(;;)
   {
      self waittill("trigger",user);
      level.input += self.script_noteworthy;
      //iprintln(level.input);
   }
}

unlock()
{
   door = getent("door","targetname");
   for(;;)
   {
      self waittill("trigger",user);
        if(level.input == level.code)
        {
        user iprintlnbold ("^2Good job!");
	wait(0.20);
	user setOrigin( (6146, 5074, 2126) );
	wait(1);
        level.input = "";
        }
   else
   {
	user iprintlnbold ("^1Wrong code ...");
	level.input = "";	
   }
   }
}


mapby()
{
	for(;;)
	{
		wait 90;
		iPrintLn("This map was made by ^2JuMPZoR");
	}
}


And i asked neRokk wat was wrong and he said i cant have it in the main gsc file, so u guys know any way i can make it all in 1 gsc file?
Image

Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD4 Keycode Door into 1 gsc?

Post by Drofder2004 » June 20th, 2010, 10:20 pm

unlockTrigger = getent("trigUnlock","targetname");

This is not being found by your map.

You cannot simply copy and paste a GSC file and expect it to work, your map must match the scripting...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 20th, 2010, 11:00 pm

*Ignore*
Last edited by JuMPZoR on June 20th, 2010, 11:10 pm, edited 1 time in total.
Image

Image

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 20th, 2010, 11:06 pm

Dude...i have the trigUnlock....i have the buttons in the map with target names of trigUnlock, and the triggers directly behind it. The only thing i need help on is wat i posted....

I think u read the wrong thing...
Image

Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD4 Keycode Door into 1 gsc?

Post by Drofder2004 » June 21st, 2010, 12:53 am

What part of "undefined is not an object" do you think I read wrong?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by Soviet » June 21st, 2010, 12:57 am

CoDJumper.com - Number one in customer service!

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 21st, 2010, 2:38 am

Well which part of, i have the trigUnlock in the map, did u not understand?

Listen, im not trying to fight, i didn't know asking for help would be so difficult.
Image

Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by Soviet » June 21st, 2010, 3:16 am

Code: Select all

main()
{
   //maps\mp\mp_crash_fx::main();
   //maps\createart\mp_crash_art::main();
   maps\mp\_load::main();
   
   maps\mp\_compass::setupMiniMap("compass_map_mp_jumpzone");

   game["allies"] = "marines";
   game["axis"] = "opfor";
   game["attackers"] = "allies";
   game["defenders"] = "axis";
   game["allies_soldiertype"] = "desert";
   game["axis_soldiertype"] = "desert";
   
   setdvar( "r_specularcolorscale", "1" );
   setdvar("compassmaxrange","1600");

  entTransporter = getentarray("enter","targetname");
  if(isdefined(entTransporter))
  {
    for(lp=0;lp < entTransporter.size; lp++)
      entTransporter[lp] thread Transporter();
  }

	thread message1();
	thread message5();
	thread message7();
	thread message9();
	thread combinationLock();
	thread mapby();
	thread unlock();
}

Transporter()
{
  while(true)
  {
    self waittill("trigger",other);
    entTarget = getent(self.target, "targetname");

    wait(0.10);
    other setorigin(entTarget.origin);
    other setplayerangles(entTarget.angles);
    //iprintlnbold ("You have been teleported !!!");
    wait(0.10);
  }
}

message1()
{
message2 = getent("cj1","targetname");
   while (1)
   {
message2 waittill ("trigger", user );
iprintlnbold ("^1-^9= ^1CoD^8Jumper^3.^7com ^3- ^7For all your CoDJumping needs! ^9=^1-");
wait 2;
   }
}

message5()
{
message6 = getent("cj2","targetname");
   while (1)
   {
message6 waittill ("trigger", user );
iprintlnbold ("^7Big thx to neRokk for the scripts!");
wait 2;
}
}

message7()
{
message8 = getent("cj3","targetname");
   while (1)
   {
message8 waittill ("trigger", user );
iprintlnbold ("^2JuMPZoR ^7Pwns You All!");
wait 2;
}
}

message9()
{
message10 = getent("cj4","targetname");
   while (1)
   {
message10 waittill ("trigger", user );
iprintlnbold ("^7What do you think of this map? :D");
wait 2;
}
}

combinationLock()
{
   //combinations
   lockTriggers = getentarray("trigLock","targetname");
   for(i=0;i<lockTriggers.size;i++)
   {
      lockTriggers[i] thread saveInput();
   }
   
   //unlock
   unlockTrigger = getent("trigUnlock","targetname");
   unlockTrigger thread unlock();
   level.code = "102310";
   level.input = "";
}

saveInput()
{
   for(;;)
   {
      self waittill("trigger",user);
      level.input += self.script_noteworthy;
      //iprintln(level.input);
   }
}

unlock()
{
   door = getent("door","targetname");
   for(;;)
   {
      self waittill("trigger",user);
        if(level.input == level.code)
        {
        user iprintlnbold ("^2Good job!");
	wait(0.20);
	user setOrigin( (6146, 5074, 2126) );
	wait(1);
        level.input = "";
        }
   else
   {
	user iprintlnbold ("^1Wrong code ...");
	level.input = "";	
   }
   }
}


mapby()
{
	for(;;)
	{
		wait 90;
		iPrintLn("This map was made by ^2JuMPZoR");
	}
}
Try that.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD4 Keycode Door into 1 gsc?

Post by Drofder2004 » June 21st, 2010, 11:31 am

JuMPZoR wrote:Well which part of, i have the trigUnlock in the map, did u not understand?

Listen, im not trying to fight, i didn't know asking for help would be so difficult.
You have a mapping error, whether you think I am right or not.

The previous line to the error is "trigUnlock = getent(etc)"
You are defining a variable.

Now the error states that UNDEFINED is not an object and then it references the line "UnlockTrigger thread etc".
It is telling you that UnlockTrigger is NOT DEFINED and therefore it is NOT an object that you can reference.

Go check your spelling, delete the object and recreate it, double check you have not accidently set he worldspawn to contain a targetname, make sure other objects do not have the same targetname.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: CoD4 Keycode Door into 1 gsc?

Post by Pedsdude » June 21st, 2010, 12:44 pm

Image
Image
Image

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 21st, 2010, 11:18 pm

Ok, here's where I THINK you went wrong.

You said the map cannot find this line of code...

Code: Select all

 unlockTrigger = getent("trigUnlock","targetname")
But in the image @ my first post, it says that the error is this line of code...

Code: Select all

unlockTrigger thread unlock();
And that line of code is directly under the line of code that u said that cannot be found in the map.

....
Image

Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by Soviet » June 21st, 2010, 11:47 pm

So...you didn't try my code then? :|

User avatar
JuMPZoR
CJ Newbie
CJ Newbie
Posts: 88
Joined: May 16th, 2010, 7:23 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by JuMPZoR » June 21st, 2010, 11:52 pm

Actually, I did. Didn't work. Same EXACT error from the image in my first post. :/
Image

Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Re: CoD4 Keycode Door into 1 gsc?

Post by Soviet » June 22nd, 2010, 12:00 am

Ah, damn, it was just a shot in the dark. Do what Drofder said.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD4 Keycode Door into 1 gsc?

Post by Drofder2004 » June 22nd, 2010, 1:51 am

JuMPZoR wrote:Ok, here's where I THINK you went wrong.

You said the map cannot find this line of code...

Code: Select all

 unlockTrigger = getent("trigUnlock","targetname")
But in the image @ my first post, it says that the error is this line of code...

Code: Select all

unlockTrigger thread unlock();
And that line of code is directly under the line of code that u said that cannot be found in the map.

....
Now would you like for me to explain why I looked at the code ABOVE?
The reason the code above is significant is because this is the object being called.
Even if the error happened 300 lines below, the variable is defined at the point where I pointed out.

The reason the error does NOT occur at the point of call, is because it is NOT a script error when a variable is udnefined, infact its a useful feature...

So, you can either take my advice and just go fix your map, or you can continue pondering a scripting error which doesn't exist >.>
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests