Enter The Pin Code To Open The Door

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

Moderator: Core Staff

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Enter The Pin Code To Open The Door

Post by Scorpion » October 26th, 2008, 2:43 pm

Hello

On the Map Nm_Dual About 1/2 The Way Through The Map , You Get To The Bit Where You Have To Enter The Pin Code Something Like 663777 .

Could You Tell Me How To Do This Please?

Thankyou :twisted:

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

Re: Enter The Pin Code To Open The Door

Post by Drofder2004 » October 26th, 2008, 3:43 pm

Point and click (either Use or shoot), cant remember.
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

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Re: Enter The Pin Code To Open The Door

Post by Scorpion » October 26th, 2008, 4:41 pm

I Know That

I Meant To Say How Do You Make it

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Enter The Pin Code To Open The Door

Post by Nightmare » October 26th, 2008, 6:11 pm

Here is the code. I must warn you, you must have a good understanding of coding to understand this.
If you can, come back to it later once you understand scripting in CoD a bit better (or study some C++ or Java).

viewtopic.php?p=83118#p83118
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

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

Re: Enter The Pin Code To Open The Door

Post by Drofder2004 » October 27th, 2008, 1:00 am

I do have a code lying around I was going to release to someone during the whole "puzzle" phase, which was a random passcode puzzle generator, but since my format lost it. It shouldn't be too hard to replicate using the code NM posted. Any one for a task? :P
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
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Enter The Pin Code To Open The Door

Post by Nightmare » October 27th, 2008, 1:28 am

I could give it a go, honestly, that is really easy.
In fact, I did the exact same thing in nm_repeat.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

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

Re: Enter The Pin Code To Open The Door

Post by Drofder2004 » October 27th, 2008, 3:19 am

Yeh, I was trying to do something very complex, and settled for the simpler version.

---

Here's a small task that I just attempted and I know is possibly (and possibly easy) but I am failing to wrap my head around it properly.

Basically I want to create a random, unique number generator, but without causing the game lag.

The first way I tried, the obvious "if number is not unique, randomise again".
That works fine, but if the game does not hit the final random number possible, then the game tells the script to abandon, being potentially infinite.

The second way I was looking to do it was an array.

array[0] = 0
array[1] = 1
array[2] = 2
array[3] = 3
etc

and when the randomiser hits a number, it is removed from the list and the list is recalculated, for example, random number equals "2". "2" is removed and becomes...

array[0] = 0
array[1] = 1
array[2] = 3
array[3] = 4
etc

This is the same way Call of Duty deals with player disconnects, but I unable to get it to work :S

Wanna have a go at that? :)
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
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Enter The Pin Code To Open The Door

Post by Nightmare » October 27th, 2008, 3:36 am

I remember making something of that sort (pushing and popping) in c++. I'd have to see if I still have the file anywhere.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Scorpion
CJ Wannabe
CJ Wannabe
Posts: 39
Joined: November 18th, 2007, 9:14 pm
Location: Burnley,United Kingdom

Re: Enter The Pin Code To Open The Door

Post by Scorpion » October 27th, 2008, 5:26 pm

Iv Created The Pin Code And It Moves The Door . Its All Working Good But I want to add A Enter Button Just Like On Nm_Dual

Here Is My Script

main()
{

level.codeCount=0;
level.code="";

for(i=1;i<7;i++) //Change 4 to however many triggers you have
{
trig = getent("jm_lockover_no"+i,"targetname");
trig thread checkTrig(i);
}
}

checkTrig(i)
{
while(1)
{
self waittill("trigger",user);
if(level.codeCount<6) //Change 3 with however long your code is.
{
level.code=level.code+""+i;
level.codeCount++;
}
if(level.codeCount==6) //Change 3 with however long your code is
{
if(level.code==536236) //Change 123 to whatever code you want
{
user iprintln ("Password Correct");
platform = getent ("jm_lockover_no_door","targetname");
wait(2);
platform moveX (64,2,0.5,0.5);
platform waittill ("movedone");
wait(5);
platform moveX (-64,2,0.5,0.5);
platform waittill ("movedone");
}
else
{
iprintln("Password Denied");
}
level.codeCount=0;
level.code="";
}
}
}


