Author Topic: Event: Teleport all players to their last spawn  (Read 4123 times)

I can make a Player > ScheduleRespawn event that can go up to 1 hour, is that what you're looking for?

done
« Last Edit: October 06, 2013, 10:50:14 PM by Subpixel »

Pain in the ass, especially if you have a lot of spawns.
just make a set of bricks with the right relays on them. you can copy it from the first one to the rest easily. there's the timer. give all the spawns the same, and it's just like there was only one
why would you make the timer for each spawn? that's ridiculous

just make a set of bricks with the right relays on them. you can copy it from the first one to the rest easily. there's the timer. give all the spawns the same, and it's just like there was only one
why would you make the timer for each spawn? that's ridiculous
Copy the events over?
Someone made an event that's literally like a relay but you can attach a long delay to it.


I know I can do that but 30 seconds is too short of a time.


You can use VCE loops for this to extend a relay counter infinitely.  I have used this technique to increase a delay to a real-time day.

Code: [Select]
[0] [x] [0] [OnActivate] [Self] [VCE_ModVariable] [Brick] [Count] [Set] [0]
[1] [x] [0] [OnActivate] [Self] [FireRelay]
[2] [x] [1000] [OnRelay] [Self] [FireRelay]
This is the base for an infinitely continuing loop.  It includes an original setting of the counting variable (below examples use Minute and Hour as counting variables), an original start for the Relay, and an OnRelay-FireRelay event.

Code: [Select]
[0] [x] [0] [OnActivate] [Self] [VCE_ModVariable] [Brick] [Count] [Set] [0]
[1] [x] [0] [OnActivate] [Self] [FireRelay]
[2] [x] [1000] [OnRelay] [Self] [FireRelay]
[3] [x] [0] [OnRelay] [Self] [VCE_IfVariable] [Minute] [==] [59] [4 6]
[4] [x] [0] [OnVariableFalse] [Self] [VCE_ModVariable] [Brick] [Minute] [Add] [1]
[5] [x] [0] [OnVariableTrue] [Self] [VCE_ModVariable] [Brick] [Minute] [Set] [0]
[6] [x] [0] [OnVariableTrue] [Self] [VCE_ModVariable] [Brick] [Hour] [Add] [1]

This is a basic snippet as an example from my current project.  Every second, it adds 1 to the Minute variable (1 second in real life = 1 minute in blockland).  If the Minute variable reaches 59, it adds 1 to the Hour variable and resets the Minute variable.

Code: [Select]
[3] [x] [0] [OnRelay] [Self] [VCE_IfVariable] [Minute] [==] [59] [4 6]
[4] [x] [0] [OnVariableFalse] [Self] [VCE_ModVariable] [Brick] [Minute] [Add] [1]
[5] [x] [0] [OnVariableTrue] [Self] [VCE_ModVariable] [Brick] [Minute] [Set] [0]
[6] [x] [0] [OnVariableTrue] [Self] [VCE_ModVariable] [Brick] [Hour] [Add] [1]

Use this bit for every different process you want your loop to carry out.  It includes a check (line 3), a repeat if the check returns false (line 4), a reset if the check returns true (line 5), and a process if the check returns true (line 6 and everything else you want).

Basically, the good thing about this way is that it produces no lag and can go on forever.



As for a solution to your problem, you are going about this wrong.  You can use VCE for this too (if you have it).  If people are sent out to find bricks, they can click the brick, have a client variable representing that item set to 1 to indicate that have found it, then when the minigame is reset, they can click a brick (or use OnMinigameReset or OnMinigameSpawn) to check every variable on the client, and if any of those variables are set to 1, they get the item.

It would look like this.

On the found brick:

Code: [Select]
[0] [x] [0] [OnActivate] [Client] [VCE_IfVariable] [Gun] [==] [1] [1 3]
[1] [x] [0] [OnVariableFalse] [VCE_ModVariable] [Gun] [Set] [1]
[2] [x] [0] [OnVariableFalse] [Client] [CenterPrint] [You have found the Gun!]
[3] [x] [0] [OnVariableTrue] [Client] [CenterPrint] [You have already found the Gun]

On some random brick if you want the items to be given to the player when they spawn:

Code: [Select]
[0] [x] [0] [OnMinigameReset] [Client] [VCE_IfVariable] [Gun] [==] [1] [1 1]
[1] [x] [0] [OnVariableTrue] [Player] [AddItem] [Gun]

Repeat this for every item you want to have added.

or use this if you want the player to click something to get their items:

Code: [Select]
[0] [x] [0] [OnActivate] [Client] [VCE_IfVariable] [Gun] [==] [1] [1 1]
[1] [x] [0] [OnVariableTrue] [Player] [AddItem] [Gun]
« Last Edit: October 06, 2013, 10:57:43 PM by Gen. Hothauser »

you're trying to make this way more complicated than it needs to be

you're trying to make this way more complicated than it needs to be

That's all of two different bricks and 11 different lines of events.  Not complicated at all.



Also, OnItemPickup would be a good replacement if you want the player to have access to the item immediately after pickup instead of finding bricks.

That's all of two different bricks and 11 different lines of events.  Not complicated at all.

Also, OnItemPickup would be a good replacement if you want the player to have access to the item immediately after pickup instead of finding bricks.
yes, complicated compared to two incredibly simple lines on each of the bricks
and why are you even saying all this about addItem? they already picked up the item. that's the whole reason he's wanting to respawning them instead of kill them

Pain in the ass, especially if you have a lot of spawns.
Name them all the same thing, only do the relays on one other brick.

[ 0][X][  0  ] onPlayerSpawn > Self > FireRelay
[ 1][X][30000] onRelay >       Self > FireRelay
[ 2][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 2 3
[ 3][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 3 4
[ 4][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 4 5
[ 5][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 5 6
[ 6][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 6 7
[ 7][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 7 8 9 10
[ 8][ ][  0  ] onRelay >       Self > doWhatever
[ 9][ ][  0  ] onRelay >       Self > ToggleEventEnabled > 2 8 9 10
[10][ ][  0  ] onRelay >       Self > CancelEvents


You would have to use something else to get the player target from the relay, however VCE, SubEvents, and many other events can do this. You can extend this onto as many bricks as you need, and it is more accurate than the VCE timer that is triggered every second.

Edit: Actually, you wont need to get the player target if your using setPlayerTransform. I derp'd.
« Last Edit: October 07, 2013, 03:20:50 PM by boodals 2 »

yes, complicated compared to two incredibly simple lines on each of the bricks
and why are you even saying all this about addItem? they already picked up the item. that's the whole reason he's wanting to respawning them instead of kill them

It was a suggestion for a different way of doing it that would make more sense.  And it's not complicated in relation to whatever two event lines you were talking about, it's more extensive. 

I can make a Player > ScheduleRespawn event that can go up to 1 hour, is that what you're looking for?

done
I didn't want the players to respawn, I wanted them to be teleported to their last spawn *point* so they wouldn't lose their items.
I could try other methods as suggested but complexity is an issue and I want it to be more simplified.

I didn't want the players to respawn, I wanted them to be teleported to their last spawn *point* so they wouldn't lose their items.
I could try other methods as suggested but complexity is an issue and I want it to be more simplified.
Oh, oops!

Sorry about that, i'll make a Player > BackToSpawn event right now.