nchima's Forum Posts

  • It seems every week I come to the How do I thread having been defeated by a problem more difficult than the last. For this week's challenge of "dyanmic" lighting, I've tried and failed and tried and failed again, so I finally resorted to coming here for to ask for help.

    Basically what I want to do is give the rooms in my building "dynamic" light. Its not extremely complicated; the setup of my game is that I have a building with 3 floors each with one compartment ("room") or more, which are separated by 3 objects (ie, ground, walls and doors), and each room having a light at the top of it. The doors can be opened by opened and closed by my player to move between rooms. The idea (what I'm trying to do) is have the whole building covered in darkness, and have light objects casting light into the rooms they are in, and possibly some portion of the next room depending on if the doors separating those rooms are open or not and the position and angle of light. Something like how the light object and shadow caster method works, but instead of casting shadows over a light layout, casting light through a dark room ie, dark layout (I think that's how it would work. I don't know, I'm making random guesses.) Basically what I want is just to have light cover a room and rooms next to it that don't have light (partially lit) if there's an open door in between and when that door is closed for the light to stop moving into the unlit room, ala, "Dynamic Lighting"

    P.S. I tried the light object and shadow caster, but they didn't seem to work out for me, maybe I was missing something.

  • Wow. Just wow. I'm amazed at how quick y'all gathered and solved what seemed (to me) to be impossible bug. And what's most amazing is how elegantly simple your solutions are. A million thanks guys. The incite has changed my life, literally(Now I gotta go question my whole game and everything I implemented, basically question my existence :-\ )

  • The project .capx. If you run it and keep watching the guards move left to right and back again, you'll notice after some time one or more of the guards glitches and starts facing left, right, left, right and so on. It goes on for a bit before it stops and normal operation is resumed.

  • Sorry title is a bit vague. I have a basic level set up in which has rooms in which guards a "patrolling" (what's actually going on is guards a moving from left to right or vice versa until they hit a wall and simply start moving in the opposite direction). What I've been trying to do is make the patrols in such a way that when a guard gets to a wall at the end of a room, rather than immediately turning around and continuing to move (in a way that makes it look like the guard has just bounced off the wall like a tennis ball), the guard actually stops at before the (like 16 pixels) away from the wall for 2 seconds before turning around and starting to again. Ala "more realistically guard patrols".

    The concept sounds simple enough, and I'm sure the more realistic of you would know how to do this, but I've failed to do it well. I say failed to do it well because I have tried it but my method doesn't run so well, at any random time between 10-300 seconds, the guard will glitch and start turning left, right, then right, then left, etc, for a good 10 seconds or so.

    What complicates things is the need for guards to stop at a distance from the wall. Ideally I'd have simply have put an on collision with " wall" action > set patrol to false > wait 2 seconds > change direction > set patrol to true. But that'll have the enemies waiting literally face-on-wall waiting for 2 seconds. So that won't work. So I have to use the overlapping at offset conditions. But this command triggers and continues triggering while enemy is within that offset of the wall. I tried adding a trigger once which so of solved my problem, but lead to this curious bug.

    May someone show me how to do this?

    NB sorry I can't upload a capx or screenshot at the moment

  • I thought as much. Creating a separate object for open doors might be my best, albeit cumbersome, option. So when I door is opened it would spawn a closed door closed door object and destroy the open door object.

    I'll post a screenshot or .capx soon enough.

  • Firstly pardon me if I'm posting this in the wrong place, I'm still a little new to this forum.

    So I have been using the line of site behavior in my game on enemies to tell if they can "see" the player. For obvious reasons, they shouldn't be able to see through doors, walls, ground. But i added other obstacles, giving the player opportunity to "hide" from the enemy using various objects in their environment. So I set obstacles to Custom because allowing me to dynamically set which objects are obstacles (player can use to hide) and which aren't depending on varying conditions, instead of just setting the line of sight obstacles to Solid.

    Here's my issue; A "closed door" should be an obstacle to line of sight and an "open door" shouldn't (i.e., enemy should be able to see player if the player is behind an open door). So what I did was that it set up my event sheet in such a way that at the beginning of every loop, each enemy's line of sight obstacles are cleared, then for each enemy and for each door, if the door is closed (if the door's instance variable of boolean type, aptly named open, is false, ie door closed) then add that door to the obstacles of that enemy's line of sight. But that doesn't seem to work. it seems that when I add the action Add Obstacle Door to Enemy Line of Sight, it adds all the doors, not a the specific closed door. What am I doing wrong? Does Construct's Line of Sight behavior have the ability to distinguish which instance of an object is an obstacle or do they all have to be obstacles?

  • thank you.

  • Hi. I'm using the NodeWebKit pluggin in Construct. I'd to know if it's possible to have exclusive full screen on PC, like in more traditional games PC games, I.e., without the title bar?

  • spongehammer I'll try that. Thank you.

  • So I updated to r164 and still nothing. granpa So do you propose I do that? I've got a platformer game. Setting my enemy sprite is to mirrored is the only way that I've found to make the enemy seem like they are "facing" in the opposite direction. If I set angle to 90 the enemy will be lying down facing down. If angle is set to 180 the enemy will be upside down. If set to 270 the enemy will down facing up. And at 360 we'll be back where we started.

  • Hello. I'd like to know how to pick all objects within an area, ie, example between 3 or more coordinates? Within my layout I have a "room", ie, a wall on the left, a wall on the right, a wall above, and a wall below. I'd like to select all enemies within that "room".

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've recently started using Construct 2. I'm using r139. But I've encountered a problem. My enemy has a Line of Sight behavior with field of view set to 180 degrees. The enemy can see a player when the player is in front of them. But when the enemy is mirrored (heading in the opposite direction) the enemy can't see a player in front of the, but they can see a player behind them. How do I make my enemy "see" a player in front of them when the enemy is mirrored? (I tried setting field of view to -180 but that didn't work.

  • It's Sunday. was expecting Monday. There I was counting the minutes.

  • spongehammer -_-

  • spongehammer