Iv Created A Enter Button And A Enter Trigger

What Other Information Would I Add Into The Script?

ThankYou

zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Re: Enter The Pin Code To Open The Door

Post by zipperdude » October 27th, 2008, 11:14 pm

This is what mine looks like:

Code: Select all

main()
{

level.codeCount=0;
level.code="";

for(i=1;i<10;i++) //Change 4 to however many triggers you have
{
trig = getent("math_prob_"+i,"targetname");
trig thread checkTrig(i);
}
}

checkTrig(i)
{
while(1)
{
self waittill("trigger",user);
if(level.codeCount<2) //Change 3 with however long your code is.
{
level.code=level.code+""+i;
level.codeCount++;
}
if(level.codeCount==2) //Change 3 with however long your code is
{
if(level.code==62) //Change 123 to whatever code you want
{
	user iprintln ("Correct Answer");
	mc_door_1 = getent ("mc_door_1","targetname");
	wait(2);
	mc_door_1 rotatepitch ( 90 , 5 );
	mc_door_1 waittill ("movedone");
	wait(5);
	mc_door_1 rotatepitch ( -90 , 5 );
	mc_door_1 waittill ("movedone");
}
else
{
iprintln("Wrong Answer");
}
level.codeCount=0;
level.code="";
}
}
}
But nothing happens when u shoot the buttons :( Ive checked all the targetnames and values and renamed everything but still nothing happens. Its very saddening.
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Enter The Pin Code To Open The Door

Post by Nightmare » October 28th, 2008, 3:26 am

Code: Select all

main()
{
	level.code="";
	
	for(i=1;i<7;i++)
	{
		trig = getent("jm_lockover_no"+i,"targetname");
		trig thread checkTrig(i);
	}
	getent("jm_lockover_enter","targetname") thread checkEnter();
}

checkTrig(i)
{
	self waittill("trigger",user);
	level.code=level.code+""+i;
	wait 0.05;
	thread checkTrig(i);
}

checkEnter()
{
	self waittill("trigger",user);
	if(level.code==536236)
	{
		user iprintln ("Password Correct");
		platform = getent ("jm_lockover_no_door","targetname");
		wait(2);
		platform moveX (64,2,0.5,0.5);
		platform waittill ("movedone");
		wait(5);
		platform moveX (-64,2,0.5,0.5);
		platform waittill ("movedone");
	}
	else iprintln("Password Denied");
	level.code="";
	self thread checkEnter();
}
What a beauty, I simplified it big time. :D
Have any questions? Just ask!
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Re: Enter The Pin Code To Open The Door

Post by zipperdude » October 28th, 2008, 4:29 am

Nightmare wrote:

Code: Select all

main()
{
	level.code="";
	
	for(i=1;i<7;i++)
	{
		trig = getent("jm_lockover_no"+i,"targetname");
		trig thread checkTrig(i);
	}
	getent("jm_lockover_enter","targetname") thread checkEnter();
}

checkTrig(i)
{
	self waittill("trigger",user);
	level.code=level.code+""+i;
	wait 0.05;
	thread checkTrig(i);
}

checkEnter()
{
	self waittill("trigger",user);
	if(level.code==536236)
	{
		user iprintln ("Password Correct");
		platform = getent ("jm_lockover_no_door","targetname");
		wait(2);
		platform moveX (64,2,0.5,0.5);
		platform waittill ("movedone");
		wait(5);
		platform moveX (-64,2,0.5,0.5);
		platform waittill ("movedone");
	}
	else iprintln("Password Denied");
	level.code="";
	self thread checkEnter();
}
What a beauty, I simplified it big time. :D
Have any questions? Just ask!

So your gunna help him and not me... :( thnx nm i thaught we were friends. :'(
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

JDogg
Too cool for CoDJumper
Too cool for CoDJumper
Posts: 3617
Joined: August 28th, 2007, 11:46 am
Location: Melbourne, Australia

Re: Enter The Pin Code To Open The Door

Post by JDogg » October 28th, 2008, 7:18 am

zipperdude wrote:
Nightmare wrote:

Code: Select all

main()
{
	level.code="";
	
	for(i=1;i<7;i++)
	{
		trig = getent("jm_lockover_no"+i,"targetname");
		trig thread checkTrig(i);
	}
	getent("jm_lockover_enter","targetname") thread checkEnter();
}

checkTrig(i)
{
	self waittill("trigger",user);
	level.code=level.code+""+i;
	wait 0.05;
	thread checkTrig(i);
}

checkEnter()
{
	self waittill("trigger",user);
	if(level.code==536236)
	{
		user iprintln ("Password Correct");
		platform = getent ("jm_lockover_no_door","targetname");
		wait(2);
		platform moveX (64,2,0.5,0.5);
		platform waittill ("movedone");
		wait(5);
		platform moveX (-64,2,0.5,0.5);
		platform waittill ("movedone");
	}
	else iprintln("Password Denied");
	level.code="";
	self thread checkEnter();
}
What a beauty, I simplified it big time. :D
Have any questions? Just ask!

So your gunna help him and not me... :( thnx nm i thaught we were friends. :'(
Well you thought wrong then huh. Only kidding, NM prolly just forgot :shock:.
Image
Image

zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Re: Enter The Pin Code To Open The Door

Post by zipperdude » October 28th, 2008, 11:07 pm

JDogg wrote:
zipperdude wrote:
Nightmare wrote:

Code: Select all

main()
{
	level.code="";
	
	for(i=1;i<7;i++)
	{
		trig = getent("jm_lockover_no"+i,"targetname");
		trig thread checkTrig(i);
	}
	getent("jm_lockover_enter","targetname") thread checkEnter();
}

checkTrig(i)
{
	self waittill("trigger",user);
	level.code=level.code+""+i;
	wait 0.05;
	thread checkTrig(i);
}

checkEnter()
{
	self waittill("trigger",user);
	if(level.code==536236)
	{
		user iprintln ("Password Correct");
		platform = getent ("jm_lockover_no_door","targetname");
		wait(2);
		platform moveX (64,2,0.5,0.5);
		platform waittill ("movedone");
		wait(5);
		platform moveX (-64,2,0.5,0.5);
		platform waittill ("movedone");
	}
	else iprintln("Password Denied");
	level.code="";
	self thread checkEnter();
}
What a beauty, I simplified it big time. :D
Have any questions? Just ask!

So your gunna help him and not me... :( thnx nm i thaught we were friends. :'(
Well you thought wrong then huh. Only kidding, NM prolly just forgot :shock:.
lol
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Enter The Pin Code To Open The Door

Post by Nightmare » October 29th, 2008, 3:50 am

The best way is to do some error checking with iprintln.
Try this:

Code: Select all

main()
{

	level.codeCount=0;
	level.code="";
	iprintln("I'm starting the loop.");
	for(i=1;i<7;i++) //Change 4 to however many triggers you have
	{
		trig = getent("jm_lockover_no"+i,"targetname");
		if(!isDefined(trig))
		{
			iprintln("^1Sorry, but I can't find trigger "+i+"!");
		}
		else
		{
			trig thread checkTrig(i);
			iprintln("I've gotten trigger "+i+" ready!");
		}
	}
	iprintln("Finished looping, my work here is done!");
}

checkTrig(i)
{
	while(1)
	{
		iprintln("Trigger "+i+" is waiting to be triggered!");
		self waittill("trigger",user);
		iprintln("Trigger "+i+" has been triggered!");
		if(level.codeCount<6) //Change 3 with however long your code is.
		{
			iprintln("The code count is lower than 6, let me add this to the code.");
			level.code=level.code+""+i;
			level.codeCount++;
		}
		if(level.codeCount==6) //Change 3 with however long your code is
		{
			iprintln("The code count equal to 6, lets check if it is right.");
			if(level.code==536236) //Change 123 to whatever code you want
			{
				user iprintln ("Password Correct");
				platform = getent ("jm_lockover_no_door","targetname");
				wait(2);
				platform moveX (64,2,0.5,0.5);
				platform waittill ("movedone");
				wait(5);
				platform moveX (-64,2,0.5,0.5);
				platform waittill ("movedone");
			}
			else
			{
				iprintln("Password Denied");
			}
			level.codeCount=0;
			level.code="";
		}
	}
}
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests