Borghi's Recent Forum Activity

  • I still don't see why you'd need a null animation but ok..

    you could just check if your firing animation is playing before spawning bullets. you could even check what frame it's on and spawn bullets on a specifivc frame.

    how can I check that?

    My firing animation has only 1 frame, so, I guess that's the frame.

  • I don't know how you have your events and conditions set up, but I do have some questions.

    Why use the null animation instead of setting the sprite invisible?

    Have you tried the, system wait : 0, anywhere to wait 1 tick before progressing?

    Is it possible to set the imagepoint for the null animation on the spot you need for the shooting?

    well, I used the null anim so I can use the time of the anim as the space betewwn shoot and shoot, besides, the srpite needs an animation to fall into when not shooting.

    about the wait, I've never used it yet. I'll check how it works.

    I can set the image point in the null where I want, but that would bring this problem:

    With the shooting srpite being a separated thing, the main sprite can aim freely all the time. So, if you are aiming forward, fall into the null, and then the pleyer aim upwards, the shoot would again interpret the imagepoints of the null, shooting forward. so, it's imposible to predict where the player will aim.

    Going back to the main problem, it's really weird that what I'm doing is playing the same event over and over but once the second shoot starts that strange thing happens. I mean, it's the same event, should work exactly the same.

  • This is kinda complex so I'll be as specific as I can.

    My game is in "CONTRA" style.

    The character is divided in 3 sprites: legs, upper half, and shooting animations.

    the legs are the main part and are separated form the rest so i don't have trouble with the "firing/walking" animation.

    the upperhalf is pinned to the legs and when you aim that's the part that switches anims so it aims correctly at every direction.

    and the shooting is just the frames of the upper part while the guy shoots, also pinned to the legs. when these appear, the other upper half goes invisible, so it looks like both are the same sprite and it doesn't interfere with the aiming. When the guy is not shooting, this sprite goes to a "null" animation that has no frames in it, an invisible animation.

    We're Ok so far.

    Now I'm creating a machinegun alternate mode.

    I've made it this way:

    When "Z" key is down, the shooting sprite goes to the normal shooting. when it ends, it goes to the null anim, and if when the null anim is over the key is still down it goes again to the shooting.

    so it creates a loop that stops once you've released the key.

    the thing is working perfectly, but the problem is that the bullets are coming from the imagepoint of the NULL anim, not the SHOOTING anim. So, it is like if the bullets are being created 1 tick before it should and are interpreting the imagepoints of the previous anim. This is weird since it's set so the bullet is created once the shooting anim starts, so, there's no way the bullet is created before.

    It works fine in the first shoot of the bunch, but when it gets in the loop is where the problem starts.

    How can I solve this?

  • well, the thing about OR blocks is that sometimes I have to use more "or" stuff.

    for example I have 3 different animations that I use as triggers, that could be used in an OR block. but then, in some cases, I need more triggers like if it's mirrored or not. So that would need some kind of another OR block. That's why I needed this alternate way.

    What I finished doing was adding a variable that activates whenever any of those anims are playing in an OR block.

    about the tokenat, sadly I really didn't understand a single thing about it:

    ---------

    tokenat(src, index, separator)

    Return the Nth token from src, splitting the string by separator. For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.

    ----------

    it's like chinese for me. Why would it return oranges? i you want it to return oranges just write oranges. anyway, can't understand it.

  • hmm yes, I know the OR. I've been trying it but sometimes brings many problems and makes the code a little harder to read.

    Is it possible to make what I said in the first post? If not then it's ok. just want to know that...

  • anyone?

    at least to know if this is possible or not and to avoid having 3 events where I could have just 1.

  • I have an event that should react to 3 different anims of the sprite, doesn't matter which of those is playing.

    Is there a way to make this short with expressions?

    something like:

    -when X sprite is playing anim ("1","2","3"), makes this stuff happen.

    The ( ) should represent "any of the anims in here".

  • OK, I solved it.

    I'll change the name of the topic and explain what I did cause maybe it's useful for someone else:

    I created another sprite representing the player shoting in all different directions. So, when Z is pressed this sprite becomes visible (it's idle animation has no frames) and the rest of the player becomes invisible. This was the control got more fluid since the main sprite is not bound to the shooting animations and can move freely.

  • My character can shoot like a contra dude, in all directions.

    I'm programming the diagonal up shooting and just can't get the animation to trigger.

    The diagonal/up AIMING does work, but when I prezz Z (shooting key) the diagonal/up SHOOT anim doesn't show. it stays in the aiming thing.

    I couldn't figure out why this was happening so I moved on to the diagonal/down stuff. I programmed it and worked perectly, which is strange since both instances are triggered by the exact same stuff.

    What I did next was erase the diagonal/up stuff and copypaste the diag/down altering it to make it diag/up, so the events are exactly the same but adapted to each case. It still doesn't work.

    here is what I got:

    <img src="http://andresborghi.com.ar/help/problema02.jpg" border="0" />

    REMEMBER: the only thing not working here is "shoot UP DIAG"

  • upperbody set animation : idle

    upperbody set frame : lowerbody.animationframe

    Worked!! thanks a lot!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • noup, this is cause sometimes you can shoot, and the shoot animation only happens in the upper half while the other half remains in the idle. So when the upper one returns to iddle it hardly coincides.

  • my char is divided in 2: waist down and waist up. This is so i can manage complex animations like walking and shooting, etc...

    So, when my char goes to idle/stand animation, sometimes both part don't enter the state at the same time, making it look weird.

    How do i tell one part: "get in this animation but in the same frame as the other sprite's animation"

    and to make it more complex, some frames of the animation don't last 1 but 2 or 2. So, that would make it more difficult by having to match the inner times of the animation.

Borghi's avatar

Borghi

Member since 24 Sep, 2013

None one is following Borghi yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies