SuehtamSatierf's Recent Forum Activity

  • Thanks for sharing this approach. I didn't even know how much it was possible to do with the LOS behaviour. I never experimented much with it.

    That being said, I tried your approach and it didn't work very well. The walls are almost always opaque, especially when the camera is further away.

    The only instance in which it works is when the tanks are closer to each other and the camera is also closer to them. Then the walls start reacting, but even then it's not 100% accordingly to what's desired.

    For example: While the wall is getting transparent in the image above if I go slightly lower and more behind it, it gets opaque again. I didn't implement the whole math in relation to the Z axis here, so maybe that could be related.

    And then if I move the other tank behind the wall, that one doesn't get transparent, but the one closer to the other player does.

    I understand that not having access to the game's files can make the whole process of figuring this out harder, so I am sharing here a link to the file so you can take a look.

    drive.google.com/file/d/10OmeVZRQaRrGxZwgVrwMbD7Kx-kNrNpS/view

    Cheers!

  • That might work, but I am doing something wrong. This is what I quickly laid down in the event sheet.

    Where cam_seethru is the object that is always in the same position as the camera, checking for LOS.

    The result of this is that all walls are transparent all the time, even if the tanks are in front of them.

    I just left the LOS behaviour with its default values.

  • I apologize, the 4th image is incorrect, and it's just the 3rd image repeated. This is what it looks like.

    As you can see, the player is in front of the wall, but the wall is still going transparent. I want to be able to keep it opaque in this situation.

  • I am working on a small 3D tank game project where I want the walls to have a lower opacity every time there's a tank (player) behind them.

    I tried several different ways using the position of the walls, trigonometry and bounding boxes, but nothing seems to work and I need help.

    Here's the problem!

    In the top-down view, I want the wall to get transparent when the player is behind (higher in the Y axis) the wall and within points A and B, which would be the width of a rectangle encapsulating the wall.

    However, I want the wall to be fully opaque when the player is in front (below in the Y axis) of the wall.

    So far, so good! The problem is that I want to avoid this problem, where if the player is in front of the wall but higher than its origin point in the Y axis, the wall will go transparent.

    The opposite should also be avoided when the wall goes remains opaque even though the player is behind it because they're below the wall's origin point.

    This would work very simply if all the walls were at right angles, but I want to be able to have a full range of rotation for them and make it work.

    Any ideas on how I could approach this problem and achieve the desired result? I tried many different things with varying levels of success, but never fully got there.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am replying a bit late as I was taking a break from the project. Now I am getting back to it.

    I understand that I need to increase the player's speed to compensate for the platform's speed. That will be implemented soon.

    The main problem that I am struggling to figure out is why the problem in the video is happening. I checked on debug mode and apparently the player is pinned to the platform regardless of where on the surface of the platform he is, but he only gets carried over once he's at the edge of the platform.

    Link to the video:

    youtu.be/M7Y5EUZIrnk

    Any clue why that could be happening?

  • So, I tried the pin/unpin approach and it partially worked. The player did, in fact, move along with the platform and I was able to move while on the platform.

    However, seems like the player's speed is reduced and for some reason, the platform only moves the player if its sprite is on one of the edges.

    For example: if the player is moving from left to right, the platform will only move the player when the latter is at the left edge of the platform, meaning that the platform will move without the player until the player hits the left edge, and only then the player will move with the platform. From right to left, the opposite is true.

    Any clue on what could be causing that? I know that in the screenshot I am using a boolean to pin the player to the platform, but I also tried checking for the movement keys not being pressed and it didn't work.

    Code screenshot:

    Game screenshot:

  • Thanks, lionz! I will give it a try later today and let you know if it worked or not.

    Another thing that I thought of that I apparently forgot to mention in the post: any ideas on how I can keep the player within the platform even though they're moving?

    As in, they're on top of the platform, in the middle of their trip from point A to point B, and they can freely move, but they cannot go off the platform until it arrives to its destination.

  • I am making a top-down game where the player uses the 8-direction behaviour (it's actually a pseudo-3D game, but it works just like a top-down).

    I am trying to make a moving platform that the player can step on and move along with it, at the same time the player can control the character and move on top of the platform.

    I was able to make the platform move with no problem, but I cannot figure out how to get the player to move with it without locking it to the platform.

    Any ideas?

    Screenshot of my code for the moving platform so far:

    Screenshot of the game:

  • I have just tried the container approach and it worked like a charm. Thank you bigcatrik!

    I just created a container in the 3D object and included the sprite with the animation in it. Now, every time when the enemy spawn, the animation works.

    Screenshot of the game working:

    Screenshot of the container:

  • No, I haven't done that yet. I will give it a shot and I'll come back to say if it worked or not.

    Cheers!

  • Objective:

    The objective is to have enemy spawners scattered around the map to spawn new enemies every X seconds (a feature already implemented). These enemies are 3D objects with a sprite containing animations being projected onto the 3D object's bottom face. The objective is to have every new enemy spawned have the correct animations based on their angle. Example:

    If the enemy's angle is 45 degrees, the animation for that instance will be "Southwest_Idle", whereas if its angle is 0 degrees, the animation will be "East_Idle".

    The angle is determined by the Enemy's position in relation to the player.

    Current approach:

    For every tick, I set an instance variable called "selfAngle" in the enemy 3D object to angle(Self.X , Self.Y, Player.X, Player.Y). Then, I compare the value in that instance variable to check if the number stored in there is greater or equal to an angle and less than another (e.g. >= 0 and < 30). If that is true, the program set the correct animation accordingly.

    In terms of having the correct animation according to the angles, this is working.

    Problem:

    Since all the 3D objects being spawned reference the same single instance of the animation sprite, all the enemy instances face the same direction.

    A possible solution that I thought of was to spawn a new instance of the sprite containing the animations and project that specific instance onto the new corresponding 3D object that was also generated. However, I have no idea how to do that and need help.

    What could I do to solve this problem?

    Link for the C3 Project:

SuehtamSatierf's avatar

SuehtamSatierf

Member since 17 Dec, 2022

None one is following SuehtamSatierf yet!

Trophy Case

  • 2-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies