How do I stop light from pushing through shadow objects?

Get help using Construct 2

Post » Fri Aug 12, 2016 8:41 am

I use the shadow light object to contain light inside the walls. The walls cast shadows so it stops the light. However due i think to the size of the SLO, if i push at the wall, the object pokes through the wall, meaning that the wall stops acting as an object with shadowcaster on it. See picture attached.

Image

Is there a way to stop this please? It looks really bad. Can i resize the SLO or put it on another layer or anything?

Thank you, Kenthria
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
1
Posts: 129
Reputation: 3,064

Post » Fri Aug 12, 2016 8:59 am

How close do you have to get to the wall before it pushes through?

Maybe you can extend the collision box for your character so you can't get super close... or move the light object "back" a couple of pixels?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Fri Aug 12, 2016 9:19 am

SoldjahBoy wrote:How close do you have to get to the wall before it pushes through?

Maybe you can extend the collision box for your character so you can't get super close... or move the light object "back" a couple of pixels?

~Sol


Pretty close. I use points that are invisible around the diver to detect the collisions (works for mining etc)- so i could have the collision points further from the diver- however it would give little room.
How would I move the light object back a few pixels? On collisions with the wall?

Thanks.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
1
Posts: 129
Reputation: 3,064

Post » Fri Aug 12, 2016 11:32 am

Yeah maybe test for overlap at offset with the wall tile - so you might need to check in a radius or each direction in a square.

If offset is compared at say X + 1 (or even X+2) then move light to self.X-1

Do this for each direction or use some trigonometry to calculate the radius :)

That should work, I think!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Fri Aug 12, 2016 1:00 pm

SoldjahBoy wrote:Yeah maybe test for overlap at offset with the wall tile - so you might need to check in a radius or each direction in a square.

If offset is compared at say X + 1 (or even X+2) then move light to self.X-1

Do this for each direction or use some trigonometry to calculate the radius :)

That should work, I think!

~Sol


I will try this thanks! Will post how it goes.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
1
Posts: 129
Reputation: 3,064

Post » Fri Aug 12, 2016 1:10 pm

OK sounds great :D

It might not be the BEST solution, but it might work around the problem for now at least (if it works)!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Tue Aug 16, 2016 11:07 am

Works well thanks a lot :)
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
1
Posts: 129
Reputation: 3,064


Return to How do I....?

Who is online

Users browsing this forum: AllanR, BackendFreak, brunopalermo, Christmas, farsen, ST314 and 31 guests