Script help.

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

Moderator: Core Staff

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

Script help.

Post by zipperdude » October 14th, 2008, 7:49 pm

Does anyone know how to make the script for... like on nm_dual where u have to shoot the buttons in a certain order for the door or what ever happens to happen?
I wanna use taht in my map 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: Script help.

Post by Nightmare » October 15th, 2008, 12:52 am

It's a bit complicated and requires some good knowledge of scripting. Here are all the necessary parts you need.

Code: Select all

main()
{
   maps\mp\_load::main();

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

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

checkTrig(i)
{
   while(1)
   {
      self waittill("trigger",user);
      if(level.codeCount<3) //Change 3 with however long your code is.
      {
         level.code=level.code+""+i;
         level.codeCount++;
      }
      if(level.codeCount==3) //Change 3 with however long your code is
      {
         if(level.code==123) //Change 123 to whatever code you want
         {
                //Do Stuff Here
         }
         level.codeCount=0;
         level.code="";
      }
   }
}
Got 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]

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Script help.

Post by Soviet » October 15th, 2008, 12:59 am

lol, he is never going to understand that :P
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

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

Re: Script help.

Post by zipperdude » October 15th, 2008, 2:12 am

Soviet wrote:lol, he is never going to understand that :P
lol be quite lol.
I can always try. i have all the time in the world to figure it out. Plus im good at asking nm for help 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.

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

Re: Script help.

Post by JDogg » October 15th, 2008, 6:52 am

zipperdude wrote:
Soviet wrote:lol, he is never going to understand that :P
lol be quite lol.
I can always try. i have all the time in the world to figure it out. Plus im good at asking nm for help lol.
All the time in the world? How long is that?
Image
Image

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Script help.

Post by Soviet » October 15th, 2008, 2:41 pm

A few hundred billion years.
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

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

Re: Script help.

Post by Drofder2004 » October 15th, 2008, 9:59 pm

Mismatch of types! :P

if(level.code==123) <--- Integer
level.code=level.code+""+i; <--- String
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: Script help.

Post by Nightmare » October 15th, 2008, 10:15 pm

Not with the quake 3 scripting, that's the magic of it. :)
It automatically switches to the correct type without need for stating so. :D

Hence how when you declare a variable, you don't have to declare it's type.
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]

Soviet
Core Staff
Core Staff
Posts: 7760
Joined: April 23rd, 2005, 9:12 pm
Location: Plano, Texas
Contact:

Re: Script help.

Post by Soviet » October 15th, 2008, 10:29 pm

Well that is a week of Computer Science knowledge wasted :roll:
Image
ImageImageImage
Image
"Zaitsev is a cunt." - Pedsdude

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

Re: Script help.

Post by zipperdude » October 15th, 2008, 11:20 pm

I put my info in and it still doesnt do anything can someone help me?
Heres my script:

Code: Select all

main()
{
   maps\mp\_load::main();

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

      for(i=0;i<10;i++) 
   {
      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
	{
		door = getent("math_door_1","targetname");
		door rotatepitch(90, 2);
		door waittill("rotatedone");
		wait(5);
		door rotatepitch(-90, 2);
		door waittill("rotatedone");
         }
         level.codeCount==2;
         level.code="";
      }
   }
}
By the way... I have no knoledge of coding, C++ java or anything. I was taking a collage class on it but i quit to work full time for ups then they laid me off :(
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
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Script help.

Post by Drofder2004 » October 17th, 2008, 1:09 am

Nightmare wrote:Not with the quake 3 scripting, that's the magic of it. :)
It automatically switches to the correct type without need for stating so. :D

Hence how when you declare a variable, you don't have to declare it's type.
hmm, this may be so in vCoD, but not in CoD2/4, and generally. Its bad practice.
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: Script help.

Post by Nightmare » October 17th, 2008, 1:19 am

Drofder2004 wrote:
Nightmare wrote:Not with the quake 3 scripting, that's the magic of it. :)
It automatically switches to the correct type without need for stating so. :D

Hence how when you declare a variable, you don't have to declare it's type.
hmm, this may be so in vCoD, but not in CoD2/4, and generally. Its bad practice.
Meh, might as well take advantage of it. :D
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]

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

Re: Script help.

Post by JDogg » October 17th, 2008, 12:19 pm

Nightmare wrote:
Drofder2004 wrote:
Nightmare wrote:Not with the quake 3 scripting, that's the magic of it. :)
It automatically switches to the correct type without need for stating so. :D

Hence how when you declare a variable, you don't have to declare it's type.
hmm, this may be so in vCoD, but not in CoD2/4, and generally. Its bad practice.
Meh, might as well take advantage of it. :D
Lol, lazy :P.
Image
Image

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

Re: Script help.

Post by Nightmare » October 17th, 2008, 11:33 pm

Not exactly, just being efficient using the tools given. Pointless to change it's type when the game automatically does it for you.
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: Script help.

Post by zipperdude » October 18th, 2008, 6:17 am

:(
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests