Rhindon's Recent Forum Activity

  • I have a character sprite with multiple animation sets. Particularly one for running and one for punching. So that it does not look like my character is sliding across the floor while punching, I created multiple sets of animations - one of the top and one of the bottom halves of the run and punch animations. Four sets total, not including the full versions of both.

    In effect, what I hope to do is, while my character is running (bottom half of the run set), somehow "pin" (perhaps using the Pin behavior, perhaps not) the top half of the punch set to the bottom run set. Thus, I'd create the illusion of one animation set - punching while running. While I could just copy-n-paste both halves into a single set, this would create the problem the legs looking like they were reset mid-stride.

    I have an invisible platform object that the animations are set to that actually does the movements - that's not an issue. Individually, the animations are set to this platform object's origin point.

    What I'm wanting to do is see if it's possible to have two different animation sets active on the same platform object, but assigned to different image points, and will not conflict with one another.

    In summary...what I'm looking for is:

    The character is running (one set), then the punch button is pressed.

    The bottom half of the run set starts playing while the top half of the punch set plays through its sequence until it finishes.

    Once the punch set is done, the full run set resumes as normal.

    BUT, is it even possible to play two sets of the same sprite object simultaneously? OR, do I need to create a separate copy of the same sprite with the appropriate animations to be played at key times?

    Does that make sense? THANK YOU FOR YOUR HELP! <img src="smileys/smiley42.gif" border="0" align="middle" />

  • My dream game would place the player as an unassuming average individual who finds him/herself as one of the "random" people who stumbled into the world of CS Lewis' Narnia. No one every finds themselves in Narnia the same way, so it would be in the game.

    Much of Narnia's history is unknown and spans thousands of years between books. It would be unique (as best as a game can employ) for each player - no one would play the same story, although they may participate in related events.

    Each player would have to put aside their own ideas of how to solve problems and trust and obey the instructions of Alsan - even when the events in the game would suggest following those instructions would lead to the end of the game.

    Of course, there would be epic battles; a vast array of weapons and items to collect and make; and opportunities to explore the vast regions of the larger Narnia (Archenland, the Lone Isles, etc) by foot, horse (remember Bree?), and maybe even a boat as fair as the Dawn Treader.

  • wretchedshark - SIR! I think the missing piece is definitely the On any animation finished. Thank you, once again! :D

    On line 4, I disabled both of the Keyboard S/D is NOT down Events and that didn't seem to have any effect on the outcome of the animations. If I think on it long enough, it'll probably dawn on me - hopefully - but what precisely are those two conditions for in light of the whole project?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • vee41 - *sarcastically to myself* Now why didn't I think of that? *facepalm*

    ramones - Just before I checked the replies here, I was talking it over with my development partner, and that very fact dawned on me. Lo-and-behold, I had another event telling the running animation to reset to an idle pose after the release of - get this - ANY key. *MORE facepalm*

    Thank you BOTH for your prompt replies and willingness to help.

  • There are some similar forum posts out there that have somewhat clarified part of my issue here - I now understand the difference between On Key Down and On Key Pressed. The latter waits for the release of the key.

    MY present issue is that I simply want to have an Action take place when the Event tests that a key has been pressed at all, regardless if the key is held down or released...or not. Just, was it pressed.

    My scenario is that I have a character who will throw a punch upon the K key being pressed. The Action that ought to follow is that the Punch animation will play...from start to finish, all six frames. However, whether I use either On Key Down or On Key Pressed, the animation is immediately interrupted when I let go of the key.

    (I've tried setting up a work-around - and almost got it "perfected" - but it's too lengthy to try to explain.)

    So, ultimately, what I want to happen is this...

    1) I tap the K key and quickly release...

    (SIDE NOTE: Presently, pending a solution, I can hold it down, whether by O.K. Down or O.K. Pressed, and the animation repeats until I release the key.)

    2) ...The punch then plays through a full sequence once regardless of the current true/false of the K key press in subsequent frames.

    I've made sure the Loop is set to No on the animation sequence. I've also tested On Key Released. None of them work for my desired result.

    Thank you for your help!

  • - I have one IN MIND...I just haven't implemented it at this very moment. But yeah, I know I'll need one. My first concern is simply getting it to respond and follow through with the whole animation with a mere key PRESS, with or without being held down or button released. If I can get that set up, doing any reset to the animation (such as an interruption from an enemy from behind) will come next.

  • - Thank you for the clarification on the two. Movement-wise, I thought I had the two well understood, but now that I'm adding an "attack" condition, they both seemed to behave the same.

    But a new problem for me arises. I want my character to attack and complete it animation sequence SIMPLY when the button is PRESSED - regardless if it's held down or released (or not). The obstacle I face is that the animation STOPS once I release the button. I've switched out both ON KEY DOWN with ON KEY PRESSED...same results. I've almost got a work-around figured out but am having trouble setting up the logic. The one idea I have is to check if the animation is still in any of its current frames by way of a variable, adding 1 to the value each tick. Once the value reaches more than the actual number of frames in the animation, THEN it goes back to normal until I give it new instructions. ...but, the problem I see is that if I set it to a dual-condition event, at least one condition - the button press/down - won't be true.

    Your thoughts?

  • wretchedshark - I hear ya. Since this is just a test game - one that might see its day as an intentional app - I'm not worrying too much about it in DrBox's case. I'll definitely implement the hidden sprite with Platform behavior when that time comes, of course. For now I was just trying to work out hit detection. I deeply appreciate your feedback, though. Thank you! :D

  • wretchedshark - VERY good points. This is just to work SOMEthing out to begin with, but I'll keep that in mind. ONE thought JUST occurred to me, though. IMAGE POINTS! Right NOW, I've only got one frame for DrBox. I could set multiple image points as the range of detection! So test if the collision happens closer to I.P. #1 and 2 OR I.P. #3 and 4. Something like that. So if the Y value of MrStick's origin point is between DrBox's Y values of image points 1 and 2, for example, and the X value is one the correlating side, then...HIT. I'll work it out.

    It might prove to be tedious, but it'll perhaps account for any changes in the size of the frames/images. What do you think? Does that make sense?

  • wretchedshark - Thank you, sir. I believe I had a similar idea but opted for the horizontal (X value) option instead. I suppose either way will work. I'll test your method, though.

    When you have the .height/2, is that because you are assuming that the origin points are dead center for both X and Y values? Presently, I have the origin points at the bottom middle of both sprite characters (so, at their feet, basically).

    For my case, given the location of the origin points, I would probably have to amend the code to MrStick.height <greater/less than> DrBox.y+50 pixels (or however tall he is).

    ...I'm probably expecting a more complicated solution and having trouble finding an easier one...when it really IS that easy. Off to test things! THank you again!

  • Yann - Oooooh! Okay. I gotcha now. Actually, that IS what I was doing, but when I saved the .capx to be shared, I forgot to set the PlayerBox (the object actually being controlled) back to invisible. I do have my MrStick character (images and animations and all) set to follow the PlayerBox.

  • .CAPX here: sugarsync.com/pf/D6025908_4317202_6583129

    I have pretty much the same set-up that Ashley has in his tutorial, but there's one tiny little discrepancy...

    In my .capx the box sprite (the one with the "evil" eyes...aka Dr Box), the collision polygon is uniform with his box shape (minus the eyes). I have it set where if MrStick is falling and collides with DrBox, then DrBox will flash and MrStick will take no damage (represented by the health meter in the top-left).

    If MrStick is on the ground/not falling and collides with DrBox from the side, then MrStick takes damage. HOWEVER! It should be possible to take damage even if MrStick is falling and still collides with DrBox from the side - not on top.

    I tried setting up a comparison of X values between DrBox's origin coordinates and MrStick's, citing that if MrStick.X was within DrBox.X(+/-)50 (pixels), regardless of jumping or not, to determine if MrStick was colliding with DrBox from the side or the top. (But I've since deleted that line.)

    Is there a better way to test what side or point of a collision polygon is hit?

Rhindon's avatar

Rhindon

Early Adopter

Member since 8 Jan, 2013

Twitter
Rhindon has 2 followers

Connect with Rhindon

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies