Rhindon's Forum Posts

  • GOAL

    Using the Absolute X value of the Mouse to determine when to rotate the Player's angle (and thus the 3D camera with it).

    If Mouse.AbsoluteX is less than 1/3 the width of the viewport (layer "HUD", set with a 0x0 parallax and 2D layer rendering) then rotate counter-clockwise.

    If Mouse.AbsoluteX is greater than 2/3 of the viewport, rotate clockwise.

    (In the screenshot, I had this backwards by accident.)

    Now, this WORKS...but with a small catch

    PROBLEM

    When doing a preview play of the game, resizing the preview window affects the viewport width (default 1500 pixels). Even though I tell it to check for 1/3 or 2/3 of the viewport width, regardless the current width of the window/viewport.

    Yet, when I resize it bigger or smaller than what the preview window started at, the two condition lines I highlighted in the first pic still calculate things at 1500 pixels even though, as my second pic points out, the viewport is more than 1500 pixels.

    (When the preview window is resized smaller, thus the viewport is less than 1500 pixels wide, I can't even begin to made it rotate clockwise.)

    In this second image, the preview window is enlarged to fix my monitor's full size. As a result the viewport width is greater than 1600 pixels. This isn't necessarily a problem because the event lines are not looking for specific values but a fraction of a value, whatever that value is at the time.

    The actual problem is that as the viewport, itself, is resized, that new viewport width value does not seem to be taken into account. For example, if I resize the preview window significantly smaller and try to move the Mouse to the far right of the viewport, it will not cause the Player to rotate whatsoever because the viewport is much smaller than 1500.

    When the preview window is close to 1500 pixels (the default value I set in the project parameters), 1/3 of that is 500 and 2/3 of that is 1000. But these values do not register. It's actually at values just a bit less than 500 and 1000 before the appropriate actions take place.

    In the image above, there is a rainbow-colored bar that I was using originally. On it are two small tick marks to denote where the 1/3 and 2/3 portions of the bar are at. These were supposed to be the visual cues (for testing) to let me know where the Player/camera should start rotating clockwise or counterclockwise. However, I discovered that ultimately even the object when used as a reference produced the same problem as using the viewport width as a reference.

    Is this a bug or is there a detail I'm missing?

  • oosyrag - I completely updated my post here to hopefully make it more clear. I also included an updated image that should help things be more understandable as well as a copy of my project file. I hope this helps.

  • I don't think this collision filtering is the best fit here. First thing that comes to mind would just be to enable and disable the solid behavior for the door that is being overlapped.

    Agreed. And I actually tried to do that after making this post. But for some reason, that doesn't work, either. It must be one of the nuances of how events are checked (re: grouped conditions versus sub-conditions).

  • UPDATE Aug 30, 2022

    With help from a fellow C3 user in the Discord chats, it has been unofficially determined that this is a bug with the 8Direction behavior. I will be filing a bug report soon...

    INTRO

    I'm working on a top-down shoot-'em-up title. The arena is broken up into 9 different areas. The walls that define the areas have doors that only the enemy called "Manager Mike" can go through.

    THE INTENDED DESIGN

    There is a "Door Trigger" object that has the Solid behavior that is enabled or disabled depending on whether or not "Mike" is overlapping the object or not. "Mike" is using the custom obstacle element of the Pathfinding behavior, so the Solid behavior does not factor in. The "Trigger" object is set in the space where the Player can move from area to area.

    If "Mike" is overlapping the "Trigger" while going through the door space between the area walls, then the Solid behavior of the "Trigger" is disabled. While disabled, the Player can also slip through the door space. (Previously, I tried using Collision Filter and Solid behavior tags but that proved fruitless.) So long as "Manager Mike" is not overlapping the "Door Trigger" object, then that object instance's Solid behavior is enabled and the Player cannot move from area to area.

    THE PROJECT

    Project Link: https://drive.google.com/file/d/1_yERwqONQJrVzpiV-byvCKChDOXqD782/view?usp=sharing

    Event Lines: 30 - 43

    THE PROBLEM

    As you can imagine, this isn't working. "Manager Mike" moves through the door spaces just fine. Because of the custom obstacle element, it ignores the "Trigger" object's Solid behavior as it should. The problem is that the Solid behavior, even while enabled (I've checked via the debug mode), acts as if it doesn't work when the Player moves up to it. The Player moves past the "Trigger" object as if it were disabled even though it is clearly enabled and "Mike" is not overlapping the "Trigger".

    ADDENDUM

    Elsewhere in the project (event lines 58 & 59), the Player does make use of the Collision Filter via Solid tags for the Walls object. And the curious thing is that the Wall object instances all work properly - the Solid behavior keeps the Player from moving through them. However, the "Door Post" object also has Solid behavior attached to it (and a tag which is not referenced) but the Player can move through it. So, I am at a loss of how to resolve this issue and what it is I am missing.

  • PROJECT FILE

    https://drive.google.com/file/d/13zp9TW99ftZ3Hh-ATc446znMQzxSMFeJ/view?usp=sharing

    GAME SYNOPSIS

    You're controlling a Character (presently the white box) as you fly down a corridor of space as Asteroids come at you from a distance. (Think: Star Fox on the SNES.) The 3D Camera is positioned behind the Character in line with the Character and the Reticule_3 object (the Reticule farthest from the Camera). As you move the Mouse around, the Reticule_3 object will move, too, up to a max amount and the Camera will lag behind in response. The Camera is also set to look at the Reticule_3 at all times.

    All of this works just fine presently.

    THE ISSUE

    What I'm trying to do now is to add a Pointer Lock so that the Mouse pointer is invisible so that the "physical" limitations of the pointer on the screen is no longer an issue when controlling the Reticule_3 object.

    However, when I try to call Pointer Lock into action, this not only removes the Mouse pointer visibly, but also "physically". Meaning, the game can't track the Mouse's X/Y coordinates, which the controls currently depend on.

    What I am trying to do is figure out how to track the Mouse pointer's movements properly so that it still plays just like it does now.

    And any additional info about how C3 processes this info behind the scenes would be very helpful, too.

    Thank you!

    EDIT Problem Resolved

    I was able to figure out the solution to my satisfaction after all. I'm leaving this post up so that others can come by it and hopefully find help for similar problems.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound - THAT'S IT!!! IT WORKED! The Mouse controls the Reticule PROPERLY!!

    THANK YOU SO MUCH!!! (I'm 41 but the kid me feels like the best thing just got handed to me.) I'm very grateful.

    As always, I'm so appreciative of you both. GOD BLESS!

  • newt - Thank you! I did try using Lerp before but was still struggling...the results I was after I couldn't figure out.

    R0J0hound actually seems to have solved it for me - a non-parallax 2D layer. That's like 90% exactly what I'm after (if not EXACTLY). I'm going to plug it into my setup and see if that solves the deal.

    Thank you both!

  • newt R0J0hound dop2000

    Tagging the three of you because you've been the most helpful in the past and I value your input. (And because if one of you is unable to answer, maybe the others can.)

    Frederico C. from the Discord Ask-C3 channel offered me this solution - https://cdn.discordapp.com/attachments/253490735268102144/972991293246562354/3dRetical.c3p. And that's very close to what I'm trying to do but with the greater flair of the 3D camera viewing angles you can see in my own project.

    I tried to play around with the "Scroll layer" expression/action but I've never used it before so I'm guessing at what it actually does...

    I'm sure that my issue here is a lack of understanding of just how C3 is "thinking" when it interprets the event lines I've written. I'm obviously wanting it to do one thing but because I don't "get" how C3 handles certain details, such as 3D Camera in conjunction with the Mouse against a 3D layer, I don't know how to remedy this.

    I'll keep dinking around and hopefully I'll figure something out.

  • PROJECT FILE: https://drive.google.com/file/d/1rQl5A5qyTy9aqATJIThZrug-zGYu_uM4/view?usp=sharing

    ISSUE (SHORT VERSION): Using the Mouse to control the Aiming Reticule object is always "off-center" due to the way I have the 3D Camera set up to "lag" behind the position and while looking at the Aiming Retitule of the Player Character.

    ISSUE (LONG VERSION): The game I'm making is similar to Star Fox (SNES) or Space Harrier (arcade, etc). Unlike those games where the camera was generally stationary and always looking straight ahead, in my game, the 3D Camera is positioned behind the Player Character and adjusts position with a lag to move behind the Character again. The Camera always looks at the farthest Aiming Reticule object which is controlled by the Mouse.

    I'm using the difference between the present and previous Mouse position per tick to determine how much to move the Reticule. This much works. Sorta...

    The problem is that with the way things are now, the Reticule keeps moving to the bottom-right as the Mouse is moved around the screen and to dead-center when the Mouse moves to the top-left. I'm not sure what I'm missing.

    Could I get some help to resolve this, please?

  • You do not have permission to view this post

  • colonel Justice - Yeah, that's my conclusion, too. I reviewed both the manual and Ashley's tutorial entry on 3D and I'm of the mind that I just need to position my 3D camera above the layout as it originally starts. I'll have to test that out later...

    Thanks!

  • dazedangels - Thank you, but that issue I got resolved as I noted in the EDIT portion of my post.

  • I'm trying to use the image from a 2D sprite as the facing of a side on a 3D object.

    However, when I apply this using the appropriate action line, that side is suddenly blank, as if it was unchecked to be invisible. But it's the only one checked to be visible. I also tried to use both an action line in the Event Sheet and also in the 3D object Properties Bar to assign a simple sprite image to the one face of the 3D object. It still will not show up, making that face appear invisible in the process.

    WHAT is causing this?

    I have the 3D camera set to parallel with the layout and other than that, nothing out of the ordinary is going on. It's still that ONE side that has the 2D sprite pasted onto it that's blank when it should be visible.

    I have triple-checked that the correct side is referenced.

    EDIT: I discovered that I needed to have at least a single instance in the layout (or any layout?) in order for the sprite image to appear on one of the faces of the 3D object. I solved my own problem. I'm leaving the post up for others in case they face the same issue.

    ...now, I have to figure out how to get the transparent space in the original sprite image to appear transparent on the 3D object facing...

  • Aaaah. That's the thing that was missing. Thank you, Newt!

  • That's everything... I didn't know what would or wouldn't be relevant.