More than one teleport... HOW?
Moderator: Core Staff
More than one teleport... HOW?
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!
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!
Re: More than one teleport... HOW?
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
Â
   }
 }
}
Â
Â
Â
Â
-
- 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?
Code: Select all
if(player isTouching(trigger)){
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.
[...]
#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.
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: More than one teleport... HOW?
I just used this one for 1 teleport;
Can't see why just changing the naming wouldn't work.
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);
}
}
Re: More than one teleport... HOW?
Rezil wrote: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.Code: Select all
if(player isTouching(trigger)){
is it redundant also if i use a trigger_use?
-
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
Re: More than one teleport... HOW?
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
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
-
- 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?
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.
[...]
#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.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: More than one teleport... HOW?
Trigger_use: Triggered by 'activation'serveaiuto wrote:is it redundant also if i use a trigger_use?
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]
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
Re: More than one teleport... HOW?
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
}
}
Code: Select all
if(player isTouching(trigger)){
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: More than one teleport... HOW?
Yes.
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
Re: More than one teleport... HOW?
And how do i get coordinates of scrip_origin? : )
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: More than one teleport... HOW?
entity getOrigin();
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
Who is online
Users browsing this forum: No registered users and 2 guests