Jump to content
  • 0

ACS Teleport isn't working


Question

Posted (edited)

Anyone know what the issue is here? I've been trying to get this working for hours now.

 

Below is my code in my ACS scripts window:

//teleport to a new area (starts inactive)
bool firedscript = TRUE;
script 20 (void)
{

if (!firedscript)  {
	Teleport(39, 39, "nosourcefog");
firedscript = true;
}
}

//inactive teleport is made active
Script 21 (void)
{
	firedscript = false;
}

The map is set up so that the teleport doesn't work at first. (script 20).  The player must find a switch to walk over on the floor (a simple linedef script activator) that activates "SCRIPT 21" (this script 21 is meant to activate script 20 - the teleporter - and make it active). Then the player is supposed to be able to walk onto the teleporter triggering it to take him to a new area (a sector tagged 39 with a map-spot of 39). However, it simple does not work. The linedef is crossed to make the teleporter active, but when the player returns to it to use it, it simply doesn't work. I have tried everything it seems, from using a teleport destination THING tagged 39 to a map spot tagged 39 (both of which placed in the sector also tagged 39) but nothing is working. What am I doing wrong here?

 

EDIT: When I move the player start to the location the teleport is supposed to take you, the player can activate it from the other end on the way back but not on the way FORWARD as intended. What on Earth is going on?

Edited by Cacodoomonic

Share this post


Link to post

13 answers to this question

Recommended Posts

  • 0
Posted (edited)

Take my opinion with a grain of salt on this.

 

It seems to me that you have overcomplicated the Teleport actions since teleports don't need ACS to function properly. You can probably achieve the same type of result using a door and closet to the teleporter. VERTICAL lifts can act a door: This exact mechanic is used in Doom 2 map COURTYARD in the room with health bonuses and Blue Skull, where the switch raises stairs to the Teleport linedef..

Edited by kalensar

Share this post


Link to post
  • 0

It's a good method, Courtyard was amazing with how it utilzed things like this. The main issue with my one is that it works in line with portals and staircases. Basically, the teleport is at the foot of the stairs (inactive). It only activates after going upstairs and doing what you have to do so when you come back down, it is now active and you cannot avoid crossing it to get back down. The stairs use a portal linedef to create the illusion of an upstairs which is really somewhere else on the map. It makes it look seamless. But the teleport is invisible, so when you come back down you do not realize that you have been teleported to a duplicate area that is ever so slightly different. If that makes sense. But it seems to not work on the way back down, despite being activated from upstairs (the portal illusion upstairs) and lets you cross the teleporter unaffected. However, if going from the duplicate area up it only works on that side.

Share this post


Link to post
  • 0
19 minutes ago, Cacodoomonic said:

eleported to a duplicate area that is ever so slightly different.

 

 

Yup! TNT Evilution does a similar gimmick on the map Wormhole.

Share this post


Link to post
  • 0
6 hours ago, Cacodoomonic said:

It's a good method, Courtyard was amazing with how it utilzed things like this. The main issue with my one is that it works in line with portals and staircases. Basically, the teleport is at the foot of the stairs (inactive). It only activates after going upstairs and doing what you have to do so when you come back down, it is now active and you cannot avoid crossing it to get back down. The stairs use a portal linedef to create the illusion of an upstairs which is really somewhere else on the map. It makes it look seamless. But the teleport is invisible, so when you come back down you do not realize that you have been teleported to a duplicate area that is ever so slightly different. If that makes sense. But it seems to not work on the way back down, despite being activated from upstairs (the portal illusion upstairs) and lets you cross the teleporter unaffected. However, if going from the duplicate area up it only works on that side.

 

I did something similar to that on my "More Tricks and Traps than you Require" map. On that one, I had a section which were the lines were not visible on the map, and after the player did something, it slightly shifted some things so that the way they came had raised up and another section had lowered, so they crossed over a different teleporter line and ended up in a similar-looking place. None of the playtesters noticed that the path they came in on was slightly different. HOWEVER, there were no enemies along that path so no bodies or blood/bullet decals to give it away.

 

Perhaps a similar trick could work here, where something shifts just slightly and the path you leave is not quite the same as how you entered.

Share this post


Link to post
  • 0

Thanks for the methods. 

 

On 6/8/2024 at 2:14 PM, kalensar said:

 

 

Yup! TNT Evilution does a similar gimmick on the map Wormhole.

How did they achieve this using regular teleporters? I cannot find a way to do this without the script I wrote up... regular teleporters (silent) do not seem to have an option to make them inactive by default then become active later.

 

On 6/8/2024 at 8:36 PM, Stabbey said:

 

I did something similar to that on my "More Tricks and Traps than you Require" map. On that one, I had a section which were the lines were not visible on the map, and after the player did something, it slightly shifted some things so that the way they came had raised up and another section had lowered, so they crossed over a different teleporter line and ended up in a similar-looking place. None of the playtesters noticed that the path they came in on was slightly different. HOWEVER, there were no enemies along that path so no bodies or blood/bullet decals to give it away.

 

Perhaps a similar trick could work here, where something shifts just slightly and the path you leave is not quite the same as how you entered.

This is very clever and creative. I've had a little look around my map but unfortunately there isn't really a way I can pull this off due to the layout being based on a house design with pretty narrow staircases. My only real option in this particular level is to have an inactive teleport on the same route back that becomes active. But I cannot get it to work.

Share this post


Link to post
  • 0

What if the teleport command is itself inside a script which checks a global variable that only gets set after the thing you want is done? The script will run every time you cross the line, but with an if statement checking if the flag is active, it will only go into the relevant code at the appropriate time?

Share this post


Link to post
  • 0
Posted (edited)
1 hour ago, Cacodoomonic said:
On 6/8/2024 at 7:14 AM, kalensar said:

Yup! TNT Evilution does a similar gimmick on the map Wormhole.

How did they achieve this using regular teleporters? I cannot find a way to do this without the script I wrote up... regular teleporters (silent) do not seem to have an option to make them inactive by default then become active later.

 

 

 Well there some differences between your goal and what Wormhole does. I took some pics of the Teleporter stats in the map editor

 

Spoiler

1315775633_Screenshotfrom2024-06-1014-17-38.png.859138a0cac2595589a531ccd5eb914e.png 1587770987_Screenshotfrom2024-06-1014-18-40.png.51e234adacfd6e1f9327fc4ebf907e73.png

Spoiler

1789416530_Screenshotfrom2024-06-1014-22-42.png.ad621129e1672c9120d7eaf0ebe6131d.png

So the main difference is definitely location. The Wormhole teleporter is hidden off by its lonesom, and it can be crossed from both directions,

TNT Map04 So you can fiddle with it.

 

Another trick that is slightly similar your dynamic teleporter is the e1m2 Chainsaw. The switch there lowers the green nukage damage floor and replaces with tech base floor and the pillar also lowers from the same switch.

My thought processon the e1m2 example is you can put different action tags, eg When the Nukage gets covered you wont take damage from the tech base floor even though they sorta exist in the same location.

Edited by kalensar

Share this post


Link to post
  • 0
//teleport to a new area (starts inactive)
bool firedscript = TRUE;
script 20 (void)
{

if (!firedscript)  {
	Teleport(39, 39, "nosourcefog");
//I'm pretty sure the script is teleporting a thing tagged 39 to sector? 39 without fog.
//For the player to teleport it has to be set to the player's ID (if you've changed it with another script)
//or 0 for the activator of the script.
//ZDOOMWiki example: 39:W1 Teleport	Teleport(0, tag)	Player Cross, Monsters Activate
firedscript = true;
}
}

//inactive teleport is made active
Script 21 (void)
{
	firedscript = false;
}

I would suggest setting up the teleport line without an activator then giving your secondary line an action to execute a SetLineActivation script.
That would look like this:
 

//In place of the line below with the Teleport script you're using now.
//Teleport(39, 39, "nosourcefog");
//Use instead:
SetLineActivation(X, SPAC_Cross);
//X is the tag of the line.

 

Share this post


Link to post
  • 0
Posted (edited)
1 hour ago, DeetOpianSky said:

//teleport to a new area (starts inactive)
bool firedscript = TRUE;
script 20 (void)
{

if (!firedscript)  {
	Teleport(39, 39, "nosourcefog");
//I'm pretty sure the script is teleporting a thing tagged 39 to sector? 39 without fog.
//For the player to teleport it has to be set to the player's ID (if you've changed it with another script)
//or 0 for the activator of the script.
//ZDOOMWiki example: 39:W1 Teleport	Teleport(0, tag)	Player Cross, Monsters Activate
firedscript = true;
}
}

//inactive teleport is made active
Script 21 (void)
{
	firedscript = false;
}

I would suggest setting up the teleport line without an activator then giving your secondary line an action to execute a SetLineActivation script.
That would look like this:
 


//In place of the line below with the Teleport script you're using now.
//Teleport(39, 39, "nosourcefog");
//Use instead:
SetLineActivation(X, SPAC_Cross);
//X is the tag of the line.

 

Thank you again for all these great responses. In response to this quote, I'm a little confused how to utilize this. This seems like it may do the trick but I've tried it and nothing happens. Where exactly does that SLA go? And how does it know to become a teleport? I've tried setting the SLA in the script that activates the script, but it didn't work and when using it as a replacsment for the Teleport code, it doesn't know to become a teleport. How do I set up the line without an activator? Isn't it a teleport by default? So sorry, I'm a bit lost on this one.

 

EDIT: This is what I have set up.

//Teleport linedef
script 20 (void)
{
	Teleport(0, 39, "nosourcefog");
}

//Activate teleport linedef.
Script 21 (void)
{
	SetLineActivation(39,SPAC_Cross);
}

So I set it up that crossing a certain line in the "upstairs" section (script 21) activates the teleport "downstairs" (script 20).

 

This is still not working. I have no idea what I'm doing wrong. I also tried it the other way but then it didn't even know to become a teleporter. What am I missing here? The wiki page didn't yeild much help on this issue either.

Edited by Cacodoomonic

Share this post


Link to post
  • 0

First off, script 20 only has a single action (Teleport) which already exists as a predefined line action (70), so there's no point rewriting it as a script unless you're adding other actions to happen alongside the teleport inside the same script. If not, just remove that script and use line action 70 instead.

 

On 6/11/2024 at 1:29 AM, Cacodoomonic said:

This is still not working.

The first arg of SetLineActivation should be the tag of the lines being made activatable, not the destination thing. SetLineActivation doesn't know or care anything about the teleport action, only what lines to give activation flags to. Currently it's told that a line with a tag 39 should be made activatable with SPAC_Cross, but since there's no such line, nothing will happen.

 

On 6/11/2024 at 1:29 AM, Cacodoomonic said:

it didn't even know to become a teleporter

SetLineActivation will only set the activation method of your line, not the action itself. So make sure that the teleport lines have the Teleport action set, but leave the activation method empty (no boxes ticked). Also make sure these lines have a tag so that SetLineActivation knows what lines to activate.

 

Also, if you want the action to be repeatable, add a positive number (like 1) as a third argument to SetLineActivation (see the wiki article).

Share this post


Link to post
  • 0
Posted (edited)
On 6/14/2024 at 2:13 PM, Aurelius said:

First off, script 20 only has a single action (Teleport) which already exists as a predefined line action (70), so there's no point rewriting it as a script unless you're adding other actions to happen alongside the teleport inside the same script. If not, just remove that script and use line action 70 instead.

 

The first arg of SetLineActivation should be the tag of the lines being made activatable, not the destination thing. SetLineActivation doesn't know or care anything about the teleport action, only what lines to give activation flags to. Currently it's told that a line with a tag 39 should be made activatable with SPAC_Cross, but since there's no such line, nothing will happen.

 

SetLineActivation will only set the activation method of your line, not the action itself. So make sure that the teleport lines have the Teleport action set, but leave the activation method empty (no boxes ticked). Also make sure these lines have a tag so that SetLineActivation knows what lines to activate.

 

Also, if you want the action to be repeatable, add a positive number (like 1) as a third argument to SetLineActivation (see the wiki article).

Thank you so much for this amazing detailed description. The teleport trap now works exactly as intended, thank you so much. However I do have one issue still with the repeatable action. I tried doing this based on what you said and the article link: 

 

Script 21 (void)
{
	//firedscript = false;
	SetLineActivation(50,SPAC_Cross|SPAC_UseBack|1);
}

Because I need this to be a repeatable action. But it's not working. It only seems to work the first time, then when cross back past it nothing happens. I put the 1 in the third argument but it seems to have no effect?

 

EDIT: I was able to achive the same thing by only ticking the "action is repeatable" box. 

Edited by Cacodoomonic

Share this post


Link to post
  • 0
1 hour ago, Cacodoomonic said:

I put the 1 in the third argument but it seems to have no effect?

Function arguments are separated by commas. You only have one comma, so you've only set two arguments, not three. By default, the optional third argument is set to -1, which means whatever the line itself is set to. That's why the action was not repeatable until you toggled the "Repeatable" flag. Replace the second bitwise OR with a comma to make 1 the third argument of the function, or remove it entirely and set the line itself repeatable. Either way works.

 

Share this post


Link to post
  • 0
7 hours ago, Aurelius said:

Function arguments are separated by commas. You only have one comma, so you've only set two arguments, not three. By default, the optional third argument is set to -1, which means whatever the line itself is set to. That's why the action was not repeatable until you toggled the "Repeatable" flag. Replace the second bitwise OR with a comma to make 1 the third argument of the function, or remove it entirely and set the line itself repeatable. Either way works.

 

Ahhh yes I didn't notice that, thank you. Thanks a ton for helping me to get this to work and thanks also to everyone else who helped me in this thread. So much appreciation to you all. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...