Page 1 of 1

[solved] Invisible collision wall...

Posted: Mon Oct 17, 2016 7:22 pm
by aubergine18
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):

Image

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?

Re: Invisible collision wall...

Posted: Mon Oct 17, 2016 7:28 pm
by Klonan
I suppose you are making them a width of 0?

Try making them like:

Code: Select all

 collision_box = {{-0.5, -0.05},{0.5, 0.05}} 
It should work

Re: Invisible collision wall...

Posted: Mon Oct 17, 2016 7:32 pm
by aubergine18
0.001 actually :lol:

Code: Select all

    collision_box = { {-0.5,-0.001}, {0.5,0} },
I'll increase it a bit and see if that helps. Thanks for the infos!

Re: Invisible collision wall...

Posted: Mon Oct 17, 2016 7:37 pm
by aubergine18
Yup, that solved it! Seems anything less than 0.1 is unreliable at stopping player running through it.

Re: Invisible collision wall...

Posted: Mon Oct 17, 2016 7:47 pm
by Nexela
Check with power armor full of exoskeletons also

Re: [solved] Invisible collision wall...

Posted: Tue Oct 18, 2016 7:37 am
by Rseding91
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.

Re: [solved] Invisible collision wall...

Posted: Tue Oct 18, 2016 4:00 pm
by aubergine18
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