InfiniteRockets's Recent Forum Activity

  • Amazing, thank you both so much - I'll try both approaches and report back if I still have any difficulties. I hadn't considered hiding the objects for some reason!

  • I'm working on a simple weapon switching mechanic whereby the player is able to switch between two physical objects; a gun and a shield. The way I invisioned the logic working is that when the player hits right bumper on their controller, it destroys the current weapon and replaces it with a different one at the same position.

    I have managed to get this working in a pretty janky manner, but it's giving me some issues which have probably got something to do with the general logic and order that I'm issuing events. The major problems I have are;

    1. I can't get my events to work with the same button (i.e. Left Bumper) - I have to switch each weapon to a separate button for it to switch back and forth. I'm assuming this is something to do with the structure of my events, and there's a way of approaching this that I'm missing.
    2. When the weapon switching is working with the adjustment I mentioned above, the positioning seems glitchy. When the new weapon object is created, it reads its angle from a global variable (i.e. the left stick's last reported position) yet it seems to momentarily reset to directly in front of the player.

    Here are my events, and I've also posted the project. Thanks for any help you can provide.

    https://www.dropbox.com/s/clbq6141tbk8d8m/WeaponSwitch.c3p?dl=0

  • Brilliant, that worked - thank you so much.

    Can I also ask, if I want to create a larger radial movement independent from the linear movement, would an approach be to create a second variable on the gun object (i.e. RadialRecoil) and then simply adjust the clamped value? Or is there something else that I'm missing?

  • I've implemented my own version adapted from the mouse control, but I'm running into some strange behaviour which might be related to gamepad controls and lack of a mouse cursor to reorient the radial position to. The radial motion is funtionally working, but I'm not exactly sure what is causing the issue (it's possible the analogue position resetting to 0 if the player shoots and lets off the stick?).

    I've attached the project file if anyone with a gamepad could have a look - you should be able to see what the problem is compared to the effect that I'm trying to create in the first animated gif. Essentially, the example that dop2000 provided is exactly what I'm going for, but mapped to gamepad.

    https://www.dropbox.com/s/4rqw7ulf78hle2g/RecoilGamepad.c3p?dl=0

    This is a quick gif of the issue that might be helpful too: -

    Thank you for any help you can give!

  • Amazing, thank you so much, and also for the original tutorial; it's a great method!

  • The gun can rotate to any angle - it’s pretty much the same as your example, but mapped to an analogue stick, so it would recoil based on its relative position. Here’s another quick gif showing the current implementation: -

  • I've implemented a radial aiming system for the platform behaviour with some weapon recoil using the method outlined in dop2000's excellent tutorial (thank you!). I've adapted this to a gamepad, and it's working well using the following events: -

    However, I'd like to add some radial recoil to complement this, and I think I can use the same method, but I'm struggling with how to adapt the expressions to fit this radial movement instead of the single opposite angle that the gun is firing. Could anyone suggest how I might do this?

    The end result would be something like this (i've roughly simulated the movement manually to show this - the quality of the gif makes it a little hard to see, but the gun kicks both backwards and radially around the aiming arc of the player, and then resets to default position): -

  • Just an update for anyone reading this thread in the future; I managed to get all of this working by changing the way that the weapon is attached to the player in the first place, and it was really simple.

    First, I changed the Origin of the turret to 64 pixels behind it, and pin this to the centre of the player at the start of the layout. Next, I used a condition to check that if the axis of the right analogue stick is anything other than 0, put it into a global variable and then set the angle of the turret to this. This is essentially how the demo twin-stick shooter handles it.

    Simple yet functional!

  • Brilliant, thanks for your help; do you happen to have a screengrab of the events or an example capx to hand?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to implement a simple radial aiming mechanic using gamepad controls. So far, I have this working, where the position of the aiming sprite is set to the player's centre, as if the character was holding/aiming the weapon by their side. However, my intention is to have the aiming sprite offset so that can orbit the player by a set distance (i.e. like a 360 degree floating turret).

    I thought I could achieve this by messing around with ImagePoints, but this doesn't seem to work as intended (the angle of the sprite does not line up with the position of the analogue stick). Can anyone suggest a particular approach here? I feel like it should be relatively simple, but I'm missing something obvious.

    A secondary issue I have is that the aim angle springs back to the original position, understandably, as the analogue stick is disengaged. How would I be able to leave the position of the aiming sprite in the last position that the player aimed in? Would I need to report the last set position to a variable and then set the angle to that when the stick isn't in use, or again, is there a simpler method that I'm missing?

    Thanks for any help you can provide!

  • I think the technical solution with sprites is straightforward (I have a working version with them) and I'd prefer to work with them. My main concern is that having sprites of 'complete' platforms will be an optimisation nightmare later on (i.e. some of these would be, like, 512x1024) though maybe I'm worrying too much given that these are destroyed as soon as they go off-screen.

  • Thanks - I understand that process. I'm specifically trying to make this work with hand-painted/illustrated tiles. Coming from Unity, it's a process that could be handled in an empty gameobject because you can make reference to translational values, so I'm trying to emulate something along those lines in Construct - just surprised that it seems more difficult in many respects.

InfiniteRockets's avatar

InfiniteRockets

Member since 17 Nov, 2015

None one is following InfiniteRockets yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies