[0.16.36] problem setting orientation on train

Bugs that are actually features.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

[0.16.36] problem setting orientation on train

Post by sparr »

Code: Select all

game.surfaces.nauvis.create_entity{name="straight-rail",position={1,1},force="player"}
game.surfaces.nauvis.create_entity{name="straight-rail",position={1,3},force="player"}
game.surfaces.nauvis.create_entity{name="straight-rail",position={1,5},force="player"}
game.surfaces.nauvis.create_entity{name="straight-rail",position={1,7},force="player"}
game.surfaces.nauvis.create_entity{name="locomotive",position={1,4},orientation=0,force="player"}
Now you have a few rails with a locomotive on them facing north.

Code: Select all

game.surfaces.nauvis.find_entity("locomotive",{1,4}).orientation = 0.5
This should turn the locomotive to face south around. Instead, it moves the rendering position for the locomotive north about 1 tile. If you then add some fuel, get in, and start driving, it teleports back to the original position, still pointed north, before moving.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.16.36] problem setting orientation on train

Post by sparr »

PS: If you create_entity with orientation 0.5, you get a train with orientation 0, but in the correct spot, not the glitchy one-tile-north spot.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.16.36] problem setting orientation on train

Post by sparr »

Update!

I can create south-facing trains by passing direction instead of orientation to create_entity. This is weird because trains have false supports_direction once they exist.

After creating a south-facing train, attempting to change its direction has no effect. Attempting to change its orientation leads to the same "jump 1 tile north" behavior described in the original post here.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16102
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.36] problem setting orientation on train

Post by Rseding91 »

sparr wrote:Update!

I can create south-facing trains by passing direction instead of orientation to create_entity. This is weird because trains have false supports_direction once they exist.

After creating a south-facing train, attempting to change its direction has no effect. Attempting to change its orientation leads to the same "jump 1 tile north" behavior described in the original post here.
Yes you can't change the direction once it's created but it uses it to determine the initial direction.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16102
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.36] problem setting orientation on train

Post by Rseding91 »

Strictly speaking the game doesn't support setting orientation on trains. Doing so "works" as in changes stuff now but it shouldn't because the train is not setup to handle it.
If you want to get ahold of me I'm almost always on Discord.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.16.36] problem setting orientation on train

Post by sparr »

Even if not being able to do it isn't a bug, the graphics glitch where it renders one tile out of place when you try is a bug.
Post Reply

Return to “Not a bug”