I'm trying to make an invisible collision wall out of simple-entity objects, with the aim of creating two parallel lines, one either side of a bridge to stop player wandering off a bridge on to adjacent land tiles.
Sort of like this (was testing the entities, manually placed):
The collision box must contain the 0,0 point (centre of entity) for some reason, so I've had to allow these things to be off-map to place them in desired locations.
Problem I'm having is that the player character seems to magically run through them. At first I thought it was just the slide distance of the character, and that does seem to be happening, but if there's a line of the entities with not enough space to squeeze through the character collision box, the character shouldn't be able to run between the entity collision boxes... but it does, giving the appearance that they're not even there.
Any ideas?
[solved] Invisible collision wall...
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
[solved] Invisible collision wall...
Last edited by aubergine18 on Mon Oct 17, 2016 7:55 pm, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Invisible collision wall...
I suppose you are making them a width of 0?
Try making them like:
It should work
Try making them like:
Code: Select all
collision_box = {{-0.5, -0.05},{0.5, 0.05}}
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Invisible collision wall...
0.001 actually
I'll increase it a bit and see if that helps. Thanks for the infos!
Code: Select all
collision_box = { {-0.5,-0.001}, {0.5,0} },
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Invisible collision wall...
Yup, that solved it! Seems anything less than 0.1 is unreliable at stopping player running through it.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Invisible collision wall...
Check with power armor full of exoskeletons also
Re: [solved] Invisible collision wall...
Because of the fixed-point number system we use for entity positions there are only 255 unique positions on a given tile that are usable. Everything between them is rounded to the nearest fraction.
So, [0, 1] in increments of 1/255 (0.003921568627451). A bounding box of 0.001 width would indeed end up a bounding box of 0 width.
So, [0, 1] in increments of 1/255 (0.003921568627451). A bounding box of 0.001 width would indeed end up a bounding box of 0 width.
If you want to get ahold of me I'm almost always on Discord.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [solved] Invisible collision wall...
Ah, that is hugely useful to know! This explains many issues I was having across the various mods I was working on. Thank you!
/me goes to fix myriad of buglets in mods
/me goes to fix myriad of buglets in mods
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.