How do i make it do this?

Get help using Construct 2

Post » Tue Jun 03, 2014 1:02 am

First thing first, I'm working on 2 games at once, which is why there are 2 topics by me and unlike my over game this one has a much simpler concept. This game is for a small college assignment.
(Skip to the bottom part if you just want to know the question and can't be bothered with the concept)
The question i have is of a cosmetic nature and wont affect the game play if i cant get it working.
So that you can get an idea of the game, the player is on an abandoned ship trying to get the flight recorder, there is no power on the ship and most of the doors are sealed, either by debris or they're locked. It's a top down game, meaning the player has a birds eye view of the map.
As the theme is on an abandoned ship i have created a sprite that has a slight transparency on the outer edges and nothing in the center and then pinned it to the player, this makes it look like the player has a torch on his suit.

Now onto the question, is there a way i could make it so the player can only see into the rooms when they have opened the door?
B
3
Posts: 18
Reputation: 211

Post » Tue Jun 03, 2014 2:14 am

You could use the new shadowing system. See the following capx.

Boat.capx


An other way could be to use black sprites above each room and lower their opacity every time the doors that lead to each room are opened.
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Jun 03, 2014 3:22 am

i had tried the idea with the sprites but i had all the doors as the same object and it caused more head aches, the other thing though, that boat.capx has done the trick, mostly anyway.

The only issue i have now is that one of my sprites turns completely black when i add the shadow caster behavior to it, i could probably fix this by adding an invisible sprite pinned to it.

Anyway thank you for the help eli0s, this isn't the first time you've helped me and knowing my luck it wont be the last :)
B
3
Posts: 18
Reputation: 211

Post » Tue Jun 03, 2014 3:32 am

No problem :)

About that sprite that turns completely black, try to pull it up in the z-order (right click/z-order/send to top). If you don't want to be covered by the shadows, it has to be above the the light object.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Jun 03, 2014 5:05 am

The ordering worked, although i had originally done my idea, which served the same purpose albeit in a round about way, until i lost an hour and a half worth of work on sprites and some of the game itself due to a power cut. :shock:
I got the game back to roughly the same place and some of the sprites but now i have an issue with the walls, the player can see through the walls when they're close to them, do you know if this is due to the walls being too thin or the player model clipping slightly?
B
3
Posts: 18
Reputation: 211

Post » Tue Jun 03, 2014 3:21 pm

I am not sure I understand what you mean. Can you post the capx..? A simplified version will do.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Jun 03, 2014 7:21 pm

i cant upload the capx, ive stripped pretty much everything from the game that is decorative, shrunk the layout sizes, shrunk and reduced the amount of sprites in the current area and it STILL wont go below 3.78 MB, the max upload limit is 2MB.

I'll try to explain it as best i can:

In terms of the effect im using on the player, it is identical to the boat.capx effect that you linked me, all the coding is the same.
The wall has only solid and shadow caster behaviors on them, the player has scroll to, 8 direction and bind to layout behaviors, while the doors have Solid and Shadowcaster too. everything apart from the player bound to layout is identical in terms of behaviour. as for the code itself, it is also the same as the boat game as it had worked at first

as for the game itself, the player can see through the shadow cast by the walls when they're close to said wall, this makes it so that the player can see through the wall. As well as being able to see through the wall, the player can see the doors through the shadows as well, although it is like that on the boat game and i could incorporate that into my game if needed.

If i haven't explained it well let me know and i'll try again eli0s
B
3
Posts: 18
Reputation: 211

Post » Tue Jun 03, 2014 7:57 pm

I can't interpret this "the player can see through the shadow cast by the walls when they're close to said wall". You mean that when you come edge on with a wall, that particular wall stops emitting shadows?

If yes, perhaps you are using a light radius that is too big? The light radius should be half the size than the diameter of the smaller shadow caster object. In practice, if you have a wall that it has 128px width and 8px height, the light radius shouldn't be more than 4, since 8 is the smaller dimension and the radius has to be <= of that dimension.

As for the next part, for the time being, there isn't a way to have a shadow casting object be both above the shadows and below the shadows, depending from if it's being shadowed by an other object or not.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Tue Jun 03, 2014 8:26 pm

After taking a break and getting a coffee (i hate having to pull all nighters for coursework) and then re reading your post about the height difference, i think i have found the issue.

I had it set up before so that i had stretched the same wall sprite to varying lengths to make it easier on walling off every room, i think the issue i had for the player seeing through the wall was because it couldn't cast a shadow over every part of the wall.

Now using the boat as an example i tried creating a repeatable pattern to use for my walls and then leaving the dimensions the same throughout and now the room is properly blocked by shadow, although i have only tried a single room so far though.

I'll let you know how it goes
B
3
Posts: 18
Reputation: 211

Post » Tue Jun 03, 2014 11:24 pm

Yeah, coffee does help sometimes :)

The dynamic shadowing plugin is in its infancy right now. v.170 was the first time ever having such a system. I think that it will improve and expanded upon in the future, so building your gameplay and level design around its current state might cause you problems later on.
There are other ways around your darkening rooms mechanic, a simple one is the following -that of course can be improved using variables and UIDs to link each room with a certain doors etc.

BoatNoDynamicSystem.capx


I suggest try and develop some other mechanics of your game first, give the lighting/shadowing system some time to develop and come back to it later on, when it has proven more useful/reliable.

Anyway, good luck, if you need anything don't be shy ;)
You do not have the required permissions to view the files attached to this post.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests