Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
PepsiBepsi

Thing_Move not working

Question

I've been trying to get a script to teleport the player to a map spot after a certain amount of time. I've tried Teleport, TeleportOther, TeleportInSector, TeleportNoFog, and now  finally Thing_Move and nothing is working. 

 

Here's my script

script 2 OPEN
{
	Delay(70);
	Thing_Move(7, 4, 0); // 7 is the tid of the Player, 4 is a map spot that I want the player be teleported to.
}

Any suggestions?

 

Edit: (I can't reply for some reason so I'll just post this in an edit) It still doesn't work after fixing the order of the arguments. Anyway I appreciate the help, I'll just have to mess around with tags and stuff because something else must be wrong with the map.

 

Edit: I voted up all your answers because they all contributed to the final solution. Thanks for all the help, It would've taken me forever to figure it out on my own. For anyone with the same problem, this is what I ended up doing...

#define PLAYER_TID_START 300
script 2 ENTER
{
	Thing_ChangeTID(0,PLAYER_TID_START+PlayerNumber());
	Delay(70);
	ACS_Execute (3, 1); //3 means "Script 3", 2 means "Map02". If you are making Map09 - make (3, 9).
}

script 3(void)
{
	Teleport(4, 4, 0); // The first argument is the tid of the teleport destination, the second argument is the tag of the destination sector, and the 0 is so that nofog is false.
}

 

 

Edited by PepsiBepsi

Share this post


Link to post

11 answers to this question

Recommended Posts

  • 1
4 hours ago, PepsiBepsi said:

I've been trying to get a script to teleport the player to a map spot after a certain amount of time. I've tried Teleport, TeleportOther, TeleportInSector, TeleportNoFog, and now  finally Thing_Move and nothing is working. 

Funny thing, I had the SAME problem 12 hours ago. And I've fixed it.

 

THE MAIN REASON WHY YOUR SCRIPT IS NOT WORKING - BECAUSE ACS IS FREAKING STUPID. I'll explain:

 

You're using script OPEN, so that means, that your player must be teleported after the start of the map. Somehow ZDoom/GZDoom doesn't understand Teleport/TeleportOther for the OPENed scripts. You should abuse the ACS mechanics to make them work.

 

Just make ANOTHER script, for example - "Script 3 (Void)" with TeleportOther and in "Script 2 OPEN" type "ACS_Execute (3, 1);". And this will work. Heh.

 

Full list of steps here:

1) Place TELEPORT DESTINATION (doom builder id 14) instead of Map Spot (doom builder id 9001)

2) Be sure that you make a sector around this teleport destination (like square teleport pad).

3) Make this sector tagged, make this teleport destination tagged too (give to them same id)

4) Make PlayerStart thing tagged too!

5) In ACS write this:

script 2 OPEN
{
	Delay(70);
	ACS_Execute (3, 2); //3 means "Script 3", 2 means "Map02". If you are making Map09 - make (3, 9).
}

script 3 (void)
{
	TeleportOther(7, 4, 1); // 7 is the tid of the Player, 4 is a Teleport Destination Thing+Sector TAG, 1 is Enable Green Teleport Fog
}

This MUST work in GZDoom 2.4.0, UDMF map format.

 

P.S.: Thanks to the Graf Zahl, ACS is weird as ████. Damn it. Sometimes ACS scripting is too nervous.

Edited by DeXiaZ

Share this post


Link to post
  • 1

If you need to teleport the player, you must consider that with Teleport will work if you set the TID to 0 for the player. Like this:

 

script 2 OPEN

{

      Delay(70);

      Teleport(0,4,0);

}

Share this post


Link to post
  • 1

I just tested the script and it's Teleport(4,0,0);........not (0,4,0);

The first argument is the TID of the mapspot, second argument is the sector tag............some mistakes lol

Share this post


Link to post
  • 1
8 hours ago, PepsiBepsi said:

nope, isn't working for me for some reason :(

 

script 2 OPEN
{
    Delay(70);
    Teleport(0, 4, 0); 
}

 

Capture.PNG

It doesn't work because OPEN does not have an activator. For that you'll need to use ENTER (note that this will run for every player in a multiplayer game!).  Then this will work:
 

script 2 OPEN
{
    Delay(70);
    Teleport(4, 0, 0); 
}

But depending on what you want to do later assigning a TID as @Empyre said will be a better solution.

Share this post


Link to post
  • 1

I just thought of an idea: Instead of OPEN, make the script ENTER, so the activator will be the player instead of the world and you can use 0 (which means the activator of the script) as the TID, then use Teleport as @PepsiBepsi suggested 13 hours ago (as of when I type this).

 

Oh, Now, I notice that this is sort of what @boris suggested 5 hours ago.

Share this post


Link to post
  • 0

I'm no ACS expert, but are you sure 7 isn't the TID of the Player 1 Start? I'm not sure what the process is for assigning a TID to the player actor itself.

Share this post


Link to post
  • 0
5 minutes ago, Bauul said:

I'm no ACS expert, but are you sure 7 isn't the TID of the Player 1 Start? I'm not sure what the process is for assigning a TID to the player actor itself.

7 is the tid of Player 1 start, should I be tagging something else?

 

 

Share this post


Link to post
  • 0
2 minutes ago, leodoom85 said:

If you need to teleport the player, you must consider that with Teleport will work if you set the TID to 0 for the player. Like this:

 

script 2 OPEN

{

      Delay(70);

      Teleport(0,4,0);

}

nope, isn't working for me for some reason :(

 

script 2 OPEN
{
    Delay(70);
    Teleport(0, 4, 0); 
}

 

Capture.PNG

Share this post


Link to post
  • 0

By the power of the Golden Shovel of Necromancy!

 

SCRIPT "MovePlayerToAltStartingSpotIfCameFromMap241" ENTER {

    // This does not work properly without BD version patched by me
    // (with NPC companion spawning delay of 2 seconds
    // and improved npc companion spawning algorithms)
    // because the NPC companions would get lost on the road of life,
    // Leroy Jenkensing from the primary start towards your new position
    // through the monster thicket -- you'd only find their smoking corpses)

    if (CheckInventory("HasLootedTheCastle")) {
        TakeInventory("HasLootedTheCastle", 1);
        int TargetSpotTID = 101 + PlayerNumber();
        // Instead of MapSpot I use 9044 Teleport(Z height)
        // so that the player arrives 20 units above the blood creak
        // causing a loud splash when he touches down
        int myoldtid = ActivatorTID();
        int mytemporarytid = UniqueTID();
        Thing_ChangeTID(0, mytemporarytid); // here 0 means "script's activator", regardless of his TID
        Thing_Move(mytemporarytid, TargetSpotTID, 1);
        SetActorAngle(mytemporarytid, GetActorAngle(TargetSpotTID));
        Thing_ChangeTID(0, myoldtid);
    }
    delay(1);
    Terminate;
}

 

 

altstart.png.2ff6e79defd057aed62058a3af29bab6.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×