Load save, run:
/c script.on_event(defines.events.on_entity_died, function(e) local entity_info = {force="player", name="car", position = {x=storage.loco.position.x, y = storage.loco.bounding_box.right_bottom.y+1.05}} if game.surfaces[1].can_place_entity(entity_info) then game.surfaces[1].create_entity(entity_info) end end)
Set train to automatic mode and watch.
Whats going on here:
There is a locked gate with low health that the train will run into after it is set to automatic mode. This will fire the on_entity_died event in the code above. That code is checking can_place_entity to see if the car entity can be placed. The car's collision_box has a height of 1 from its center and we're checking the position of the locomotives rear + 1.05 which should give us 0.05 of clearance. can_place_entity returns true because of the clearance, and we successfully create_entity for the car. The problem is, after this is done, the train is pushed back due to the collision with the gate. The pushback places the locomotive back far enough that its collision box is now well within the collision box of the car.
Expectation is that can_place_entity always ensures create_entity works without collision issues. The train's position due to collision pushback should be updated prior to firing on_entity_died.
While I did run into this while doing some specific testing in a more convoluted modded setup, this issue doesn't actually affect me if this ends up as a "won't fix".
[2.0.72] can_place_entity can be incorrect due to train pushback after collision
Post your bugs and problems so we can fix them.
[2.0.72] can_place_entity can be incorrect due to train pushback after collision
- Attachments
-
- test 11.zip
- (897.23 KiB) Downloaded 9 times
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- ↳ Fixed for 2.1
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Documentation Improvement Requests
- ↳ Resolved Requests
- ↳ Development tools
- ↳ Tools
- ↳ Mod and installation managers
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development tools
- ↳ Special interest mods and libraries
- ↳ Modding Development
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions
