Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teleport to multiverse portal facing opposite direction doesn't flip carts except front #460

Closed
amalon opened this issue Jan 4, 2023 · 10 comments

Comments

@amalon
Copy link

amalon commented Jan 4, 2023

Info

Please provide the following information:

  • BkCommonLib Version (/train version): v1.19.3-v1-SNAPSHOT (build: 1272)
  • TrainCarts Version (/train version): v1.19.3-v1-SNAPSHOT (build: 1435)
  • Server Type and Version (/version): git-Paper-39 (MC: 1.19)

Bug

Description

A train is heading north. It goes over a sign which teleports the train to a multiverse portal facing south. The order of the carts are reversed, but the individual carts aren't flipped around (except the front one apparently)

Expected behaviour

Since the direction is changed, it should:

  • be going south out of the portal
  • reverse the order of the carts (so the front/northmost cart going in is the front/southmost cart coming out)
  • reverse the direction of all the individual carts (so the side going forward/northward going in, is the side going forward/southward coming out)

Actual behaviour

  • 👍 The train does come out going south
  • 👍 The cart order is reversed
  • 👎 the carts remain the same way around (except the front one), so the front side going in is the back side going out.

I have verified with the attachment editor that the left doors of the train go in facing west, and come out still facing west, so it is that the train is reversed but not the carts (rather than the carts reversed but not the train).

Here's the train before it goes into the tunnel with the teleport sign:
2023-01-04_18 34 10

Here's the same train after its come out of the portal from the left. Note how the train is reversed but not all the carts (the front bogie is actually correctly flipped):
2023-01-04_18 36 09

Steps to reproduce

  • create two straight tracks going north-south
  • create a multiverse portal named SOMETHING at the north end of one track
  • put a sign under the north end of the other track with:
[+train]
teleport
SOMETHING:s
  • make a train with multiple carts, with the carts asymmetrical in the forward/backward direction, and push it along the track with the teleport sign
  • observe that the train gets broken

Additional Information

My attempts to flip the carts on the trains on one side of the portal using:

[+cart]
flip

have been unsuccessful at consistently flipping all the carts. This is apparently because the front cart does get flipped by the teleport.

@bergerkiller
Copy link
Member

Can confirm the teleport is rotating carts. I'll check what's going on, but my guess is that the teleport sign is using fairly ancient code lol

@bergerkiller
Copy link
Member

https://ci.mg-dev.eu/job/TrainCarts/1287/ give it a try

@amalon
Copy link
Author

amalon commented Jan 5, 2023

https://ci.mg-dev.eu/job/TrainCarts/1287/ give it a try

Thanks. This appears to prevent the first cart flipping, so now all of the carts come out backwards (rather than all but the front one).

Doing:

[+cart]
flip

prior to the teleport makes it come out looking right.

@bergerkiller
Copy link
Member

bergerkiller commented Jan 5, 2023

Weird, can't make it happen. Though I'm using myworlds portals as I dont use multiverse/know how to use those portals. Functionally they work the same though, just look up the rails and spawn into a direction.

Does the same also break without specifying :s ?

@bergerkiller
Copy link
Member

Did spot one bug that might cause it if you have half of the train reversed and the other half not. https://ci.mg-dev.eu/job/TrainCarts/1288/

@amalon
Copy link
Author

amalon commented Jan 5, 2023

Did spot one bug that might cause it if you have half of the train reversed and the other half not. https://ci.mg-dev.eu/job/TrainCarts/1288/

Ooh yes, thats much better. Thanks so much!

I think I may have seen a collision when there was already a train waiting at the other side of the portal, but thats a separate issue.

@bergerkiller
Copy link
Member

Did spot one bug that might cause it if you have half of the train reversed and the other half not. https://ci.mg-dev.eu/job/TrainCarts/1288/

Ooh yes, thats much better. Thanks so much!

I think I may have seen a collision when there was already a train waiting at the other side of the portal, but thats a separate issue.

Good! Yeah don't know what can be done against that. You might be able to avoid it by having two named mutex zones at both the point of teleporting and destination, so trains are stopped/wait until the train has teleported over. https://wiki.traincarts.net/p/TrainCarts/Signs/Mutex

@amalon
Copy link
Author

amalon commented Jan 6, 2023

Good! Yeah don't know what can be done against that. You might be able to avoid it by having two named mutex zones at both the point of teleporting and destination, so trains are stopped/wait until the train has teleported over. https://wiki.traincarts.net/p/TrainCarts/Signs/Mutex

Good idea. I gave that a try, but it didn't seem to prevent trains entering. I'll have a bit more of a play around to figure out if I'm using them wrong.

@bergerkiller
Copy link
Member

Good! Yeah don't know what can be done against that. You might be able to avoid it by having two named mutex zones at both the point of teleporting and destination, so trains are stopped/wait until the train has teleported over. https://wiki.traincarts.net/p/TrainCarts/Signs/Mutex

Good idea. I gave that a try, but it didn't seem to prevent trains entering. I'll have a bit more of a play around to figure out if I'm using them wrong.

It doesnt work between worlds, so that might be an issue.

@amalon
Copy link
Author

amalon commented Jan 7, 2023

Good! Yeah don't know what can be done against that. You might be able to avoid it by having two named mutex zones at both the point of teleporting and destination, so trains are stopped/wait until the train has teleported over. https://wiki.traincarts.net/p/TrainCarts/Signs/Mutex

Good idea. I gave that a try, but it didn't seem to prevent trains entering. I'll have a bit more of a play around to figure out if I'm using them wrong.

It doesnt work between worlds, so that might be an issue.

That'll be the problem. Thanks for fast responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants