Rhindon's Forum Posts

  • Sure, I'll have a look.

    My apologies for the delay. I didn't get an email (or I missed it) saying that you had replied again.

    I went ahead and opted for a non-analog type of button scheme for this particular mini-game of mine. I decided it would simply work better overall that way.

    But I very much appreciate your willingness to help - that always means a lot to me. Thank you!

    I have about 3 or 4 different game modes for my game planned, so I might opt for analog-style controls for one of them. If I have further troubles, I will definitely contact you.

  • If doesn't work, share your c3p

    Yup...didn't work.

    Just to recap what I'm trying to do.

    1. Player touches Button_Alog_Stick (or "Stick").

    2. Stick is positioned to the player touch coordinates up to a maximum distance of 50 pixels from the Button_Alog_Base object.

    3. If the player's touch coordinates extend well past the Stick so that the touch isn't even within image boundaries of the Stick object, the Stick will still position accordingly from the Base to the touch and the respective angle. (So, basically, it's just a lerp detail which you helped with using min().)

    4. Once the touch is released, with or without the touch actually in contact with the Stick, the Stick will revert back to its neutral position (this feature is not yet added).

    Here's the link to my c3p file via my Google Drive: https://drive.google.com/file/d/1z7H66c9zPFrt6Mu31VreHfJ3mwVW7PiT/view?usp=sharing

  • Below is my current setup for a mobile touch screen analog (angle only) control stick.

    The idea is that the Button_Alog_Stick (hereafter just "Stick") will track the player's touch movement up to a maximum of 50 pixels from its base starting position. However, it will still move around in terms of its angled position as the player's touch moves around and even if the touch extends past the Stick's 50-pixel range.

    So long as the player initiates the touch on the Stick image and maintains that touch, even if the touch is no longer actually touching the Stick image, it recognizes the touch is in effect and the Stick will track the angle accordingly.

    The problem is that I cannot get this to work. I've reviewed the Touch object specs and apparently Has Nth Touch and On Nth Touch End are for when two or more touches are active. I simply want to isolate when the Control Stick is touched, maintain that touch regardless if the Stick is still being touched or not, and then take certain action when that Nth touch ends. Instead, the Stick acts like it's not being touched at all.

    Any suggestions/resolutions I could try?

  • And oosyrag, thank you, too for your effort to help me narrow down the problem!

  • Well, HAWT DAWG, AllanR, you are a life-saver! That did the trick! Thank you so much!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nope. Not using Scale Outer. Just Letterbox Scale.

    But the Layer reference for Touch wasn't something I was aware you could do! I'll give that a try...

  • To answer your question, no I haven't been using the ViewportTop/Left expressions. My mind is drawing a blank - how would you employ them according to what you're thinking?

    So this is the only event line I'm using so far. As mentioned, I've tried using Touch.X and Touch.AbsoluteX (the difference being the distance the Button_Alog_Stick object is positioned away from the Touch coordinate.

    Here is the layout with the Button_Alog_Stick object highlighted.

    And finally, the Buttons_Steal layer highlighted.

  • It's definitely centered. In this issue, the whole object, when positioned per the current setup, the object isn't within the Touch vicinity at all. I'll get a video shot later today...

  • I'm trying to implement an analog (360° angle only...not "tilt") control for an on-screen touch controller for my game.

    The control "button" (just a flat circle) sits to the left-side of the screen on a 0x0 parallax layer.

    When I use the Touch object condition on the control button, I tell it to position the control button to the Touch X/Y coordinates.

    However, this results in the control button being positioned offset from where I actually touched. So, I tried Touch.AbsoluteX/Y...same difference aside from the control button being positioned differently than simply Touch.X/Y. Meaning...it's still offset from where I actually touched.

    I have a feeling that the parallax of the layer the control button is on has something to do with it but I cannot figure out a solution. Can someone help me understand why this is happening, please?

  • OH MY GOODNESS. I figured it out. I was setting the TargetY variable to Self.StarX and not Self.StartY.

    PROBLEM SOLVED.

  • VinniePin - That's a good question. I haven't touched the Collision Mesh; only the Collision Polygon in the image editor.

  • EDIT: I solved my own problem. It was an incorrect reference to an instance variable. (See my last comment below.)

    I'm working on a stealth-styled mini-game and, as expected, the Line Of Sight (LOS) behavior is employed.

    Instead of giving the behavior to the enemy guards (black circles with green+red eyes), I've given them to the red lines you see as in the screenshot below...

    Instead of projecting a single image to show the cone of the LOS field, I'm using individual lines that show how my character, Mr Spy (grey circle, green eyes) falls into that field of vision (the black and grey walls also work the same way).

    The polygon hitbox for Mr Spy is an 8-point "circle" for the sprite...however, even with that shape, the red lines clearly show a massive off-set of hit detection when using the LOS behavior raycasting and detection. Here's the setup at the Start Of Layout as well as the raycasting event lines:

    While this seems to work...it's obviously not working as I hoped. Some lines are going right through Mr Spy while others are acting like they're detecting raycast hit detection when they're (visually) not.

    Any idea why it's behaving this way? What am I missing?

  • & DiegoM - As always, I'm grateful for your assistance. This time, however, I must apologize, too, because I rather sent you all on a wild goose chase when the answer was - apparently - not related to the Tween or my variables. I checked the image of the Quad_HUD object again and I realized I had a second animation that - despite playing quite clearly in the preview of the game - I had missed entirely when I resized the first animation.

    Since the second animation was still twice the size of the new resize, when the animations were changed, they appeared to be starting out larger or smaller than their target Tween value. So when it was to Tween to a larger size, it was switching animations and appearing initially larger and thus Tweening smaller. At any rate, I've tested all the main areas and things are working.

    The only "bug" was in my brain.

  • DiegoM - I'm inclined to agree completely. I have continued to scour my variable but it doesn't explain why it will start a Tween at a smaller value and then Tween to its larger end value or vise versa.

    For example, as you saw, if I'm moving to the top-left Quadrant (#1) the MAX height for that Quad should be 45. But it will start the Tween at a value much larger than 45 and Tween its height smaller. In other instances it will start smaller and Tween larger.

    In addition, I've taken all instance of the objects and clicked the "Make 1:1" button just to make sure there was no residual issue when I resized the image art, itself (I've noticed in the past that can sometimes cause problems).

    I'll keep looking things over and checking my variables and finish writing the bug issue if I can't find a resolution...

  • In the project window, look for the HUD_Elements Family to find the variables being referenced here.

    The event lines are on the "E Gameplay" event sheet and are at event lines 218-230.

    The only changes made were

    - to the instance variable values that I made in the parameters window and not through the event sheet.

    - to the position of the objects on their respective layers.

    - to the original size of the objects before manually resizing them in the layout to set them for their initial size once the game is run.

    No changes were made to the event sheet. And it's only happening to TWO of the Family objects (the top two yellow "Quadrant_HUD" Objects). Everything else is working fine after getting their instance variable values updated.