Mattrix's Recent Forum Activity

  • Hi BACLog, I feel like such a jerk. You responded within 2 hours of my asking you the question, but I never replied, because I never saw there was a response.

    I've been away from Construct 2 for good while now, and only recently had the chance to get back into it. I've been struggling with the camera and was just about to make a post of my own when I found this post again with your answer.

    This looks like exactly what I need. Thank you. I will probably have to make some adjustments to get it to fit my use, but this gives me a major helping hand (I went from "how do you do that?" to "oh, that's how you do it").

    Time to have a play with it now.

    Thank you again (I may love you just a little. shh... don't tell my wife)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • BACLog

    I know this is about 2 years too late, but this is exactly what I've been trying to work out.

    Any chance of a capx or tutorial on how you managed to pull this off?

    Any help would be appreciated.

  • Hmm interesting idea I didn't think about making all the guns the same sprite and then just using Instance Variables to set frame/animation.

    It's something that I'll definitely have a look into, but it's unfortunately going to have to go on hold for the moment, as I have too much real-world work taking up my time. Hopefully I'll get back into it in the next week or two.

  • - Yeah, I think it's going to have to wait until I can afford the full version, but I have a pretty good idea of how I'm going to go about it. Cheers for everything mate, it's been a big help.

    LittleStain - Thank you for your input, but I'm trying to wrap my head around what you are saying (functions are a bit of a new thing to me). Without using families, wouldn't you still need to make a different Event for each Object? etc:

    Player - Overlap - Gun1 --> drop current weapon/pickup Gun1

    Player - Overlap - Gun2 --> drop current weapon/pickup Gun2

    Player - Overlap - Gun3 --> drop current weapon/pickup Gun3

    ... I have a feeling I just made no sense. The boss gave me 2 weeks to do 2 months worth of work, so I'm pulling late hours and I'm not really with it at the moment.

    My deadline approaches so I won't have a chance to work on this game for a while. It might give me a chance to clear my head.

    Cheers to all

  • I like your way of thinking on this and, while still a bit buggy, I can see how it could potentially do just what I need it to.

    I was using Booleans for the Instance variables, but using Numbers as you are here could be the thing.

    Unfortunately as I am still on the free version the use of Families is beyond me. I had a feeling that I would come up against that limitation soon enough and it appears I have. I'll hopefully be able to purchase the full version soon, but I may have to put this aside for now. There is still quite a lot I can do in the mean-time (art assets and what-not) so I won't be idle.

    Thank you for all your help chrisinfinger.

    If I ever get this fully figured out I'll post back on this question for others to find.

  • G'day all, Mattrix here. I have a platform runner in the works and hopefully I'll be able to get it done some time soon.

  • Hi , thanks for your input. Sorry for the late reply, but work has been quite hectic of late.

    I used the Halo example because I thought it would be something a lot of people could relate to, and understand what I was trying to say. (I've also been watching a lot of early RvB lately)

    The basic idea is this:

    • Character has a weapon.
    • Character comes across another weapon on the ground.
    • Press a button to pick up new weapon off the ground and drop the original weapon.

    You can download a .capx of what I managed to get working here: It works well for what it is, but it only works for 2 weapons. I've been trying to get it to work with a 3rd, but so far no luck. It just gets very convoluted, very quickly.

    As for your suggestion of using a "CanBePickedUp" variable, I was already using a "GunAttached" variable, but I haven't been able to get your suggestion to work yet either.

    Back to grind-stone now. I might try something with Arrays.

    Cheers

    Edit: Apparently I'm 26 Rep short of being able to post URLs, and it's not giving me the option to upload an attachment. I'll post the .capx once I've sorted some more Rep.

    Edit2: Hooray, Rep. Let's try this: dl.dropboxusercontent.com/u/14838442/2_Gun_Swap.capx

  • Well, it's been 5 days with no response, so I guess no one can help me on this. Shame. I guess I'll keep plugging away. If I ever find a solution I'll post it up here for others to find.

  • Hey bladedpenguin, thanks for the reply.

    I had tried quite a few things lately and hadn't saved the semi-working code, so I had to do some code cleanup to get back to how it was.

    I decided to just scrap what I had and start again, and I managed to get it working! (kind of)

    (When you press Space while colliding with a Gun Sprite, it drops the one you have and picks up the one you are touching)

    Now, this does what I want, but the code is long winded and as far from optimised as you can get:

    As you can see, it works fine with only 2 gun types, but what if I had 5 guns? Or 10? As you can see, it would quickly become unwieldy.

    What would be the best way to streamline this process? I'm guessing families would probably help out a lot, but I'm still on the free version of Construct 2, as I can't afford the Private version yet, so they aren't really an option for me.

    Loops might be the way to go, but as I mentioned before, I don't really know how they work (despite reading the manual and numerous tutorials and forum posts).

    Any thoughts are appreciated.

    Cheers.

  • Hello again all, I'm having problems doing something I though would be simple.

    Imagine the character is holding an Item (gun, sword, shield whatever), and they run across a different Item on the ground. The character can only hold one item at a time, so on Key Press the character needs to drop the active Item and pick up the new one. Like this:

    (Blue box is the character holding the purple item. When overlapping the green item and pressing a button, character drops the purple item and picks up the green item).

    Basically think of the way Master Chief changes weapons in the Halo games. (I eventually want a little box to popup and show you Item Details too, but that is for a later time).

    I have each item as a separate Sprite with Pin and Platform Behaviours. The Platform Behaviour has Input set to off, and it is there make the Item drop to the ground when it is Unpinned from the Character. (I have some VectorX/Y set so it does a little arc away from the character).

    So far I can make it so the character can pick up an item and then drop it again, but when I try to make it swap Items with what's on the ground, stuff goes haywire.

    My thinking on how it should work:

    • Character has Item1 Pinned

    - Character Overlaps Item2

    - Key Pressed

    - Item1 -> Unpin (Item1 falls to ground)

    - Item2 -> Pins to Character | Position to Image Point

    I will eventually have a range of Items, so I'm guessing I'll need to use loops or functions or arrays or something, but I'm quite new to all this, and a lot of that is over my head for now.

    Any help would be appreciated and thanks in advance.

  • Hmm, the Lerp seems to do weird things. I can't get "Legs" drop at the right speed, and they actually fall slightly into "Block" when they land (rather than just resting on top of "Block"). Also, If I detach while still on the ground, "Legs" actually slide through "Block" and stop at the bottom of it.

    Most of these problems can probably be overcome with additional Events/Actions, but at the moment that is more work than I have time to put into it.

    Thanks again for your help korbaach

  • korbaach ooh, I had seen the word "lerp" used around the place, but didn't know what it was for. I'll have to give this a go when I get the chance. I'll keep you updated with the results.

Mattrix's avatar

Mattrix

Member since 13 Feb, 2015

None one is following Mattrix yet!

Trophy Case

  • 9-Year Club

Progress

9/44
How to earn trophies