teleporters (but different)

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

Moderator: Core Staff

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

teleporters (but different)

Post by Pedsdude » August 23rd, 2006, 12:19 am

OK, I have a trigger_use switch that I want to activate a teleporter. The teleporter will teleport anyone inside the specific trigger_multiple to a set location. I have the following code, but it doesn't work (because it has 'user' in it).

Code: Select all

main()
{
   thread telesecret1();
}

telesecret1()
{
sectrig1 = getent("sectrig1","targetname");
trigger1 = getent("sectrigg1","targetname");
while(1)
   {
   sectrig1 waittill ("trigger1",user);
      user iprintlnbold("Teleport secret1 Activated!");
   loc[0] = (-854,125,6); 
   user setOrigin(loc[randomInt(loc.size)]); 
      wait 0.5;
   }
}
sectrig1 is the trigger_use to start it, sectrigg1 is the trigger_multiple in which people will be teleported from.

Any help? I'm aware that "user setOrigin(loc[randomInt(loc.size)]);" sets it for the person who triggered it, but at the same time I doubt it would work if I got rid of the user and just had setOrigin.
Image
Image

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 23rd, 2006, 1:09 am

dont think its possible with a trigger_multiple try with: script_origin with targetname sectrigg1
and

Code: Select all

sectrig1 waittill ("trigger1",user);
i think that should be

Code: Select all

sectrig1 waittill ("trigger",user);
(can be wrong)

ahh i was thinking u ment: teleport TO trigger_multiple
Last edited by creator on August 23rd, 2006, 1:30 am, edited 1 time in total.
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » August 23rd, 2006, 1:28 am

Nice idea. try this...

Code: Select all

main()
{
   thread telesecret1();
}

telesecret1()
{
use = getent("sectrig1","targetname");

multiple = getent("sectrigg1","targetname");

//You actually do not need to use a trigger
//You can use a script_brushmodel using "nodraw_notsolid" texture (probably a better idea)

// Locations Here
loc[0] = (-854,125,6);
//loc[1] = (x, y, z);

while(1)
   {
   use waittill ("trigger1",user);
      user iprintlnbold("Teleport Secret 1 Activated!");
   
   players = getentarray("players","classname");   
   for(i=0;i<players.size;i++)
   {
      if(players[i] isTouching(multiple))
         players[i] setOrigin(loc[randomInt(loc.size)]);
   }
   }
}
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 23rd, 2006, 1:32 am

drofder i know its not related to this well actully.. alittle ( loc )
is it possible to let a platform more to a location like in coordinants not in how many units go up down right left and those?
Cod 1 Mapper&Modder&Moddeler

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

Post by Pedsdude » August 23rd, 2006, 1:34 am

Is there anything you don't know Drofder? :D Will try it now!
Image
Image

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 23rd, 2006, 1:36 am

i dont think he knows the awnser to my question hehe :P (sry could not stop my self :P )
Cod 1 Mapper&Modder&Moddeler

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

Post by Drofder2004 » August 23rd, 2006, 2:47 am

creator wrote:drofder i know its not related to this well actully.. alittle ( loc )
is it possible to let a platform more to a location like in coordinants not in how many units go up down right left and those?
platform moveTo(<location>, <time>);
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

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » August 23rd, 2006, 12:04 pm

thats also units right....? not location
Cod 1 Mapper&Modder&Moddeler

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

Post by Pedsdude » August 23rd, 2006, 3:30 pm

It doesn't seem to work...

Code: Select all

main()
{
   thread telesecret1();
   thread telesecret2();
}

telesecret1()
{
use = getent("sectrig1","targetname");
multiple = getent("sectrigg1","targetname");
//You actually do not need to use a trigger
//You can use a script_brushmodel using "nodraw_notsolid" texture (probably a better idea)
// Locations Here
loc[0] = (-2,2,2);
//loc[1] = (x, y, z);
while(1)
   {
   use waittill ("trigger",user);
      user iprintlnbold("Teleport Secret 1 Activated!");
      players = getentarray("players","classname");   
   for(i=0;i<players.size;i++)
   {
      if(players[i] isTouching(multiple))
         players[i] setOrigin(loc[randomInt(loc.size)]);
   }
   }
}

telesecret2()
{
use = getent("sectrig2","targetname");
multiple = getent("sectrigg2","targetname");
//You actually do not need to use a trigger
//You can use a script_brushmodel using "nodraw_notsolid" texture (probably a better idea)
// Locations Here
loc[0] = (-2,2,2);
//loc[1] = (x, y, z);
while(1)
   {
   use waittill ("trigger",user);
      user iprintlnbold("Teleport Secret 2 Activated!");
      players = getentarray("players","classname");   
   for(i=0;i<players.size;i++)
   {
      if(players[i] isTouching(multiple))
         players[i] setOrigin(loc[randomInt(loc.size)]);
   }
   }
}
Please modify :)
Image
Image

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

Post by Drofder2004 » August 23rd, 2006, 3:38 pm

What doesnt work?

Any errors?

Have you tested this with only 1 of those 2 threads running.
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

Post by Pedsdude » August 23rd, 2006, 3:41 pm

KillerSam wrote:Only tested with both, the only error is...nobody teleports :S
Yep. It comes up with the message, but other than that nothing appears to happen (nobody gets teleported).
Image
Image

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

Post by Pedsdude » August 23rd, 2006, 4:02 pm

Tested with 1 and it didn't work.
Image
Image

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

Post by Drofder2004 » August 23rd, 2006, 4:06 pm

The you should try using some simple debug mehtods...

Code: Select all

main()
{
   thread telesecret1();
}

telesecret1()
{
use = getent("sectrig1","targetname");
multiple = getent("sectrigg1","targetname");

loc[0] = (-2,2,2);
iprintln("Loc[0]: " + loc[0]); // DEBUG

while(1)
   {
   use waittill ("trigger",user);

      iprintln("USE TRIGGER"); // DEBUG

      user iprintlnbold("Teleport Secret 1 Activated!");
      players = getentarray("players","classname");  

      iprintln("PLAYERS: " + players.size); // DEBUG 

   for(i=0;i<players.size;i++)
   {
      if(players[i] isTouching(multiple))
      {
         players[i] setOrigin(loc[randomInt(loc.size)]);
         players[i] iprintln("You should have moved");  // DEBUG
      }
      else
         players[i] iprintln("You are not touching 'multiple'"); // DEBUG
   }
   }
}
It may be the use of set origin. Just use that above ONLY.
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

Post by Pedsdude » August 23rd, 2006, 4:38 pm

Testing now...
Image
Image

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

Post by Pedsdude » August 23rd, 2006, 6:02 pm

Didn't work. It said "PLAYERS: 0" and went no further, despite that fact that I was in the trigger area while KS pressed use on the other trigger. I even tried it with a script_brushmodel of the same targetname with the nodraw_nosolid texture.
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests