Teleport player

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

Teleport player

Post by Dancso »

Hi.
I'm having problems with using the code "teleport"
I make it like " teleport(3); " but when my script reaches that part, i dont get teleported the the teleport destination thing with the TID of 3. am i using this feature right?

Can anyone help?
jobro
Posts: 206
Joined: Sat Dec 30, 2006 1:56 pm

Post by jobro »

It is because you're most likely are teleporting player 4. Dunno for sure tho.

Check here:

http://www.zdoom.org/wiki/index.php?title=Teleport
User avatar
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

Post by Dancso »

jobro wrote:It is because you're most likely are teleporting player 4. Dunno for sure tho.

Check here:

http://www.zdoom.org/wiki/index.php?title=Teleport
yes, ive looked at that, but i must be pretty dumb or something, but that says it has 3 parameters(arguements or what) but doombuilder only says it has 1.
why would it teleport player 4? it says that command applies on activator, so its the player that activates the script.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

[wiki]Teleport[/wiki] takes 3 arguments: TID, TAG, and NoSourceFog. It teleports the activator.

TID can be a TID, or 0. If it is a TID, the player will teleport to the destination spot with a TID of 3.

TAG can be a sector tag, or 0. If it is non-zero, the player will teleport to the first teleport destination found in the tagged sector.

If both TID and TAG are non-zero, the player will teleport to the thing with the matching TID in the sector with the matching tag. If there are more than one valid destinations with the same TID, a destination will be selected at random.

If NoSourceFog is 1, the teleport flash doesn't appear where the activator was.

You can correct the DoomBuilder definition by editing ACS.cfg in your DoomBuilder folder. Find this line:
Teleport = "Teleport(tid)";
Change it to this:
Teleport = "Teleport(tid, tag, nosourcefog)";
Just FYI, it doesn't matter if DoomBuilder is wrong. You can just ignore what it's telling you and put the correct arguments in. What matters is that ACC regonizes the function and compiles it.

If you've set it up how you said you have then it should be working. Make sure that the player (not the world) is the activator of the script. This is the case when the script is activated by the player using a line/sector, when they walk over the trigger line, shoot the trigger line, or when the script type is an ENTER script. It does not work in OPEN scripts, which are activated by the world and not a particular actor.

If it still doesn't work, post the map so we can take a look at it.
User avatar
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

Post by Dancso »

Ty fot the reply, unfortunately, i tired it and it didnt work somehow, and the script is a "(void)" and it's activated by a line when you walk across.
I made it like this: " teleport(3,0,0); "(without quotes of course)
i also put a teleport destination with the TID of 3.

(i'm makin it for my brother lol. the messages(prints) are in hungarian)
If you have a look at it, first you need to go to the chair to activate the script. then there will be a cutscene, lol the computer gets a virus rofl and you get teleported into the computer. There is a camera put inside it, so you will see it too. that's where i want to teleport.
Anyways, here's the wad:
http://kdany.extra.hu/BD.wad
(had to put it on my website, cuz its too big to attach(half mb~)
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Post by Macil »

Are you sure there is a mapspot or a teleport spot with a tid of 3?
jobro wrote:It is because you're most likely are teleporting player 4. Dunno for sure tho.
Ugh... where did you get the idea of player 4 from? If there's no player 4, you can't do anything to it.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

So what's the problem? The map works just fine for me.

[edit]Nevermind, the reason it ran is because I was running it out of DoomBuilder which was recompiling the behavior lump. The problem isn't in your script, it's that your ACC is out of date.

Get the latest version and extract it to your DoomBuilder folder, then resave the map.
User avatar
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

Post by Dancso »

HotWax wrote:So what's the problem? The map works just fine for me.

[edit]Nevermind, the reason it ran is because I was running it out of DoomBuilder which was recompiling the behavior lump. The problem isn't in your script, it's that your ACC is out of date.

Get the latest version and extract it to your DoomBuilder folder, then resave the map.
OMG i really dont know whats the problem, cuz i already had the newest version of ACC. i also tried with normal Zdoom now, as i ran it first with GZdoom, but it didnt help either. wtf?

EDIT: Oh my god, LOL! I really dont know what i did, but the code DID work now! yay ty hor the help. (I just hope nothing wrecks it again) weird thing, but im glad it worked.:)
EDIT2: ROFL sometimes it work, sometimes not. weird
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

The problem is that the player has to be moving to be teleported. I don't know
why this is. Perhaps a zdoom bug?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Ooh, I just remembered something. IIRC, Teleport doesn't teleport the player if they crossed the triggering line from the backside. This is an intentional feature so that you can create two-way teleporters with Teleport actions on all the lines and the player will be able to step off the teleport pad without being ported back to the other.

Try using a different teleport function instead. Or better yet, just place the ACS_Execute action on all the bordering lines of the "chair" and make sure they all face outward so the player has to cross the front of a line to trigger the script.
User avatar
Dancso
Posts: 1906
Joined: Wed Oct 11, 2006 10:39 am
Location: at home.. Status: lazy like hell

Post by Dancso »

HotWax wrote:Ooh, I just remembered something. IIRC, Teleport doesn't teleport the player if they crossed the triggering line from the backside. This is an intentional feature so that you can create two-way teleporters with Teleport actions on all the lines and the player will be able to step off the teleport pad without being ported back to the other.

Try using a different teleport function instead. Or better yet, just place the ACS_Execute action on all the bordering lines of the "chair" and make sure they all face outward so the player has to cross the front of a line to trigger the script.
Are there other teleport functions? i mean only teleport(int, int, int) can be applied on the activator player. no? Nevermind, i showed it to my brother, cuz my time has ellapsed, and he was crossing the line from the good direction, so it worked for him. yay. :) ty for the help and for telling me that the player must cross the line from its front, so in my future projetcs, i wont be having any problems with this.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Dancso wrote:Are there other teleport functions?
Yes... Yes there are.
Locked

Return to “Editing (Archive)”