Tele links

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Tank Terminator
Private First Class
Private First Class
Posts: 47
Joined: Tue Mar 27, 2012 2:41 pm

Tele links

Post by Tank Terminator »

Hello all!! I am about to finish my second map (not really, first isn't finished), and i don't know how to link teles!! Can anyone give me the code?? Should it be something like this:

Code: Select all

teleporter
name tele1
position 0 0 0
size 10 10 10
end

teleporter
name tele2
postition 10 10 23
size 23 45 6
end

link
from tele 1 
to tele 2 :f 

Do not wonder how i knew most of the thing, its just i searched the forum and the wiki, and this is all i can get.
Tank Terminator, BZFlag Player
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Tele links

Post by joevano »

There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
Tank Terminator
Private First Class
Private First Class
Posts: 47
Joined: Tue Mar 27, 2012 2:41 pm

Re: Tele links

Post by Tank Terminator »

Thank you!
Tank Terminator, BZFlag Player
User avatar
Tank Terminator
Private First Class
Private First Class
Posts: 47
Joined: Tue Mar 27, 2012 2:41 pm

Re: Tele links

Post by Tank Terminator »

Hmm, but there is a question , what if i want the tele from both sides, is it tele1:f:b ??
Tank Terminator, BZFlag Player
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Tele links

Post by JeffM »

That link tells you all that you need. Read it over.
ImageJeffM
User avatar
mahem1
Private First Class
Private First Class
Posts: 91
Joined: Thu Jan 14, 2010 2:18 am
Location: Antarctica

Re: Tele links

Post by mahem1 »

Simply use more than one link. In the first link link the front to wherever and in the second link the back to wherever.

Also could I ask, how do you link teleporters that are in a group.
And the wiki is pretty vague about the '*' character in links. How does that character work?
Sorry If am hijacking this topic, maybe I should stick to the "topics are cheap" principle.
Lag makes me miss all of the good stuff.
And random bans..........
Image
User avatar
Tank Terminator
Private First Class
Private First Class
Posts: 47
Joined: Tue Mar 27, 2012 2:41 pm

Re: Tele links

Post by Tank Terminator »

Thanks mahem! And don't worry about hijacking MY topic :P
Tank Terminator, BZFlag Player
User avatar
SkillDude
Private First Class
Private First Class
Posts: 336
Joined: Sun Apr 01, 2007 4:50 pm
Location: United States

Re: Tele links

Post by SkillDude »

mahem1 wrote:how do you link teleporters that are in a group.
mahem1 wrote:And the wiki is pretty vague about the '*' character in links. How does that character work?
You have to know a bit about wildcard characters to understand that. A "*" character means anything that can fit with the other specified parameters make a match.

Here is an example: Let us say you have seven teleporters named the following:

Code: Select all

teleporter1
tele
teleporter2
Fred
tower_top
tower_bottom
teleporterer
Now, if we wanted to link tele to teleporter2, we would do something like this:

Code: Select all

link
from tele:f
to teleporter2:f
end
Simple enough, right? Now what if we wanted to have it choose between teleporter1 or teleporter2 randomly? We could easily do this:

Code: Select all

link
from tele:f
to teleporter*:f
end
Or this:

Code: Select all

link
from tele:f
to teleporter?:f
end
In the first example, teleporter* will take anything with the word teleporter in it, and anything after the word teleporter will be considered. This makes teleporter1, teleporter2, and teleporterer all matches. In the second example, a "?" character is used to make only one valid character match. This means only teleporter1 and teleporter2 would be considered. The equivalent for teleporterer to work would be a match like this: teleporter?? which would only select teleporters with two exact characters.

This may sound complicated, but let's see one more:

Code: Select all

link
from tele:f
to *re*:f
end
In this one, the two asterisks will expand for anything before and after re. Teleporters Fred and Teleporterer could be selected.

One final note is that teleporter links are only determined On map startup. This means once they are picked between a select number of teleporters, it will always teleport you to the same spot until the map is restarted, so the randomness can only be taken so far.

As far as linking teleporters in groups, that is impossible. Even naming them inside of groups and linking them is not possible. All teleporters must be separate and have their own unique names outside of a group in order to work correctly.
User avatar
mahem1
Private First Class
Private First Class
Posts: 91
Joined: Thu Jan 14, 2010 2:18 am
Location: Antarctica

Re: Tele links

Post by mahem1 »

Thanks for the info sig.
Could this be added to the wiki please. (I would do it if you want) Or is it common knowledge that '*' and '?' are multi and single character wildcards?
Also it is misleading to say that teleports can be defined in groups (http://wiki.bzflag.org/Define) without saying that linking them is impossible.
Lag makes me miss all of the good stuff.
And random bans..........
Image
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Tele links

Post by blast »

I don't think linking them is impossible, but you'd have to probably leave their names out of them and use their automatically generated index instead.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
ahs3
Private First Class
Private First Class
Posts: 327
Joined: Sun Mar 04, 2007 8:33 pm
Location: Press '/' to search
Contact:

Re: Tele links

Post by ahs3 »

Teleporter linking inside a define:

Code: Select all

define blah


teleporter tele
position 0 0 0
size .125 10 10
border 1.5
end

enddef #blah


group blah
name green #important part
shift 200 200 0
end

group blah
name red  #important part
shift -200 -200 0
end

link 
from green:tele:*
to red:tele:*
end

link
from red:tele:*
to green:tele:*
end
Be sure to name your groups.
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Tele links

Post by blast »

That's neat. I wasn't aware of that syntax.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
mahem1
Private First Class
Private First Class
Posts: 91
Joined: Thu Jan 14, 2010 2:18 am
Location: Antarctica

Re: Tele links

Post by mahem1 »

That is very helpful, thanks for the share. I'll assume it works for nested groups too.
Also, where did you gather that information? It would be help if it was more widely available.
Lag makes me miss all of the good stuff.
And random bans..........
Image
User avatar
SkillDude
Private First Class
Private First Class
Posts: 336
Joined: Sun Apr 01, 2007 4:50 pm
Location: United States

Re: Tele links

Post by SkillDude »

Usually it ends up being look in the source code for the nitty gritty. A collaborative effort to document things down to the nitty gritty of BZFlag would be amazing. (That's what the wiki's for by the way)
User avatar
ahs3
Private First Class
Private First Class
Posts: 327
Joined: Sun Mar 04, 2007 8:33 pm
Location: Press '/' to search
Contact:

Re: Tele links

Post by ahs3 »

sigonasr2 wrote:Usually it ends up being look in the source code for the nitty gritty. A collaborative effort to document things down to the nitty gritty of BZFlag would be amazing. (That's what the wiki's for by the way)
I agree sigonasr2, I have edited the link page on the wiki. To state the information shown here.

http://wiki.bzflag.org/Link
Post Reply