More than one teleport... HOW?

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

Moderator: Core Staff

Post Reply
User avatar
whitee
CJ Wannabe
CJ Wannabe
Posts: 2
Joined: August 11th, 2011, 3:31 pm

More than one teleport... HOW?

Post by whitee » August 11th, 2011, 3:37 pm

Hey you may think im a noob but all of you were begginers in mapping sometimes...
Now for the question i can do one teleport (target/enter, targetname/something:D) but when i do the same with other teleport ( Not the targetname) it connects me 2 teleport enters with orange line.. When i want to test this map i dont get to teleport in 2nd teleport ( i can jump there and all but nothing happens) Do i need new script & how to do more than one teleport?



Thank you for answers! :)

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: More than one teleport... HOW?

Post by Goro92 » August 11th, 2011, 4:58 pm

Code: Select all

main()
{ 
  thread teleport1();
  thread teleport2();
 }
  
teleport1()
{   
    trigger = getent("teleport1","targetname");
 
    while(1)
  {
    trigger waittill("trigger", player);
    if(player isTouching(trigger)){
     player setOrigin( (x, y, z) );//cordinates
    
   }
  }
}
 
 
 
teleport2()
{   
   trigger = getent("teleport2","targetname");
 
  while(1)
 
    {
 
    trigger waittill("trigger", player);
    if(player isTouching(trigger)){
     player setOrigin( (x, y, z) );//cordinates
 
    }
  }
}
 
 
 
 
Image

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: More than one teleport... HOW?

Post by Rezil » August 11th, 2011, 5:24 pm

Code: Select all

if(player isTouching(trigger)){
Redundant. You are automatically touching a trigger_multiple(the type of trigger that should be used here) so checking if the player is touching it can be omitted. I would also suggest placing a script_origin in Radiant and then using its coordinates instead of manually adding them yourself.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Re: More than one teleport... HOW?

Post by <LT>YosemiteSam[NL] » August 11th, 2011, 5:50 pm

I just used this one for 1 teleport;

Code: Select all

main()
{

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


}

transporter()
{
  while(true)
  {
   self waittill("trigger",other);
   entTarget = getent(self.target, "targetname");
   wait(0.10);
   other setorigin(entTarget.origin);
   other setplayerangles(entTarget.angles);
   other playsound("playerspawn");
   wait(0.10);
  }
}
Can't see why just changing the naming wouldn't work.

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: More than one teleport... HOW?

Post by Goro92 » August 12th, 2011, 7:56 am

Rezil wrote:

Code: Select all

if(player isTouching(trigger)){
Redundant. You are automatically touching a trigger_multiple(the type of trigger that should be used here) so checking if the player is touching it can be omitted. I would also suggest placing a script_origin in Radiant and then using its coordinates instead of manually adding them yourself.

is it redundant also if i use a trigger_use?
Image

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: More than one teleport... HOW?

Post by waywaaaard » August 12th, 2011, 10:23 am

Use YosemiteSam's approach, when you are connecting the trigger with the script_origin and hit the key to connect (don't remember right now). The script_origin's name will be automatically target with an incremented number.
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: More than one teleport... HOW?

Post by Rezil » August 12th, 2011, 11:53 am

The same rules apply to a trigger_use as well. So, redundant.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

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

Re: More than one teleport... HOW?

Post by Drofder2004 » August 12th, 2011, 2:08 pm

serveaiuto wrote:is it redundant also if i use a trigger_use?
Trigger_use: Triggered by 'activation'
Trigger_multiple: Triggered by 'touch'
Trigger_damage: Triggered by 'damage'

isTouching() is a function used mainly for error checking and proximity checks.
For example, in MP it is used to make sure there are no HQ mapping errors (checks to make sure a radio is touching only one trigger) and it is also used with game objects to detect players continuous proximity to that object (such as bombzones and radios).

All triggers can be written to detect player trigger events:
trigger waittill("trigger", player);
trigger waittill("damage", amount, player); [Used for trigger_damage, to detect amount of damage caused]
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
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: More than one teleport... HOW?

Post by Goro92 » August 12th, 2011, 8:15 pm

Code: Select all

main()
{ 
  thread teleport1();
  thread teleport2();
 }
  
teleport1()
{  
    trigger = getent("teleport1","targetname");
    while(1)
 
  {
 
    trigger waittill("trigger", player);
 player setOrigin( (x, y, z) );//cordinates
  }}
 
 
teleport2()
{  
 
   trigger = getent("teleport2","targetname");
while(1)
 
    { 
 
    trigger waittill("trigger", player);
player setOrigin( (x, y, z) );//cordinates
 
  }
 
}
 
 
so

Code: Select all

if(player isTouching(trigger)){
is useless in this script?
Image

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

Re: More than one teleport... HOW?

Post by Drofder2004 » August 13th, 2011, 2:19 am

Yes.
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
whitee
CJ Wannabe
CJ Wannabe
Posts: 2
Joined: August 11th, 2011, 3:31 pm

Re: More than one teleport... HOW?

Post by whitee » August 19th, 2011, 1:00 pm

And how do i get coordinates of scrip_origin? : )

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

Re: More than one teleport... HOW?

Post by Drofder2004 » August 19th, 2011, 10:08 pm

entity getOrigin();
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 2 guests