InfiniteRockets's Recent Forum Activity

  • Okay, that's really helpful - thank you. Before I go down the path of replacing the Lerp recoil events with Tweens, I just wanted to ask whether you thought they would allow me to implement the recoil more or less as it functions now (ignoring the cycling values from the Lerp of course!)

    Something that I have working at the moment is that if the player shoots in rapid succession, the recoil throws off the aim (which is intentional). If I get a Tween working, is it possible to 'interrupt' the animation so that it works in this way?

  • Ahh, thank you for the insight - the event order makes a lot of sense, I'll restructure the events so that the execution order is logical.

    I've also just noticed the continually changing values for both of the Recoil values. Are you able to suggest changes to the events that would alleviate this? They're both supposed to return to 0. The recoil events are probably the ones I've struggled with most!

    Any help is massively appreciated.

  • Just an additional question; any idea why occasionally my objects aren't destroyed based on my current set of events? Everything looks like its set up properly, but I can't work out what is periodically causing the blocks not to get destroyed when it looks like the conditions are met. I've uploaded the whole project if anyone can help.

    https://www.dropbox.com/s/t5o0xncy402f1kb/RayHit.c3p?dl=0

    This is what I'm currently seeing; I've also tried removing the ammo variable check. The right instance seems to be selected (i'm outputting it to a debug box in the top left corner).

  • Brilliant, thank you very much!

  • I'm trying to set up a condition whereby when an object is intersected by a ray (and the player pushes a button), that specific instance of the object is destroyed. I have been able to set this up so that all instances of the object get destroyed, but not on a per-object basis. Is the best way to do this with UIDs, and if so, what would the event structure look like? My ray is otherwise working as intended and has a pretty straightforward setup, though I can post events if this helps.

  • This is great, thank you so much for the explanation, it really helps me to understand how the events work - I’ll try your suggestion tomorrow.

    I’m definitely not married to this particular approach, I just observed from the recoil events I was using elsewhere that I might be able to repurpose it. I’m totally up for trying a different approach, especially if you think this way might lead to technical headaches later on. Not sure if you can suggest something? Maybe I overcomplicated this and should have tried something with vectors or Bullets instead?

  • I’m trying to implement a shield bash move, which acts a little bit like a spring; when the player holds down the trigger, it draws the shield toward them. When they release it, the shield quickly surges forward so incoming projectiles can be batted away in a timed fashion.

    I’ve managed to get the basics of movement (i.e. preloading and unloading the shield) working with some events lightly adapted from dop2000 's recoil tutorial, but I’m having some difficulty in altering some of the maths functions. I’m generally happy with the trigger down movement that moves the shield towards the player.

    The lerped release is what’s confusing me; how can I alter this so that the shield quickly surges forward to its original position rather than slowly settling back into place?

    Again, I’m trying to get this to behave like a spring (or a bow string) where there’s a slower draw back and then a quick, strong release. Is there a way to have it momentarily shoot past its starting point on release a bit like a spring? I realise this might be getting into easing which is definitely beyond my ability at the moment!

    Is this even the best approach for this kind of action? Any code/events/suggestions are greatly appreciated. I've uploaded the project in case that's helpful too.

    https://www.dropbox.com/s/r46z9ma2usqrhpo/ShieldBash.c3p?dl=0

  • Hmm, perhaps I'm not understanding the logic - shouldn't the last part of the function return the WeaponSelect variable to 0? Or is that not possible, because as soon as the button is pressed, it's triggering the event which adds 1 and activates the function again (i.e. after the first use, there are currently no conditions which return it to 0 without the same button press adding 1)?

    The intention is to have the first weapon (i.e. the handgun which = WeaponSelect 0) spawned in at the beginning of the game, though obviously this can't use the Right Button event so I'm using a separate condition to do this separate from the Function.

    I see an easy fix in just assigning the weapons to 1, 2, 3 etc without using 0 as you suggested and then just change my other conditions - but I can't currently figure out a way to do it more elegantly using the weapon switch function or use 0.

    I've uploaded a current version of the project here in case anyone can suggest a way to do this: -

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

    Again, thanks for your help with this, it's helping me to get my head around a bunch of concepts.

  • Amazing, thank you! Switched that around and now it works perfectly.

  • I’m outputting the value of WeaponSelect to a text box; it starts on 0 because that’s the initial value, but one the function is initiated, it never loops back to 0 as per the last event. I also have some events based on the value being 0 that aren’t activating.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Amazing, thank you so much - I got this mostly working using functions (and now I understand a bit more about use cased for functions, so thank you for that too!).

    The only thing I'm running into is that the function doesn't cycle back to 0 - once initiated, it adds one every time, but seems that when WeaponSelect gets to 3, it doesn't set itself back to 0. This seems like it should work, but am I missing something about the logic?

    One final question - because of the globally accessible nature of functions, is it always necessary to use globally scoped variables (i.e. like WeaponSelect in your example)? Previously, I had been using a local variable attached to the player - I expect that using this in other parts of the game would lead to issues?

  • I got this working perfectly using the advice that you both posted; again, thank you very much. As I suspected, it was my understanding of execution order that was tripping me up. I do have a question more for my own learning/understanding than anything else. I used the following events to get everything working, including the player cursor not skipping to 0 degrees when spawned. You can see that as suggested, I've specified the angle of creation on object spawn: -

    However, I also managed to get it working without specifying the angle on object spawn when the events were in the order below. As soon as I move the events into my Player Management group, it skips back to 0 degrees before adjusting to the angle stored in my variable. What is it about the execution order that has changed which causes that to happen?

    And just one more question; the Else event works really well for switching back and first between two weapons/variables, but could it also be adapted to having 3 or more weapons/variables (i.e. hitting RB on the controller cycles between 0, 1, 2)? Or am I looking at a completely different approach for that?

    Thanks for your help!

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