[Twinsen][1.0.0] can_place_entity distance calculation seems to be wrong [Updated with more info]
Posted: Wed Oct 07, 2020 9:13 am
Hi - thanks for a great game.
What I try to do:
I am developing a tool which (hopefully) will make it a lot easier for players to get into tool assisted speed runs. I therefore need to be able to place buildings as far away as the default game will allow me.
My problem
In connection with trying to figure out how to find the furthest distance in a simple way I stumbled upon a rather strange thing. When I find what seems to be the furthest distance I can build something can_place_entity won't allow me to - it seems to think I am too far away.
Reproduce the issue
I have attached a sample which shows the issue. The script tries to place a steam engine (will be provided by the script) at location 4.5, 11.5. This is possible in the game (as seen in the attached picture), but will not be allowed by can_place_entity. If you use /c game.player.teleport({0, 0.5 }) it will place the steam engine, so it seems that can_place_entity thinks the character needs to be closer than is actually the case.
Disclaimer
It might be that I am simply using can_place_entity incorrectly - please correct my ways if that is the case.
Map
This is not map specific, but the location can of course not be blocked. Here is a map:
>>>eNpjZICDBnsQ5mBJzk/MgfFAmCs5v6AgtUg3vygVWZgzuag0J
VU3PxNVcWpeam6lblJiMYpijsyi/Dx0E1iLS/LzUEVKilJTi5FFu
EuLEvMyS3PR9TIwbhKZuLqhRY4BhP/XMyj8/w/CQNYDoF9AmIGxA
aISKAYDrMk5mWlpDAwKjkDsBJJmZGSsFlnn/rBqij0jRI2eA5TxA
SpyIAkm4glj+DnglFKBMUyQzDEGg89IDIilJUAroKo4HBAMiGQLS
JKRsfft1gXfj12wY/yz8uMl36QEe0ZDV5F3H4zW2QEl2UH+ZIITs
2aCwE6YVxhgZj6wh0rdtGc8ewYE3tgzsoJ0iIAIBwsgccCbmYFRg
A/IWtADJBRkGGBOs4MZI+LAmAYG32A+eQxjXLZH9wcwIGxAhsuBi
BMgAmwh3GWMEKZDvwOjgzxMVhKhBKjfiAHZDSkIH56EWXsYyX40h
2BGBLI/0ERUHLBEAxfIwhQ48YIZ7hpgeF5gh/Ec5jswMoMYIFVfg
GIQHkgGZhSEFnBgRmQ3ULJYvs1yDwA+LqF5<<<
What I try to do:
I am developing a tool which (hopefully) will make it a lot easier for players to get into tool assisted speed runs. I therefore need to be able to place buildings as far away as the default game will allow me.
My problem
In connection with trying to figure out how to find the furthest distance in a simple way I stumbled upon a rather strange thing. When I find what seems to be the furthest distance I can build something can_place_entity won't allow me to - it seems to think I am too far away.
Reproduce the issue
I have attached a sample which shows the issue. The script tries to place a steam engine (will be provided by the script) at location 4.5, 11.5. This is possible in the game (as seen in the attached picture), but will not be allowed by can_place_entity. If you use /c game.player.teleport({0, 0.5 }) it will place the steam engine, so it seems that can_place_entity thinks the character needs to be closer than is actually the case.
Disclaimer
It might be that I am simply using can_place_entity incorrectly - please correct my ways if that is the case.
Map
This is not map specific, but the location can of course not be blocked. Here is a map:
>>>eNpjZICDBnsQ5mBJzk/MgfFAmCs5v6AgtUg3vygVWZgzuag0J
VU3PxNVcWpeam6lblJiMYpijsyi/Dx0E1iLS/LzUEVKilJTi5FFu
EuLEvMyS3PR9TIwbhKZuLqhRY4BhP/XMyj8/w/CQNYDoF9AmIGxA
aISKAYDrMk5mWlpDAwKjkDsBJJmZGSsFlnn/rBqij0jRI2eA5TxA
SpyIAkm4glj+DnglFKBMUyQzDEGg89IDIilJUAroKo4HBAMiGQLS
JKRsfft1gXfj12wY/yz8uMl36QEe0ZDV5F3H4zW2QEl2UH+ZIITs
2aCwE6YVxhgZj6wh0rdtGc8ewYE3tgzsoJ0iIAIBwsgccCbmYFRg
A/IWtADJBRkGGBOs4MZI+LAmAYG32A+eQxjXLZH9wcwIGxAhsuBi
BMgAmwh3GWMEKZDvwOjgzxMVhKhBKjfiAHZDSkIH56EWXsYyX40h
2BGBLI/0ERUHLBEAxfIwhQ48YIZ7hpgeF5gh/Ec5jswMoMYIFVfg
GIQHkgGZhSEFnBgRmQ3ULJYvs1yDwA+LqF5<<<