bergerhealer / TrainCarts

Minecarts redefined
MIT License
205 stars 63 forks source link

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

Closed amalon closed 1 year ago

amalon commented 1 year ago

Info

Please provide the following information:


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:

Actual behaviour

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

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 commented 1 year ago

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 commented 1 year ago

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

amalon commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.