Page 1 of 1

Tele links

Posted: Tue May 29, 2012 3:44 pm
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.

Re: Tele links

Posted: Tue May 29, 2012 3:58 pm
by joevano

Re: Tele links

Posted: Tue May 29, 2012 4:26 pm
by Tank Terminator
Thank you!

Re: Tele links

Posted: Tue May 29, 2012 5:16 pm
by Tank Terminator
Hmm, but there is a question , what if i want the tele from both sides, is it tele1:f:b ??

Re: Tele links

Posted: Tue May 29, 2012 5:32 pm
by JeffM
That link tells you all that you need. Read it over.

Re: Tele links

Posted: Tue May 29, 2012 5:38 pm
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.

Re: Tele links

Posted: Tue May 29, 2012 5:43 pm
by Tank Terminator
Thanks mahem! And don't worry about hijacking MY topic :P

Re: Tele links

Posted: Tue May 29, 2012 6:10 pm
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.

Re: Tele links

Posted: Tue May 29, 2012 6:40 pm
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.

Re: Tele links

Posted: Tue May 29, 2012 8:03 pm
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.

Re: Tele links

Posted: Thu Jul 12, 2012 9:27 pm
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.

Re: Tele links

Posted: Thu Jul 12, 2012 11:04 pm
by blast
That's neat. I wasn't aware of that syntax.

Re: Tele links

Posted: Thu Jul 19, 2012 2:59 am
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.

Re: Tele links

Posted: Thu Jul 19, 2012 8:12 am
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)

Re: Tele links

Posted: Thu Jul 19, 2012 10:55 pm
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