Rhindon's Forum Posts

  • NetOne - Oh man, bugs always bugging ya. Such is the life of a programmer. Heh.

    Sorry for any confusion... I'll try to explain again with more clarity. Bear with me...

    As you see, there are multiple instances of the GhostHunter(Body) objects. (GhostHunter is the visual object that the player will see and GhostHunterBody is intended to be the object that does all the moving about and contains (most of) the behaviors, variables, and other stuff.)

    Taking into account that the "camera" angle (based on how things are drawn and now the actual camera/ScrollTo behavior), the visuals are that of top-down + slightly behind. Much like how Zelda: A Link To The Past was drawn on the SNES. With that visual angle, objects that are higher up on the Y-axis are technically "behind" or "farther away" (from the player's visual reference) than that of objects lower on the Y-axis. Assuming they're all on the same layer (they should be), objects that are "farther away" need to be drawn on the bottom of the layer or at least below objects that are "closer" to the player.

    So when one GhostHunter instance moves down on the Y-axis (closer to the player) they need to be redrawn on the top of the layer when "passing through" other instances of the same GhostHunter object. The current problem most of the time is that it looks as if certain instances on the top of the layer are literally on top of the other instances even though they should be behind them because they're higher up on the Y-axis.

    Further, the problem I'm having with the Z-order action line is that I don't know what the assumed sorting process is. Does it sort ascending or descending? I looked into the manual and couldn't find a clear answer. Is there a way to affect the sorting order? I'm guessing that the variable it's calling upon is used to calculate how it should sort or what it should sort, but again, I'm not finding a clear answer.

    Thanks for your time to help me work this out, too!

  • *sighs* I don't know what's wrong, but even with a family, it's still not working. It occasionally sorts them correctly, but in the end, whichever GhostHunter is on the top of the layer stays on the top... It won't sort to the bottom, or rather below another GhostHunter, when it's at a lower Y-axis value than the others.

  • AH! Okie dokey, then. I'll give that a shot and report my findings. Thanks for all your help, both of you!

  • I double, triple, and quadruple-checked everything - from event/action lines to image points. Everything lines up. I've verified the correct variables get referenced, and everything. I've tried

    A couple other details while you look this over...

    The actual GhostHunter objected is contained with the GhostHunterBody (right now their images look the same but "Body" is invisible at startup).

    The GhostHunter object is pinned to GhostHunterBody object. "...Body" controls all movement and contains 99.9% of all the variables. GhostHunter is using the ZOrder variable, though "...Body" also has the same variable (not used).

    https://www.dropbox.com/s/h2v1joiqaimjgoe/busters%20escape%20v8-3%20.c3p?dl=1

    The event line in question is 18 (Group "Enemy Z-Order").

  • nacra - Well, if that's the case, I don't know what's wrong because any instance of my GhostHunter character that's atop another instance remains on top regardless of its Y-position on the layout. I should add that I don't change the GhostHunter instance variable at all. It's just there so that I can use the Sort action.

  • I only kinda follow.

    ...I've created an instance variable for my object in question (GhostHunter).

    So far I have a no-condition event line with the two actions:

    (1) GhostHunter set instance variable ZOrder to round(Self.Y)

    (2) System Sort GhostHunter Z Order by GhostHunter.ZOrder

    Similar to the illustrations shared earlier on this thread, my GhostHunter character needs to appear behind other GhostHunters when it is "farther away" from the player (given the top-down/angled behind camera assumption). Thus, any GhostHunter that is lower on the Y-axis needs to appear "behind" other GhostHunter instances.

    If using a For Loop is inefficient (and so far ineffective per my efforts), I'm failing to understand how to make the Sort Z Order action useful. What do I do next or change given what I have so far??

  • Ashley - I went to use the Sort Z Order system action and it's asking me for an instance variable for the object whose instances I want sorted. There's no ascending or descending option. Per the manual, it also does not make any mention of having to use an instance variable.

    For clarity, I selected an event line, pressed A to open the Actions menu, chose System, and then Sort Z Order.

    I've never used this feature before so I'm not sure if there's something I'm missing.

  • I plugged in the actions as you have in your update and it definitely worked as promised. Tests did result in very minor occurrences of the problem while continuing to hold a direction into a wall. I also repeatedly pushed the direction into a wall while already up against it but there didn't seem to be any rhyme or reason as to exactly what triggers the brief about-face.

    However, the problem seems 99% resolved and hopefully doesn't prove to be any kind of significant issue...

    Thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aaaah! That seems to coincide with what I noticed in the debugger. I just couldn't make heads or tails of it. Thank you, again! I'll plug this in later and see that I get the same results.

  • blackhornet - Might I get your insight, please?

  • *bump*

  • What this does is to set up a system for me to gauge the movement of my main character, Buster... Is he moving up, down, left, or right? And then to compare whether his horizontal movement is greater than or less than his vertical movement.

    From there, I determine which visual animation to play, and/or whether or not to mirror the image. (I know someone will ask why I don't just set the animation to play based on what keyboard keys I press...and I had a specific reason but right now it's completely escaping my mind.)

    What I have noticed, however, is when Buster is "pushing" against a wall while going to the left or up his body doesn't appear to be "flickering" between animations. But going in either of the other two directions will show his body rapidly alternating between two animations. For instance, if Buster is moving to the right against a wall, it looks as if he is switching between left and right animations. (This doesn't happen, though, when moving against a wall immediately to his left while going to the left.)

    I suspect it has to do with the BusterBody object being "pushed back" when it briefly overlaps the wall (which has the Solid behavior). So for a brief tick, Buster is moving in the opposite direction than what the player is moving him in. The question, though, is why this only happens for two of the four directions?

    .c3p file: https://www.dropbox.com/s/63vyu90r8r7jp5l/busters%20escape%20v8-2%20.c3p?dl=1

  • That's understandable, however unfortunate.

    If you ever change your mind, know that we'd be extremely grateful.

  • What's the word on a possible C3 update?

  • I'm still working with a general understanding even after that explanation - for all my intelligence, some things still are slow to click with me. But in the end I'm extremely grateful for your help.

    If there is a way to fine-tune it so I might edit the parameters easier, I'd appreciate that. But, in the end, it works splendidly!

    OH! One thing I meant to ask...

    I was further wanting to make it "bounce" a time or two more after its initial bounce. I'd want to check for when it has "touched ground" again but I don't know/comprehend which value(s) to check for before making it bounce again (and at a smaller scale). Is there a "flow chart" you could list to explain the process?

    Thank you again.